Building a grounded document QA agent with traceable citations

A method for building a grounded document QA agent ensures each answer traces to specific page numbers and original text. The pipeline uses LlamaParse for layout-aware parsing, LlamaIndex for retrieval, and CitationQueryEngine for inline citations. A verification UI displays page, retrieved text, and relevance scores for debugging.