Learning path · Retrieval & Ranking · 47
Query Transformation
Rewriting user queries—expansion, decomposition, or step-back—for better retrieval against the index.
Why it matters
- Raw user messages are often vague or conversational.
- Multi-hop questions need sub-queries.
- Transforms add latency and must be eval-covered.
Key ideas
- Query expansion
- Sub-query decomposition
- Hypothetical documents
Top resources
- 01DocsLlamaIndex
Query transformations
Why this resource. Rewrite, expand, and route queries before retrieval.
Covers in this concept
- multi-query
- HyDE
- routing
- 02PaperGao et al.
Precise Zero-Shot Dense Retrieval without Relevance Labels (HyDE)
Why this resource. One important transform: search with a hypothetical document.
Covers in this concept
- hypothetical document
Query transformation uses an LLM to turn a complaint about a bill into sub-queries against billing docs, or to expand acronyms from a glossary. Template it, and refuse when the transform invents constraints. Cache repeats. Measure Recall@K with and without the extra call so you know it earns its keep.
Updated 2026-08-09 · Full learning path