chapter eight

8 RAG-Fusion: Multi-query retrieval enhancement

 

This chapter covers

  • The limits of single-query retrieval
  • Generating diverse query variants using LLMs
  • Applying Reciprocal Rank Fusion (RRF) for result merging
  • Building a practical multi-query RAG pipeline
  • Tuning for diversity, relevance, and cost

In the previous chapters, you've seen RAG evolve from its roots in classic information retrieval. We've traced a path from keyword-based search to neural retrieval with bi-encoders like Sentence-BERT, then to end-to-end trainable architectures like REALM and the original RAG model, and methods like HyDE, which use an LLM to generate a single hypothetical document to improve retrieval.

We’ll continue that progression, focusing on the problem underneath it: retrieval coverage. Even with a perfect embedding model, a single query is an incomplete snapshot of a user's intent, and that holds whether the query is a vector or a bag of keywords. One phrasing misses the documents the other would have found. The result is a system that often answers correctly but incompletely, which in the chapter 1 taxonomy is three failure points sharing one cause. A single phrasing misses documents that answer the question in other words (FP1, Missing Content), ranks the ones it does find by their fit to that phrasing rather than to the intent (FP2, Missed the Top Rank), and returns a context covering one facet of a multi-part question (FP7, Incomp

lete). Fusing several queries attacks all three at once.

8.1 The coverage problem

8.2 LLM-driven query generation

8.2.1 Generating queries with LangChain

8.3 The Reciprocal Rank Fusion algorithm

8.4 Implementing multi-query RAG systems

8.5 Case study: Enhancing e-commerce product search

8.6 Balancing diversity and precision

8.7 Summary