CORE GUIDE
Retrieval is a pipeline, not one search call
Reliable RAG separates candidate generation, filtering, reranking, context assembly and provenance so each failure can be measured and repaired.
Mental model
A retrieval pipeline is a sequence of evidence-selection stages: broad recall finds candidates, filters enforce scope, reranking improves precision, and context assembly chooses the final evidence under budget.
Why it matters
When a RAG answer is wrong, teams often blame embeddings or the model without knowing where evidence was lost. A staged pipeline makes retrieval failures attributable. It also allows different signals—lexical, dense, metadata, authority and recency—to contribute where they are strongest instead of forcing one similarity score to solve every problem.
01
Make each selection stage observable
Start with query understanding and candidate generation from one or more retrieval methods. Apply hard metadata or permission filters before expensive ranking where possible. Rerank a bounded candidate set with richer signals, then assemble context according to relevance, authority, diversity and token budget. Log candidates and decisions so offline retrieval metrics can identify which stage dropped the needed evidence.
02
Example: support question with an error code
A query contains an exact error code plus a natural-language symptom. Sparse retrieval finds the identifier, dense retrieval finds semantically related troubleshooting, account metadata removes the wrong product version, and reranking prioritizes the current runbook. Context assembly then keeps the controlling steps and source metadata rather than dumping every candidate into the prompt.
Common failure modes
- Treating vector top-k as the entire RAG architecture.
- Applying metadata or permission checks only after generation.
- Evaluating only final answer quality and losing visibility into retrieval recall.
Engineering heuristics
- Measure candidate recall before tuning reranking or prompts.
- Keep filtering and ranking decisions traceable by stage.
- Assemble the smallest evidence set that preserves authority and task coverage.
Takeaways
- 01Retrieval quality is produced by a sequence of decisions.
- 02Different retrieval signals solve different failure modes.
- 03Stage-level metrics make RAG failures diagnosable.
Related concepts from the Knowledge Graph
These relationships come from the canonical graph, not a separate Guide taxonomy.