# Citations and Grounded Answers

> Make answers verifiable: cite sources, quote evidence, refuse when context is missing, and detect unsupported claims. Free notes, key concepts, resources and a...

Canonical: https://www.internhack.in/roadmaps/tracks/ai-engineer/citations-grounding
Last updated: 2026-11-28

Make answers verifiable: cite sources, quote evidence, refuse when context is missing, and detect unsupported claims.

Intermediate · about 3 hours · difficulty 3/5

Learn first: [RAG Fundamentals](https://www.internhack.in/roadmaps/tracks/ai-engineer/rag-basics), [Structured Outputs and JSON Schema](https://www.internhack.in/roadmaps/tracks/ai-engineer/structured-outputs)

Users trust RAG answers more when they can click through to the source, and you can debug faster when every claim is linked to a chunk.

### Techniques

- **Numbered sources**: give each chunk an ID in the prompt and ask the model to cite IDs inline, like \[2\]. Map IDs back to document titles and links in the UI.
- **Provider citation features**: some APIs accept documents and return answers with structured citations pointing at exact passages, which is more reliable than parsing brackets.
- **Quote first**: ask the model to extract supporting quotes, then answer from them.
- **Structured output**: return `{answer, citations: [{source_id, quote}]}` and verify each quote actually appears in the cited chunk.
- **Abstain**: instruct the model to say it could not find the answer when the context does not support one, and treat that as a valid outcome in your UI.

### Checking groundedness

- String-match quotes against sources.
- Use a second model call (an LLM judge) to check whether each sentence is supported by the cited text.
- Track the rate of unsupported claims in your evals.

### Pitfalls

Models sometimes cite a real source for a claim that source does not make. Citations reduce hallucinations; they do not eliminate them. Verification is what makes citations meaningful.

### Good enough to move on

Your RAG app returns inline citations that link to sources, verifies quotes programmatically, and cleanly declines out-of-scope questions.

## Key concepts

- **Inline source IDs**
- **Provider citation APIs**
- **Quote verification**
- **Abstaining when unsupported**
- **Groundedness checks with an LLM judge**

## Mini project

Extend your RAG app to return structured answers with citations and supporting quotes, verify every quote against the source chunk, and flag answers with unverifiable quotes in the UI.

## Check yourself

Your answer has a citation for every sentence. Why is that still not proof the answer is correct?

## Free resources

- [Anthropic docs: citations](https://docs.anthropic.com/en/docs/build-with-claude/citations) (Anthropic)
- [Anthropic docs: reduce hallucinations](https://docs.anthropic.com/en/docs/test-and-evaluate/strengthen-guardrails/reduce-hallucinations) (Anthropic)

Previous: [Reranking Retrieved Results](https://www.internhack.in/roadmaps/tracks/ai-engineer/reranking) · Next: [Evaluating Retrieval Quality](https://www.internhack.in/roadmaps/tracks/ai-engineer/retrieval-evaluation)

## More in Retrieval-Augmented Generation

- [RAG Fundamentals](https://www.internhack.in/roadmaps/tracks/ai-engineer/rag-basics)
- [Document Ingestion and Parsing](https://www.internhack.in/roadmaps/tracks/ai-engineer/document-ingestion)
- [Hybrid Search: Keywords Plus Vectors](https://www.internhack.in/roadmaps/tracks/ai-engineer/hybrid-search)
- [Reranking Retrieved Results](https://www.internhack.in/roadmaps/tracks/ai-engineer/reranking)
- [Citations and Grounded Answers](https://www.internhack.in/roadmaps/tracks/ai-engineer/citations-grounding)
- [Evaluating Retrieval Quality](https://www.internhack.in/roadmaps/tracks/ai-engineer/retrieval-evaluation)
- [Advanced RAG Patterns](https://www.internhack.in/roadmaps/tracks/ai-engineer/advanced-rag)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [AI Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/ai-engineer)
