Learn/LangChain Mastery/Part 6 · 5. Retrieval & RAG Patterns
Lesson 41 of 68
SyllabusLangChain Mastery · Part 6

RAG-Fusion

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

Course outline & contents
LangChain Mastery
The Retriever InterfaceSimilarity vs MMRMulti-Query RetrievalRAG-FusionQuery DecompositionParent Document RetrievalContextual CompressionPost-Retrieval Re-RankingConversational RAG & History

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.

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."

  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.

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