Hybrid retrieval, fusion & reranking
Combine keyword and vector search, merge the rankings, and rescore candidates with a stronger model.
Vector search finds meaning, keyword search finds exact terms such as product names, error codes and identifiers. Running both and merging covers each other's blind spots. Reciprocal rank fusion merges by rank, giving each result a score of one over a constant plus its rank in each list, so you do not have to normalise unrelated score scales.
A reranker is a cross-encoder that reads the query and a candidate together and scores relevance directly. It is slower than the embedding comparison, so apply it to a wide candidate set, perhaps 50, and keep the top handful. This step often gives the largest single quality gain after chunking.
Retrieved results can be near-duplicates. Maximal marginal relevance trades relevance against similarity to results already chosen, which gives the model more distinct evidence. Decide how many results to pass on from the answer quality you measure, not from a default.
Key points
- Hybrid search covers meaning and exact terms.
- Reciprocal rank fusion merges rankings without calibrating scores.
- Rerank a wide set down to a few. Measure the latency it adds.
- Use diversity techniques so the context is not five copies of one idea.
Trade-offs
| Choice | You gain | You pay |
|---|---|---|
| Vector only | Simple, strong on paraphrase | Misses exact identifiers and rare terms |
| Hybrid + fusion | Robust across query types | Two indexes to run and keep in sync |
| Add a reranker | Best precision at the top | Extra latency and cost per query |
Answer these out loud
- 1Compute the fused ranking of two lists with RRF, using a constant of 60, for a document ranked 1st and 5th.
- 2Your reranker adds 300 ms. What does the latency budget look like and what would you cut first?
Build it
Add BM25 beside your vector search, merge with RRF, then add a reranker, and report recall@5 and p95 latency for each configuration.
Use this from an agent
Any MCP client, including Grok, can read this lesson. See how to connect.
curl https://engineeros-delta.vercel.app/api/v1/topics/rag-hybrid-retrieval-and-reranking