Grounded Search parses the LLM's grounding metadata by matching each text segment's indexed citation pointers to the corresponding source web chunks, resolving redirection URLs into canonical destinations to store the exact attributed segments with their source page.

sequenceDiagram
    autonumber
    participant LLM as Grounded LLM Response
    participant P as Citation Parser
    participant R as URL Resolver
    participant DB as Veracity Storage

    LLM->>P: Output text + Grounding Metadata
    Note over P: Extract groundingSupports<br/>(text segments & chunk indices)
    Note over P: Extract groundingChunks<br/>(web URIs & titles)
    P->>P: Map indices to raw URIs
    P->>R: Send vertexaisearch redirect URIs
    R-->>P: Return canonical destination URLs
    P->>DB: Save mapped segments per URL (veracity_urls)