Skip to content
47% off: the complete course for $79 (reg. $149)Order now →
AI Builder
Module 5Full course10 min read

Citations and Grounded Answers

Make every claim traceable: citation formats, provider citation features, verifying quotes against sources, and UI that lets users check the work.

A RAG answer without citations asks the user to take it on faith, and users have learned not to. The moment someone spots one wrong answer from your help-center assistant, they stop trusting the right ones too, unless they can check. Citations turn "the AI says so" into "the refund policy, section 3, says so," which is a claim a person can verify in five seconds.

Citations also help you. An answer whose claims each point at a source can be checked automatically, while one that floats free can only be checked by a human reading everything. In this lesson you'll choose a citation format, implement it two ways (prompted structured citations and Claude's native citations), verify citations in code, and design an interface that makes checking the work effortless.

What citations prove, and what they don't

Two words get used interchangeably and shouldn't be. An answer is grounded when every claim in it is supported by the provided sources. An answer is cited when its claims point at sources. Citations are evidence of grounding, not proof of it.

A citation can fail in three distinct ways:

FailureExampleHow you catch it
Fabricated sourceCites a source ID or URL you never providedCheck IDs against what you sent (code)
Fabricated quoteQuotes text that doesn't appear in the sourceSubstring match against the source (code)
Unsupported claimCites a real passage that doesn't say what the answer claimsCompare claim and passage (grader model or human)

The first two are cheap to rule out completely, and you should. The third is the hard one, because the citation looks perfect: real source, real quote, wrong conclusion. "Refunds are available within 30 days" cited to a passage that says "Refunds for monthly plans are available within 30 days" is a correctly cited, ungrounded answer for an annual-plan customer.

Keep that distinction in mind through the rest of the lesson. Your goal isn't citations for their own sake; it's answers whose support is easy to check, by code where possible and by people where necessary.