25One call
Query rewriting
Have a model rewrite the user’s query, with the conversation so far, before searching with it.
Also called Rewrite-Retrieve-Read
Ma et al., ElevenLabs, Elastic, Microsoft
The problem
The user’s words, often leaning on earlier turns, are not the query the retriever needs.
there is inevitably a gap between the input text and the knowledge that is really needed to query.
Most user requests reference prior turns, so the system needs to collapse dialogue history into a precise, self-contained query.
Therefore
In front of the retriever, a step of rewriting the input is added, filling the gap between the given input and retrieval need
Query rewriting … is the process of transforming a user's query into a more effective one, adding more terms and refining search results.
In use
ElevenLabs
In our system, we add a query rewriting step first, collapsing dialogue history into a precise, self-contained query before retrieval.
Azure AI Search
The Foundry IQ service sends the search query (or a variation of it) to a generative model that generates alternative queries.
Where it breaks
A rewrite can drop the exact terms a search needed, and leaning on it too much can lower relevance.
The rewritten queries might not contain all of the exact terms the original query had. This might impact search results if the query was highly specific and required exact matches for unique identifiers or product codes.
We observed that overreliance on LLM output reduced relevance.
Sources
- Query Rewriting for Retrieval-Augmented Large Language ModelsXinbei Ma, Yeyun Gong, Pengcheng He, Hai Zhao, Nan Duan, Ma et al.
We present Rewrite-Retrieve-Read, a pipeline that improves the retrieval-augmented LLM from the perspective of query rewriting.
- How we engineered RAG to be 50% fasterElevenLabs, Sep 12, 2025
- Query rewriting strategies for LLMs and search engines to improve resultsChristina Nasika, Emilia Garcia Casademont, Elastic, Jan 30, 2026
- Rewrite queries with semantic ranker in Azure AI Search (preview)Microsoft
Added Nov 14, 2026