1:1 mentoring with Big Tech AI engineers
RAG & MCP

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

Core13 min readFirst readEmbeddingsVector Indexes & Stores

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
08

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.

Key idea

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.

The answer is 5th for dense search, 1st for BM25, and stays first
Dense searchBM25RRF fusion, k = 60Reranker top 50 of 40,000top 50 of 40,00050 kept of up to 100keeps 5, illustrative 511129231–32 outside the top 50 A · E-4502 noteB · payments runbookC · declined-card page ABC Dashed ring: that retriever’s blind spot

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.

ChunkDense, BM25,
fused, rerank
A note5th, 1st, 1st, 1st
B runbook2nd, 9th, 2nd, 3rd
C paraphrase1st, –, 3rd, 2nd

Related

More in RAG & MCP

Get full access to all 149 sections with code examples, diagrams, and interactive animations.

Unlock Premium