Generative AI & Agentic AIRetrieval quality and grounded answers

Hybrid retrieval with reciprocal rank fusion

PK
Pankit Kumar
Sr. Data Scientist at Parexel (a Goldman Sachs–backed company) · 20 September 2026 · 2 min read
Technically reviewed by Ishaan Sharma
In this article (5 sections)

Hybrid retrieval can combine lexical precision for exact terms with dense coverage for paraphrases. Reciprocal rank fusion (RRF) combines rank positions without requiring comparable raw scores.

Execute the fusion arithmetic

The retrieval evaluation lab fuses BM25 with an authored dense ranking for one question.

python
from retrieval_cases import rrf_case

result = rrf_case()
assert result["k"] == 60
assert result["top_is_relevant"] is True
assert result["fused"][0] == "refund-v2"
assert result["dense_model_executed"] is False
print(result["scores"])

Each document receives 1 / (60 + rank) from each list where it appears. BM25 executes locally; the dense ranking is a fixture, so the fused result is not a live hybrid benchmark.

Control inputs and candidate depth

Apply access/effective filters before both retrieval paths. Set each candidate depth and fusion constant explicitly. Deduplicate by stable chunk/source identity. A document appearing in both lists gains support, but repeated near-duplicate chunks should not monopolize context.

Evaluate hybrid, BM25 and dense on the same labels. Report recall@*k*, rank, per-query wins/losses, index/query cost and end-to-end answer support. RRF can improve coverage while increasing latency because both retrievers run.

Diagnose rather than assume

Inspect whether gains come from meaningful complementarity or from one weak path adding noise. Try hard negatives with the same vocabulary and exact identifiers absent from embeddings. Consider weighted fusion only after an unweighted baseline and a development set.

The Generative & Agentic AI course links hybrid retrieval to explicit baselines and regression tests.

Exercise

Fuse live BM25 and dense rankings for 50 questions. Compare three candidate depths and two RRF constants on development data, then evaluate the frozen choice once on a release set.

Continue learning

This article is part of the Retrieval quality and grounded answers sequence. Use the neighbouring tasks when you need the prerequisite or the next application.

Reference: Cormack et al. on reciprocal rank fusion.

PK
Pankit Kumar
Lead Instructor, NeuraPath Academy

Pankit Kumar has 10 years in Data Science & AI, building and shipping production systems in regulated pharma and clinical environments. He is a freelance trainer at Boston Institute of Analytics, AnalytixLabs and Scaler, and has taught this material to thousands of working professionals.

This article is part of our Generative & Agentic AI programme — 3 months. Add practical GenAI, retrieval and agent-building skills to your existing toolkit.

Explore Generative & Agentic AI
Counselling is free · no obligation

Not sure which programme fits?

Tell us your background and we will map it to the right entry point — including saying so when a cheaper programme is the better fit. A counsellor replies within one working day.