When a document assistant answers badly, the instinct is to rewrite the prompt or upgrade the model. In most cases the passage containing the answer was never in the context, and a stronger model cannot read a document it was not given. One log line settles which half is broken: record the retrieved passages beside every answer. If the right passage is missing, you are debugging chunking, vocabulary and ranking — and those are measurable on their own, without the model involved at all.
A document assistant goes live, and within a week someone forwards a screenshot: the bot said there is no such policy, and here is the policy, highlighted, in a PDF it was given.
What happens next is almost always the same. The prompt gets rewritten. Someone suggests a bigger model. A fortnight later the answers are differently wrong, and nobody can say whether anything improved.
The check that settles it
Before changing anything, log the passages that were actually placed in the context, and read them for the failing question.
There are only two outcomes. If the correct passage is sitting right there and the answer still contradicts it, you have a genuine generation problem and prompt work is the right response. If it is not there, then no prompt in the world will help, because the model was asked to answer from material that did not contain the answer.
In our experience the second case is the overwhelming majority, and it is invisible to everyone who only ever reads the final output — which is everyone, unless somebody builds that log on purpose. It costs an afternoon and it ends most of these arguments permanently.
The three ways retrieval misses
When the passage is absent, it is nearly always one of three things, and they are worth naming because the fixes differ.
The answer spans a chunk boundary. Documents get split into pieces before they are indexed. If the split falls between the condition and its consequence, no single piece contains the answer, and the piece that half-matches is the one retrieved. Splitting on a fixed character count guarantees this happens eventually; splitting on headings, clauses or table rows mostly avoids it. The related fix is to keep each chunk's heading path attached, because a fragment reading “within five working days” is worthless when nothing says what it applies to.
The user's words are not the document's words. Customers say “charges”; the policy says “tariff”. Staff say “the old portal”; the runbook names a product nobody has called that in four years. Embeddings handle paraphrase well and handle this badly, because these are not paraphrases — they are different vocabularies for the same thing. Exact strings are the sharpest version: part numbers, error codes, clause references, internal acronyms. Vector search is weakest precisely where business documents are densest.
The right passage ranked just below the cut-off. You take the top handful of results. The correct passage came fourth and you took three. Nothing is broken, nothing logs an error, and the answer is wrong. Reranking the candidates with a model that scores question-and-passage pairs directly is the standard remedy, and it is far cheaper than it sounds because it runs over a short list.
What actually helps
In rough order of how often it pays off:
Hybrid search. Run keyword search alongside vector search and merge the results. This single change fixes the entire exact-string category — codes, references, acronyms — which in a business document set is a large share of real questions. For most corpora we have worked with, this moves the number more than anything done to the prompt.
Structure-aware chunking. Split on what the document is made of, not on a character count, and carry the headings through.
Reranking. Retrieve generously, then reorder with a scoring model and keep the best few. It turns the cut-off problem from a coin flip into a decision.
Fixing the documents. Unglamorous and frequently the largest effect. A scanned contract with no text layer is invisible to every search you can build over it — which is the same extraction quality problem wearing different clothes. Three near-identical policy versions in the index will be retrieved at random. Nobody wants the answer to be housekeeping, and it often is.
Measure retrieval on its own
The reason these projects stall is that quality is judged end to end, by reading answers and forming an impression. That number moves for reasons nobody can attribute.
Separate it. Take a set of real questions — from a support queue, not from imagination — and for each one record which document and passage should answer it. Then measure one thing: how often retrieval returns that passage at all, with no model involved.
That figure is a property of your content and your index. It moves when you change chunking or add hybrid search, and it stays still when you change the prompt, which is exactly what makes it useful. It also tells you the ceiling: if retrieval finds the right passage seven times in ten, no model gets you past seven in ten, and you now know what to work on.
This is the same discipline as writing the evaluation set before the bot exists, and it is the difference between a project that improves and one that merely changes. It is also what makes a refusal trustworthy: a bot that says it cannot find something is only useful when you know what its retrieval actually reaches, which is the other half of measuring whether an assistant resolves anything.
A sensible order of work
- Log the retrieved passages with every answer, from day one.
- Build a question set with expected passages from real traffic.
- Measure retrieval alone and treat that number as the ceiling.
- Add hybrid search before touching the prompt.
- Chunk on structure and keep heading context attached.
- Rerank if the right passage is being found but dropped.
- Only then consider the prompt and the model.
Most of that list is ordinary engineering rather than anything to do with AI, which is roughly the point. The model is the part everyone discusses and rarely the part that is wrong.
Questions we get asked
How do we tell a retrieval failure from a model failure?
Log the passages that were put into the context alongside every answer, then read them for the failing question. If the passage containing the correct answer is not there, no amount of prompt work will fix it and you are debugging retrieval. If it is there and the answer is still wrong, you have a genuine generation problem. This one check saves most of the time teams spend tuning the wrong half of the system.
Why does the assistant miss answers that are clearly in the documents?
Usually one of three reasons. The answer spans a chunk boundary, so no single chunk contains it whole. The user's words differ from the document's words, as when customers say charges and the policy says tariff. Or the right passage ranked just below the cut-off and was dropped. All three are invisible if you only read the final answer, and obvious the moment you read the retrieved passages.
Does a better model fix bad retrieval?
No. A stronger model cannot read a document it was not given. Upgrading the model when the passage was missing changes the wording of the wrong answer and nothing else, which is why these projects can absorb a lot of spend without improving. Fix what reaches the context first; model choice is a later and much smaller decision.
What is hybrid search and when do we need it?
Running keyword search alongside vector search and merging the results. Vector search matches meaning and is weak on exact strings — product codes, error numbers, policy references, internal acronyms — which are precisely the terms people search for in a business document set. If your content is full of identifiers, hybrid search usually produces a larger improvement than any amount of prompt engineering.
How should chunking be decided?
By the structure of the documents rather than by a fixed character count. Splitting on headings, clauses or table boundaries keeps a complete thought in one piece; splitting every thousand characters cuts answers in half at random. Overlapping chunks help, and keeping each chunk's heading path attached to it helps more, because a fragment that says the limit is five working days is useless when nobody can tell what it applies to.
How do we measure retrieval separately?
Build a set of real questions with the document and passage that should answer each one, then measure how often retrieval returns that passage at all, without involving the model. That number is a property of your content and your index, it moves when you change chunking or search, and it tells you the ceiling on answer quality. End-to-end judgement of the final answer is useful too, but it cannot tell you which half to fix.
If an assistant is giving wrong answers and the next planned step is a bigger model, the cheaper step is reading what went into its context. It is the first thing we instrument on chatbot projects, because it decides what the rest of the work should be.