DOCUMENT SEARCH & ANSWERS
How an AI answer gets its citations
The assistant does not remember your documents. For each question it finds the passages that answer it, reads only those, and marks which one each statement came from.
- AskA question in plain language, to the documents you can access."How many days to file an expense claim?"
- RetrieveThe question is used as a search. The best few passages are picked.8 passages
- ReadThe model receives the question and those passages, numbered. Nothing else.[1] page 29 · [2] page 11
- AnswerIt answers from them alone and marks which passage each statement used."10 working days" [1][2]
- CheckA citation opens the passage, with its heading and page.Employee Handbook · page 29
Why an answer needs a source
Ask a general-purpose chatbot how many days your company gives you to file an expense claim and it will answer. It has never seen your handbook. It will say thirty days, or sixty, because those are common, in a sentence as confident as if it had the page open. For a question about your own policies, contracts or procedures, that is the worst possible behaviour: a fluent answer with nothing behind it.
The cure is not a cleverer model. It is a different arrangement, in which the model is never asked what it remembers. It is shown the relevant parts of your documents and asked what they say. The answer then has a source, and the source can be shown. That arrangement has a name, retrieval-augmented generation, but the mechanics are simple enough to follow without it.
Retrieve first
The first thing that happens to a question is not that a model reads it. It is used as a search. The same question you typed, "How many days do I have to submit an expense claim after a business trip?", is run against the indexed passages of your documents, by words and by meaning together, and the best matches are picked. Not hundreds; a handful, typically 8.
Two things about this step decide everything after it. The search runs only over documents you are allowed to see, so the answer cannot draw on a file you could not open yourself. And what is retrieved is the documents' own text, passage by passage, each still carrying its heading and page. For this question, the top two are the filing deadline section on page 29 of the Employee Handbook 2027 and a matching section on page 11 of the Company Processes Manual 2027.
Then answer, from those passages alone
Only now does the model come in. It receives the question and the retrieved passages, numbered: [1], [2], and so on. It receives one instruction that matters more than any other: answer from these passages, and nothing else, and say which passage each statement came from.
The model's job has become a reading task. It does not need to know anything about expense policy. It needs to read a few paragraphs and report what they say about the question, which is something language models are reliably good at. The handbook says claims are submitted within 10 working days of completing the trip, so the answer says 10 working days, and marks the statement [1] and [2] because both passages say so.
What a citation is
The number after a statement is the whole point. It is not decoration and it is not a general reference to "the handbook". Each number stands for one specific passage that was retrieved for this question: a few paragraphs, with a heading, on a page, in a named document. Open it and you see the passage itself, the author's words, not a paraphrase.
A list of sources under the answer does the same job at a glance. It names each document the answer drew on and the pages cited from it. An answer resting on one page of one current policy reads differently from an answer stitched together from five documents, and the sources line shows which you are looking at before you open anything.
When nothing is found
Sometimes the documents do not cover the question. Then the honest outcome of the retrieval step is nothing: no passage matches well enough to be worth showing. A well-built assistant treats that as an answer in itself. It does not pass the question to the model and hope; it says that the documents it can see do not cover this.
This is the behaviour to test first when evaluating any assistant over documents. Ask it something your documents do not contain, such as the policy on something your company has never had a policy on. An assistant that replies "I could not find this in your documents" is working. One that produces a plausible policy is answering from the model's general knowledge, and the citations on its other answers deserve less trust as a result.
What citations do not guarantee
Citations make an answer checkable. They do not make it right, and it is worth being exact about the difference.
Retrieval can miss. If the passage that holds the answer was not among those retrieved, the model never saw it. The answer may be incomplete, or the assistant may say it found nothing when the document exists. Asking again in different words, or naming the document, usually fixes it.
The model can misread. Reading a passage and reporting it is something models do well, not something they do perfectly. A condition can be dropped, an exception overlooked. The citation is what makes this cheap to catch: the passage is one click away and takes ten seconds to read.
Documents can disagree. Last year's handbook and this year's may both be indexed and give different deadlines. The assistant will report what it retrieved; the sources line is what reveals that two documents are in play. Keeping withdrawn documents out of the index is a housekeeping job no model can do for you.
Narrowing the question
Because retrieval is a search, it can be scoped like one. Asking across everything is the default and the right start. Limiting a question to one workspace, or to a handful of named documents, removes the chance that an unrelated file supplies a passage that merely sounds relevant. Asking about a single document, "what does this contract say about termination?", is the same mechanism with the search confined to that one file.
The same idea, for numbers
Everything here concerns answers that exist as text. A question whose answer is a number computed over many records, such as total orders by region, is not written on any page, and passages are the wrong tool for it. The equivalent discipline there is to have an index compute the figure and let the model only write the sentence around it, described in Why grounded answers don't invent numbers. The principle is identical: the model is given the facts and reports them; it is never the source of them. MCP vs RAG places the two side by side.
How to check an answer in ten seconds
Read the answer. Look at the sources line: is it the document you would expect, and is it current? Open the first citation and read the passage. If the passage says what the answer says, you are done, and you now know something no uncited answer can tell you: where it is written. That habit, more than any property of the model, is what makes an assistant over documents safe to rely on.