SHEN YIFull-Stack & AI

Paris • Singapore • Shanghai

RAG Formation · Lesson · Grounded answer generation

Citation design and source fidelity

Build citations that are stable, useful, and tied directly to the evidence behind the answer.

$ lesson --status
▸ course RAG Formation
▸ lesson 11 / 16
▸ phase Grounded answer generation
▸ status Complete
● build → measure → learn

Standalone lesson

Learn the full lesson and test your understanding here.

The 16-lesson RAG Formation curriculum is complete. This page contains the complete lesson content, local reference material, and instant browser exercises.

Today’s tangible win

By the end of this lesson: a citation contract that nails down document identity, chunk/page identity, claim mapping, and deduplication rules.

Watch the walkthrough

1 · The skill

Pick one of q28, q30, q46, or q63 and audit it — trace every material claim in the answer back to the source that actually backs it up.

  • Citation fidelity: the source you cited actually contains or backs up the claim, not just something adjacent to it.
  • Citation completeness: every material claim has a solid source behind it — this matters even more once an answer chains several hops together.
  • Citation identity: a stable document and chunk reference a user can actually look up and reproduce.

Primary reading: Anthropic — Search Results with Citations

2 · Run the evidence loop

cd demo
python3 eval.py run --mode answer --workspace meridian_demo --tag lesson-11-citations

Log missing, extra, and misleading citations as their own category — don’t fold them into whether the answer itself was correct.

A filename isn’t a faithful citation if the document behind it never actually backed the claim you showed the user.

3 · Decision worksheet

Baseline evidenceOne hypothesis/changeMetricRegression checkBounded conclusion
_________________________

4 · Retrieval practice

Question: The answer clearly leans on two sources, but only one shows up in the citations. What do you check first?

Mission connection

For a regulated chatbot, citations aren’t decoration — they’re the bridge between an answer and the controlled evidence a QA reviewer or auditor can go check for themselves.

5 · Deliverable and next action

  1. Save the command output or write up a short report.
  2. Fill out the decision worksheet.
  3. Write down one failure case and the next thing you’ll verify.

The deliverable: a citation contract that nails down document identity, chunk/page identity, claim mapping, and deduplication rules.

Next: Lesson 12 — Refusal, uncertainty, and hallucination control.

Ask me anything about the evidence, the metric, the failure case, or what to try next — that’s what I’m here for in this course.