Skip to content
ReviewRamble

The weekly brief

AI, reviewed, in your inbox.

  • New reviews of tools, models, MCP servers and repos, with the verdict up front
  • Re-checked prices and ratings when something changes
  • New analysis pieces as they are published

Models, agents, MCP servers and the tools actually worth your time.

One email a week. Unsubscribe with the link in any brief. How we use your email

Query rewriting

Query rewriting changes a user's question before search, for example by clarifying it, splitting it or adding related terms, so the retriever is more likely to find the passages that answer it.

Also called: query expansion, HyDE, query transformation

By Divya Sharma · Checked Nov 15, 2026 · How we review

People type short, vague or chatty questions. "What about the other one?" means nothing to a search index without the conversation before it. In retrieval-augmented generation, a rewriting step, usually an LLM call, turns the raw input into one or more better search queries.

Common techniques

Rewriting: restate the question as a standalone query, resolving pronouns from chat history. Query expansion: add synonyms or related terms, which helps keyword search like BM25. Decomposition: split a multi-part question into sub-queries and search for each. Multi-query: generate several phrasings and merge the results, as in hybrid search.

HyDE

Hypothetical Document Embeddings (HyDE) asks an LLM to write a fake answer to the question, then embeds that answer and searches with it. The fake answer may contain wrong details, but it looks like the documents you want, so its embedding often lands closer to them than the short question would.

Research basis

The Rewrite-Retrieve-Read paper framed the problem as a gap between what users type and what retrieval needs, and trained a small rewriter model for it.

Limits

Each rewrite adds an LLM call, so latency and cost go up. A rewrite can drift from what the user meant. Log both the original and rewritten queries, and check that rewriting actually improves retrieval metrics on your data. Doing this inside a loop is one form of agentic RAG.

Related terms

Retrieval-augmented generation
Retrieval-augmented generation (RAG) is a pattern where a system first searches a collection of documents for passages relevant to a question, then gives those passages to a language model so its answer draws on them.
Hybrid search
Hybrid search runs a keyword search and a vector search on the same query and merges the two ranked lists, so results can match on exact words as well as on meaning.
Agentic RAG
Agentic RAG is retrieval-augmented generation run by an AI agent that decides when to search, what to search for and which source to use, and can search again if the first results fall short.
Embedding
An embedding is a list of numbers (a vector) that represents a piece of text, an image or other data, produced so that items with similar meaning end up with vectors close together.
Retrieval metrics (recall@k, nDCG, MRR)
Retrieval metrics score how well a search system returns relevant documents. Recall@k checks how many relevant items appear in the top k, nDCG rewards ranking them high, and MRR measures how early the first correct one appears.

Sources