Beginner30-60 minsource metadataprompt templateUI source panel
Add citations to RAG answers
Design answer traceability so users can verify claims quickly.
Prerequisites
- Source IDs
- Document titles
- Page or section metadata
Step-by-step tutorial
Step 1
Preserve citation metadata
Citations cannot be added reliably at the end if source information is lost during ingestion.
- Store source ID
- Store title
- Store page or section
- Keep snippet text
Step 2
Prompt for source-grounded claims
Ask the model to cite only retrieved sources and admit when sources do not support an answer.
- Require citations
- Ban unsupported claims
- Show no-answer behavior
- Test confusing sources
Step 3
Design the UI
Users should see enough source context to judge whether an answer is credible.
- Show snippets
- Link originals when allowed
- Indicate dates
- Display authority or source type
Next steps
- Add claim-level citations
- Evaluate citation correctness
- Add source freshness labels