Reciprocal Rank Fusion (RRF) merges ranked results from multiple searches. Each document receives a reciprocal-rank score from every list, and documents recurring across lists rise in the final ranking. section 9.6 section 10.7.4
In retrieval-augmented generation, generate several query variations, retrieve results for each, accumulate scores, rerank the combined documents, and send only the top results to the language model. section 10.7.4
The practical RRF workflow is:
- Generate three to five alternative queries that express different phrasings or perspectives on the user’s question. section 9.6
- Retrieve a ranked result list for each generated query. section 10.7.4
- Add 1 / (rank + k) for each document occurrence, using k=60 as the typical smoothing value. section 9.6
- Sort by cumulative score and pass the selected top results into the final RAG prompt. section 10.7.4
A multi-query RAG chain
A LangChain pipeline can map a retriever over generated questions, apply reciprocal_rank_fusion, keep the top three documents, and inject them into an answer prompt. A question about a trip to Brighton then produces a synthesized list of travel tips.


