Learning objectives
- Check retrieval and answer support as separate stages of a document assistant.
- Define cases in which an assistant should state that its sources do not answer the question.
Learn
A retrieval assistant finds candidate material and uses it to generate a response. A relevant-looking passage can be outdated, ambiguous, or only partially related to the question. Track provenance, the version and section retrieved, and whether the answer's exact assertion follows. Keep the assistant's source scope and permissions aligned with the user's authority.
Choose the task before the tool
An AI workflow is a sequence of decisions with different error costs and evidence needs. Exact arithmetic, permission checks and record identity should use deterministic mechanisms with explicit contracts. A language model may help draft or classify, but its output must enter a validation boundary before it controls an action. A polished sentence does not substitute for a verified source or authorization.
Define the task’s allowed outputs and an abstention route. A bounded assistant can decline when the requested evidence is missing. That is meaningful only if downstream code treats abstention differently from an empty but supposedly authoritative answer.
Retrieval, chunking and evidence provenance
Retrieval ranks candidate evidence; it does not decide what the evidence means. Chunk size can separate a rule from its exception, while keyword overlap can rank a negated or outdated statement highly. Evaluate retrieval on whether required evidence is present, and evaluate answering on whether the conclusion follows from that evidence.
Authorization should restrict the candidate corpus before inaccessible passages can influence the answer. Filtering only the displayed citation can still leak private information through generated text. Record stable source IDs, versions and passage locations for reconstruction.
- Create an evaluation case requiring both chunks and score evidence sufficiency separately from fluent answer quality.
- Restrict retrieval to the requester’s authorized documents first. A correct answer based on private unauthorized text is still a boundary failure.
Now suppose A is the general rule's required receipt passage and C is an applicable custom-order exception. Answering a custom-order eligibility question requires both, even though B ranks first. Top-one keyword or cosine relevance does not establish complete evidence. A chunker that separates rule and exception must retain document/section relationships or use an explicitly tested neighbor-expansion strategy. Expanding neighbors must still recheck authorization and version: proximity is not permission. Large chunks can preserve qualifications while admitting irrelevant text and consuming context; small chunks can lose conditions. Compare these settings on questions with known complete support sets rather than selecting chunk size from aesthetics.
For a question whose gold support set is {A,C}, returning {A} has passage recall 1/2 and precision 1/1 under that declared labeling, but complete-support success is zero. Returning {A,B,C} has recall 1, precision 2/3 and complete-support success one. These are retrieval labels, not an assessment of whether generation used the passages faithfully. Record unsupported citations, wrong versions and unauthorized context separately. A fluent answer produced after incomplete retrieval can be a lucky unsupported answer and should not receive grounded-success credit.
A bounded retrieval assistant and operating plan
A release gate connects evidence to an operating decision. Specify the permitted corpus, claim types, action boundaries and failure response before evaluating. Include a transparent non-generative retrieval baseline so generation’s incremental contribution can be measured. A system that cites a passage is not necessarily faithful: it can cite an irrelevant passage or omit an exception.
Version the entire configuration, including model, prompt, retrieval settings, source snapshot and validator. A provider update can change outputs without an application deployment. Rerun representative evaluations after consequential changes and preserve a fallback that is actually tested.
Apply
A fictional library knowledge base contains two public documents. The older one lists a closing time of 7 p.m. The newer one lists 8 p.m. on weekdays and gives no weekend time. A system that retrieves only the older document has a retrieval problem for a clearly dated weekday question. A system that retrieves the newer one and answers “8 p.m. on Sundays” has an answer-grounding problem. A reviewed response can identify the weekday rule and state that the available documents do not establish the Sunday time. Build test cases for conflicting versions, missing coverage, and appropriate source attribution.
In the evaluation record, write the expected supporting passages before running the system. If a question requires both a general rule and a narrow exception, one of the two passages is incomplete coverage. Count those retrieval misses separately from cases where enough support was present but the answer still misread the evidence. That distinction makes it possible to improve the right stage without rewarding an unsupported guess.
Optional check
What if the assistant cites the correct document but draws the wrong conclusion?
Show the explained answer
The citation supplies provenance and the reasoning still fails. Evaluate whether each material claim is supported by the cited portion and whether uncertainty is communicated accurately.