What you need to know
A grounded answer can fail at four stages: the evidence was not in the index (data), was not retrieved (recall), was retrieved but ranked too low to reach the model (ranking), or reached the model and was not used correctly (generation). Fixing the wrong stage wastes effort. Diagnose by stage first.
Diagnose by stage
For a sample of wrong answers, check where the right passage was lost:
| Finding | Stage | Typical fixes |
|---|---|---|
| The document is missing or outdated in the index | Data | Incremental indexing with deletions; version and date metadata |
| The right passage is not in the candidate set | Recall | Better chunking, contextual embeddings, hybrid search, metadata filters |
| It is in the top 50 but not the top 5 | Ranking | A reranker; choose cutoffs from measured recall |
| It reached the model, which used another passage | Generation | Instructions, quote-first answering, citations |
Measure stages separately: recall at k isolates retrieval, and groundedness (are the answer's claims supported by the passages provided?) isolates generation.
Agentic search versus RAG
| Favors agentic search (list, grep, open, query) | Favors RAG (index, retrieve, rerank) |
|---|---|
| Content changes many times a day (code, live records) | Large, slowly changing corpus |
| Answers follow references across files or records | One retrieval step answers most questions |
| Freshness matters more than speed | Tight latency targets |
Agentic search usually costs more tokens and time per question; it buys freshness and multi-hop reasoning.
Chunking and embeddings
- Structure-aware chunking keeps tables whole with their headings and respects section boundaries. Fixed-size cuts split tables from their labels.
- Contextual retrieval prepends a short, generated description of each chunk's place in its document before embedding, so chunks like "the limit in clause 4.2 shall not exceed this amount" become retrievable and interpretable.
- Embedding model changes require re-embedding the whole corpus, ideally into a new index switched over after evaluation; vectors from different models are not comparable.
Hybrid search, filters and reranking
Dense embeddings blur exact tokens such as part numbers and codes. Hybrid search adds keyword matching (for example BM25) and merges the lists. Metadata filters (product, tenant, version, access rights) remove wrong-scope content before ranking. A reranker reorders a larger candidate set so the best passages reach the model; tune how many candidates it scores from recall curves, since scoring hundreds per query costs latency.
Grounding practices
| Practice | How |
|---|---|
| Source citation | Send documents with citations enabled, or pass retrieved passages as search result blocks, so claims link to exact text |
| Uncertainty declaration | Instruct Claude to say when the sources do not cover the question, rather than answering from memory |
| A no-evidence path | When nothing passes a relevance threshold, a designed response and a route to a person |
| Confidence signals | Derive from evidence (how many passages support the answer, whether they agree), then calibrate against reviewed answers |
| Source policy | Apply the same allowed sources to every retrieval path; a second, unrestricted search tool bypasses the policy |
Permission-aware retrieval
Filter results by what the user may see before they reach the model. Once a confidential memo is in the context, no instruction can un-retrieve it, and ranking tweaks do not enforce access.
In the exam
Retrieval items give stage-level evidence or a symptom (wrong product, exact codes failing, tables failing, stale policies, citations that do not support claims). Locate the stage, then choose the fix for that stage. Distractors change the prompt for a recall problem, retrieve far more passages, enlarge chunks blindly, drop a stage that drives quality, or answer from training data.
Check your understanding
Questions with exact part numbers return passages about similar parts. Which change helps most?
Show answer
Answer: D. Embeddings blur exact identifiers; keyword matching and structured filters find them directly.
Recall at 20 is 92% but recall at 5 is 61%. What does the evidence support?
Show answer
Answer: A. The right passage is usually retrieved but ranked too low; reranking targets exactly that gap.
An HR assistant returned an excerpt from a confidential compensation memo to an employee. What is the fix?
Show answer
Answer: C. Access control must apply before content enters the context; prompts and ranking cannot enforce it.
Apply it: Diagnose Tidewater's grounding
Tide's groundedness is 91% on a sample, but large tenants complain about wrong answers on documents with tables and on questions with product codes. The index is rebuilt nightly; tenants upload and delete documents all day. A sample of 150 wrong answers has been labeled by stage: 30 used a deleted or superseded document, 55 never retrieved the right passage (most of them table or product-code questions), 40 retrieved it below the top 5, and 25 had it in context but answered from another passage.
- Rank the stages by impact and propose one fix per stage.
- Choose the metrics that will show each fix worked.
- Design the no-evidence path for questions the tenant's documents do not cover.
- State the access rule that keeps one tenant's documents out of another's answers.
Show model answer
1. Stages and fixes
| Stage | Count | Fix |
|---|---|---|
| Recall | 55 | Structure-aware chunking that keeps tables whole; contextual retrieval; keyword search and product-code metadata in the hybrid index |
| Ranking | 40 | Rerank the top 50 candidates, cutoff chosen from recall at 5 and 20 |
| Data | 30 | Incremental indexing on upload and delete, with version metadata; superseded versions excluded |
| Generation | 25 | Citations on; quote the supporting passage before answering |
2. Metrics. Recall at 5 and at 50 on a labeled question set, split by question type (tables, codes, prose); share of answers citing superseded documents; groundedness of claims against provided passages on sampled traffic.
3. No evidence. If no passage passes a relevance threshold, Tide says the tenant's documents do not cover the question, shows the closest documents it searched, and offers to open a support request. It does not answer from training data.
4. Access. Every query carries the tenant ID and user ID from the gateway; the index filters by tenant and by the user's document permissions before ranking. No passage from another tenant can be retrieved, whatever the prompt says.