From Search Results to Cited Answer
In this article
- Trace one question through the four handoffs of a RAG request: candidates, ranked list, evidence pack, answer.
- Say when the reranker runs and when the path skips it and keeps the first-stage order.
- Check in code that every citation in a reply points to a packed id whose text backs the claim.
- Explain when the path abstains, and why that is the correct reply.
Overview
A made-up internal policy assistant answers employees' questions about HR and travel policy from 120 documents, each with a list of the groups allowed to read it. Search already finds the chunks (passages of a document, each stored and searched on its own) that the asker may read. A list of passages is not yet an answer an employee can trust. Four steps sit between them: keep the best chunks, pack them for the model, generate, and check what came back. Each step can lose the right passage, invent a source or leak one the asker may not read. Afterwards you can lay out that request path as four functions that each hand a typed object to the next, say when the reranker runs, verify citations in code, and recognise the reply that should be "the documents do not say".
Sign in to keep reading
The rest of this article opens with an account. An account also keeps your progress and quiz results on every device, and lets you follow news for up to five topics.
Still to read in this article
- Four handoffs
- Forty candidates, eight kept
- Packing the evidence
- Checking every citation
- When the evidence is not there
- Common mistakes
- In production
- Sources
- Check yourself, 13 questions