Multi-query retrieval
Query decomposition · RAG-Fusion
Runs several versions or parts of one question as separate searches and merges the result lists, usually with reciprocal rank fusion.
In DocSlurpGlossary entry
On this page
Multi-query retrieval turns one question into several searches and merges their results, usually with reciprocal rank fusion. There are two common flavors:
- Decomposition. “Compare the margin targets in the growth plan and the Q3 earnings memo” becomes two searches, one per document. A single embedding of the whole question points somewhere between the two topics, and whichever topic has more matching passages tends to fill the top results.
- Paraphrase fan-out. A model writes three to five rewordings of the question (“RAG-Fusion”). Each finds a slightly different set of passages; a passage that several versions retrieve rises to the top after fusion.
The cost is linear: four queries mean four retrievals, plus a model call for paraphrases. Latency stays close to one search if they run in parallel.
The gotcha: fusion rewards agreement, not coverage
Rank fusion boosts passages that several queries found. That is the right bet for paraphrases, but for decomposition it can bury the passage that only one sub-question needs. If the Q3 earnings memo is relevant to only one part, it appears in one list and may lose to generic passages that match both. For comparison questions, consider taking the top few from each sub-query rather than one fused ranking.
DocSlurp’s queryDecompose uses decomposition by pattern rather than a model: it splits on words such as “and”, “vs” or “compare” when each part is at least three words long, then fuses the results with RRF.
In DocSlurp
In DocSlurp
queryDecompose splits a query on “and”, “vs”, “compare”, “difference between” or “also” when every part has at least three words, searches each part and fuses with RRF (core/server/src/search/query-rewrite.ts, core/server/src/search/session-planner.ts). It does not ask a model for paraphrases; the chat search agent can send several queries itself.