liveBook · Manning

Fusion rag

As explained in Retrieval Augmented Generation, The Foundational Ideas

RAG-Fusion is a retrieval technique that generates multiple queries, retrieves documents for each, and fuses the ranked results before generation.

A single-query RAG system can miss an answer that is already in its corpus. “Why is my internet slow?” may not retrieve a document about packet loss; a multi-part question may retrieve only one facet. RAG-Fusion addresses this coverage problem by searching from several perspectives, then merging the ranked results before answer generation. section 8.1 section 8.0

The query-time pipeline has three retrieval steps:

  • Generate queries for distinct facets or interpretations, not merely synonyms. “Best laptop for college” could become searches about durability, portability, price, and battery life. section 8.2
  • Retrieve a ranked document list for each query, with the searches run in parallel. section 8.0
  • Merge the lists with Reciprocal Rank Fusion (RRF), which uses document ranks rather than raw retrieval scores. Pass the fused documents to the answer generator. section 8.0 section 8.4

Product search: “warm winter jacket”

A single search returns close wording matches such as “Men’s Warm Winter Jacket.” Facet-specific searches also surface down parkas and fleece-lined ski jackets. The fused list offers more kinds of relevant options, though a broader list is not automatically more precise. section 8.5 section 8.6

Start with a small set of distinct queries: three to five variants is a suggested tuning range. More variants add retrieval work and can introduce spurious results. Tune query count and the RRF k constant against the application’s goals; assess coverage with Recall@k and, where facets matter, diversity-aware measures rather than Precision@k alone. section 8.6

Table 8.2 RAG-Fusion versus standard RAG
Query type
Top results (simulated)
Analysis
Standard RAG
1. doc_01: "Men's Warm Winter Jacket"
2. doc_02: "Women's Warm Winter Jacket"
3. doc_03: "The Warmest Jacket for Winter"
All results are semantic matches for "warm jacket." Fails to capture user intent.
RAG-Fusion
1. doc_05: "Men's Expedition Down Parka"
2. doc_09: "Women's Fleece-Lined Ski Jacket"
3. doc_01: "Men's Warm Winter Jacket"
Surfaces different categories (parkas, fleeces) that satisfy the user's intent, moving from relevance-matching to discovery.

The side-by-side simulated results show how fusion changes a narrow set of wording matches into a broader product selection. section 8.5

How Retrieval Augmented Generation, The Foundational Ideas covers it

How deep it goes
Works through query generation and a modular retrieval pipeline, then gives tuning and evaluation guidance without deriving RRF in the supplied excerpts.
Examples
Contrasts winter-jacket product results and uses college-laptop facets plus Python and LlamaIndex pipeline examples.
What it assumes
Assumes familiarity with basic RAG retrieval, embeddings, and LLMs while explaining why query variants must target distinct intents.
What you can do after
Build it from scratch as a multi-query retrieval pipeline, or apply it via LlamaIndex’s QueryFusionRetriever.
How it connects
Connects query expansion, parallel retrieval, Reciprocal Rank Fusion, vector search, and retrieval-augmented generation.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Retrieval Augmented Generation, The Foundational Ideas. The section links point to the parts of the book it draws on.