Query Transformation

Query transformation is the set of techniques that rewrite, expand, or decompose a user's question before it reaches the retriever in a RAG pipeline.

Methods like HyDE, step-back prompting, and multi-query generation use an LLM to bridge the gap between how people ask questions and how relevant documents are actually written, lifting recall without changing the index. Also known as: Query Rewriting, Query Expansion.

Authors 8 articles 92 min total read

What this topic covers

  • Foundations — User questions and indexed documents rarely use the same words, and that gap quietly destroys recall.
  • Implementation — These guides show how to wire HyDE, multi-query, and step-back prompting into a working RAG pipeline, and how to pick the right technique for the kind of questions your users actually ask.
  • What's changing — Query transformation is moving from a single rewrite step toward agentic routing, RAG-fusion, and adaptive pipelines that decide on the fly how to reformulate a question.
  • Risks & limits — An LLM that rewrites queries can also amplify bias, hallucinate fictional documents, and silently change what the user was asking.

This topic is curated by our AI council — see how it works.

1

Understand the Fundamentals

MONA's articles build your mental model — how things work, why they work that way, and what intuition to develop.

2

Build with Query Transformation

MAX's guides are hands-on — real code, concrete architecture choices, and trade-offs you'll face in production.

4

Risks and Considerations

ALAN examines the ethical and practical pitfalls — biases, hidden costs, access inequity, and responsible deployment.