Kolkata ·  
AI engineering
retrieval
short · 3 min

Citations

Tying each claim in an answer to the exact place in a source that backs it, and showing that on screen.

updated 27 Sept 2026

In one usability study, a person said they trusted a chatbot's answers because they could always click through to the source. Then, for the whole session, they never clicked a single one.

Keep that person in mind. A citation ties one claim in an answer to the exact spot in a source that backs it. It's how grounding becomes something you can see. But a little marker next to a sentence makes the answer look checked whether or not anyone checks it. So who is the citation actually for? Let's look at what one is first.

A pointer, not a footnote

Take a tiny document: "The grass is green. The sky is blue." Ask Claude's API what color the grass and sky are, with citations switched on. The answer doesn't come back as one string. It comes back in pieces:

Join the blocks and you have the answer. Keep them apart and you know which words rest on which sentence. For plain text the pointer is a character range, for a PDF a page range, and for chunks you split yourself it's the chunk's index. Behind the scenes the API cuts each document into the smallest pieces it can cite, sentences by default. So if you're doing retrieval, pass each retrieved chunk as its own document, and citations point at the chunk your retriever found.

Asking for them versus getting them

The other way is to number the passages in the prompt and ask the model to write [1], [2] after each claim. That works on any model. But nothing checks it. A number or a "quote" the model typed out is only as good as the model's attention.

With a built-in feature like Claude's, the API pulls the cited text out itself, so every pointer lands on real text in your documents. The quoted text doesn't count as output tokens either. (Anthropic also says its feature picks more relevant quotes than prompting does. That's their own claim, with no number attached.)

Now, a valid pointer still isn't proof. The API promises the cited sentence exists. It doesn't promise the sentence supports the claim next to it.

There's a catch on Claude too. If citations are on and you also ask for structured output with a strict JSON schema, you get a 400 error. Citations come back as text mixed with citation data, and a strict schema allows only your JSON. So each call picks one. Need both? Take the citations and build your structure from the blocks afterwards, or add a quote field to your schema and accept that nothing promises the quote is real.

Also, citations are on for every document in a request or none, and only text can be cited, so no images or scanned PDFs without a text layer.

Putting them on screen

Put the source right next to the claim it supports, not in a list at the bottom. Label it with the document or article title, not a bare number or URL, and link to the relevant part of the source. Style it differently from the answer, so it doesn't read as more of the model's text. If the answer streams, citations stream too: on Claude each one arrives as its own small update attached to the text being written, which you place as part of the streaming UI.

And watch out for links that look right. Chat products have shown citations to pages that don't exist, and to real pages that don't say what the answer claims. Built-in citations over your own documents fix the first problem. They do nothing about the second.

Which brings us back to the person who never clicked. They aren't going to check whether the cited sentence backs the claim. So the checking has to happen in our evals, with code, before anyone sees the answer.

Further reading

  • Citations, Anthropic, undated (checked 2026-09-27). The whole mechanism, with the grass-and-sky example, streaming, and the clash with structured outputs. Read it before you wire this up.
  • Explainable AI in Chat Interfaces, Megan Chan (Nielsen Norman Group), 2025. Where the person who never clicked comes from, plus practical advice on showing sources.