Retrieval & Reranking
Why production RAG runs dense and BM25 search side by side, how reciprocal rank fusion merges the lists, what a reranker can and cannot fix, and how to repair a query and follow one chunk through the funnel.
Last updated
After this section you can
- Trace one query through dense search, BM25, RRF and a reranker and say what each stage can and cannot change
- Fix a keyword miss by reading the analyzer’s tokens, and fuse two ranked lists with RRF
- Find the stage that lost the right chunk by logging its rank after each stage
Retrieval & Reranking: Hybrid, Fusion, Rerankers
Part 1 left you an index that is whole, filtered and current. Now find the right chunk in it, and see which stage loses it.
Retrieval is a funnel: each stage can only reorder what the stage before it kept. Dense search and BM25 miss in opposite places, so run both and fuse their lists by rank; a reranker then picks the few chunks the model sees. Log the right chunk’s rank after each stage: the first stage that loses it is the one to fix.
Illustrative scenario for the query “error code E-4502 on the payment gateway”: rank 1 is the top, – is outside the top 50, and only the fused ranks are computed. They assume A and B are the only chunks both retrievers return: any other chunk in both lists would outrank C, and one 4th in both would land between A and B.
| Chunk | Dense, BM25, fused, rerank |
|---|---|
| A note | 5th, 1st, 1st, 1st |
| B runbook | 2nd, 9th, 2nd, 3rd |
| C paraphrase | 1st, –, 3rd, 2nd |