Skip to content
derpx06.dev
WritingExplainersNotesAbout
works on my machineit's always DNSship itLGTMTODO: sleepoff by oneread the docsgit push --force-with-lease404: sleep not foundhave you tried turning it off and on againrubber duck says: explain itpremature optimisationworks on my machineit's always DNSship itLGTMTODO: sleepoff by oneread the docsgit push --force-with-lease404: sleep not foundhave you tried turning it off and on againrubber duck says: explain itpremature optimisation

Learning in public.

A student's notebook on system design, distributed systems and databases. Shared as I learn.

ReadWritingExplainersNotesAbout
ElsewhereGitHubLinkedInHugging FaceLeetCode
Say hellomanaskhairnar1511@gmail.com
derpx06
NORMALmain© 2026 Derpx06Pune, Indiatop ↑
Learn/LangChain Mastery/Part 6 · 5. Retrieval & RAG Patterns
Lesson 41 of 68

RAG-Fusion

Reciprocal Rank Fusion. The state-of-the-art for robustness.

Derpx0610 Jan · 1 min read
LangChain Mastery
The Retriever InterfaceSimilarity vs MMRMulti-Query RetrievalRAG-FusionQuery DecompositionParent Document RetrievalContextual CompressionPost-Retrieval Re-RankingConversational RAG & History
Contents
1. More than Multi-Query2. The Reciprocal Rank Fusion (RRF) Algorithm3. The Workflow4. Summary
0% read · 1 min leftBack to top ↑
Course outline & contents0%
LangChain Mastery
The Retriever InterfaceSimilarity vs MMRMulti-Query RetrievalRAG-FusionQuery DecompositionParent Document RetrievalContextual CompressionPost-Retrieval Re-RankingConversational RAG & History
Contents
1. More than Multi-Query2. The Reciprocal Rank Fusion (RRF) Algorithm3. The Workflow4. Summary

1. More than Multi-Query

Multi-Query just combines results (Union). RAG-Fusion combines results AND re-ranks them based on consensus.

If Doc A appears in the results for Query 1, Query 2, AND Query 3... it is highly likely to be the correct answer. If Doc B only appears for Query 1... it is likely noise.

2. The Reciprocal Rank Fusion (RRF) Algorithm

It is a mathematical way to sort items by "Consensus."

Score(Doc) = 1 / (Rank in List 1 + k) + 1 / (Rank in List 2 + k) ...

You don't need to understand the math. You need to understand the intuition: "If multiple different search strategies agree that this document is important, it bubbles to the top."

3. The Workflow

  1. Generate 5 variations of the query.
  2. Parallel Search (5x calls).
  3. Apply RRF to merge the 5 lists into 1 master list.
  4. Pass Top-K from master list to LLM.

4. Summary

RAG-Fusion helps fix the "Single Point of Failure" in retrieval. It is more expensive (5x vector search calls), but significantly more robust.

Key Intuition: "Trust the consensus of multiple perspectives."

Track your progressSign in and your progress follows you across devices.
Sign in to track progress Next lesson
← Previous lessonMulti-Query RetrievalNext lesson →Query Decomposition