Basic RAG works. Why does retrieval still fail?
A document may be split at the wrong place, an exact product code may be missed by semantic search, or a relevant passage may appear in the top 20 but be pushed out by a reranker.
Advanced RAG is mostly about improving and measuring the path from source document → candidate passages → final context.
Chunking decides what unit can be retrieved
If chunks are too large, one vector may represent several unrelated ideas and consume too much context. If chunks are too small, the answer may be split away from the surrounding explanation.
Chunking choices
Chunk boundaries change what retrieval can prove
Hybrid retrieval uses more than one signal
A query such as “INV-009381 late-payment policy” contains both an exact identifier and a semantic description. Lexical search is strong for the code; dense retrieval is strong for related meaning. Hybrid retrieval combines both candidate sources.
Reranking asks a more expensive second question
Retrieve broadly
Use dense, lexical, or hybrid retrieval to get perhaps the top 20 candidates.
Rerank narrowly
Apply a more precise scoring model to those candidates.
Assemble context
Keep the strongest evidence that fits the context budget.
Generate
Ask the LLM to answer using the selected evidence.
This separate illustrative pipeline uses two candidate lists of up to 20 results and then selects five context passages. These are tunable example counts, not recommended defaults. Read the narrowing path as a sequence of decisions about which evidence deserves the limited context space.
Retrieve broadly, rerank deeply, send only the strongest context
Measure retrieval separately from generation
Suppose an evaluation query has 2 known relevant chunks. If only 1 appears in the top 3 retrieved results:
If Recall@3 improves from 0.50 to 1.00 for that case, retrieval found both labelled relevant chunks in the top 3. Generation, citation support, latency, and safety still need separate evaluation.
Why the next lesson matters
We can now measure retrieval quality. How do we evaluate the whole LLM application—including answer quality, latency, structure, safety, and product constraints?
LLM Evaluation →Summary / Key Takeaways
- Chunk size determines the unit of retrieval; overlap can preserve boundary context but duplicates content.
- Hybrid retrieval combines lexical and dense signals when exact terms and semantic meaning both matter.
- Reranking applies a more precise second-stage score to a smaller candidate set.
- Debug the first stage where the relevant evidence disappears instead of changing unrelated components.
- Recall@k measures retrieval coverage of known relevant items; 1 of 2 relevant chunks retrieved gives Recall@3 = 0.50 in the example.
- Better retrieval metrics do not by themselves prove the final LLM answer is correct.