Citation
ConceptsA citation links an answer or extracted value to its source in a document. Citations provide transparency and let users verify information. They are a key defense against hallucination: by showing where information came from, citations hold the LLM accountable and enable verification.
Citations in Chat
When you ask a question in RAG chat, the response includes numbered citations. Each citation references:
| Element | Description |
|---|---|
| Document | File name and ID |
| Page | Page number where the passage appears |
| Excerpt | The relevant passage text |
| Confidence | How relevant the passage was to the query |
The LLM is instructed to cite by number and to never invent information not present in the excerpts. When the model cannot find relevant context, it should say "Not found in your documents" rather than fabricate an answer.
Citation Formats
Citations can appear in different formats depending on context:
- Inline —
[1]or superscript numbers linking to sources - Footnote — Numbered footnotes at the end of the response
- Expandable — Click to expand and view document, page, excerpt
The RAG chat UI displays citations with links to the source document and page for verification.
Citations in Extraction
Extraction returns citations per field:
{ "field": "total_amount", "value": 1250.00, "citations": [ { "text": "Total Due: $1,250.00", "page": 2, "bbox": {...} } ] }
This shows exactly where each value was found, supporting audit and correction workflows. When confidence score is low, inspect the citation to verify or correct the value.
UX Guidance
- Prominent placement — Make citations visible and clickable
- Source preview — Show document name, page, and excerpt on hover or click
- Verification — Enable users to open the source document at the cited page
- Trust — Citations build trust by showing answers are grounded in documents
Citations are especially important for high-stakes use cases (legal, financial, compliance) where verification is required.
Related Concepts
Citations are produced by RAG and extraction. Hallucination is reduced when answers are cited. Confidence scores complement citations by indicating reliability. Ground truth uses corrections informed by citations.