Reciprocal rank fusion
Reciprocal rank fusion is a rank-aggregation technique that combines ranked lists by summing reciprocal-rank contributions for each item across the lists.
AI Agents and Applications
Reciprocal Rank Fusion is a result-merging method that scores documents by summing reciprocal rank contributions across multiple ranked lists.
- How it is used
- Improves RAG retrieval when multiple query formulations or heterogeneous retrieval methods produce complementary ranked lists.
- How deep it goes
- Explains the scoring formula, cumulative reranking, Python implementation, LangChain composition, and final prompt integration.
- Examples
- Demonstrates five query variations, vector-store retrieval, top-three selection, and a Brighton travel question answered through a RAG chain.
- What you can do after
- Build RAG fusion with LangChain by generating queries, retrieving results, applying RRF, selecting top documents, and synthesizing an answer.
Read how AI Agents and Applications explains reciprocal rank fusion →
AI-Powered Search
Reciprocal rank fusion is a rank-based result-combination algorithm that merges rankings from multiple retrieval systems using reciprocal-rank contributions.
- How it is used
- Combines lexical and vector retrieval results into a hybrid ranking.
- How deep it goes
- Explains the scoring loop, aggregation, sorting, and k trade-off, while stopping short of formal evaluation.
- Examples
- Uses the queries "singin' in the rain" and "the hobbit" with lexical, vector, and hybrid result comparisons.
- What you can do after
- Apply it via a Python function or hybrid-search API to merge ranked retrieval results.
Read how AI-Powered Search explains reciprocal rank fusion →
AI Agents in Action, Second Edition
Reciprocal rank fusion combines ranked result lists by summing the reciprocal of each result's rank offset across the lists.
- How it is used
- Combines vector and keyword result lists into ranked context for hybrid search and retrieval-augmented agents.
- How deep it goes
- Defines the rank-only formula, explains its score-independence, and stops short of implementation code for the fusion function.
- Examples
- Uses parallel vector and keyword result lists, a typical constant of 60, and an agent selecting separate search tools.
- What you can do after
- Apply it via hybrid search to merge incompatible ranked outputs into grounded, comprehensive retrieval context.
Read how AI Agents in Action, Second Edition explains reciprocal rank fusion →
Related concepts
- retrieval rankinguses · Retrieval ranking is the process of ordering retrieved candidates according to their estimated relevance or usefulness to a query.
- hybrid searchused by · Hybrid search is an information-retrieval technique that combines multiple retrieval methods or relevance signals to find or rank relevant results.
- lexical searchuses · Lexical search retrieves or ranks items by matching query terms or other surface-text features against indexed content, often using sparse representations and statistical weighting.
- similarity searchuses · Similarity search is a retrieval technique that finds or ranks items by comparing their representations with a query according to a similarity or distance measure.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


