core practice · implementation task
Implement reciprocal rank fusion
Given two ranked result lists (BM25 and vector), fuse them with RRF: score(d) = Σ 1/(k + rank_i(d)), k≈60.
The mechanism
Lexical search nails exact terms and rare tokens; vector search captures meaning. Hybrid search runs both and fuses the rankings (commonly Reciprocal Rank Fusion) so you get precision and recall together.
Expected evidence
A single fused ranking that uses rank, not raw scores.
Try this drill in the practice workspace →
Hints when you need them
- RRF uses ranks, sidestepping incomparable score scales.
- A document missing from a list simply contributes nothing from it.
Watch for these mistakes
- Naively averaging incomparable BM25 and cosine scores
- Skipping RRF and instead picking one retriever per query
- Not re-evaluating after adding the second retriever