Definition

Query rewriting reformulates a request before retrieval. It may resolve a conversational reference using established context, normalize terminology, or adapt the query to the retrieval system.

It changes the retrieval request, not the source documents.

Simple example

After several chat turns about Qdrant vector search, a user asks, “Does it support filters too?” The application rewrites that as “Does Qdrant vector search support payload filters?” before searching the documentation. The subject comes from the conversation, not a guess by the rewriter.

Why it matters

A user’s words may differ from the terminology in indexed content, and a follow-up question may leave out its subject. Rewriting can make that question self-contained. That can help retrieval return relevant passages. If the application uses a reranker, it scores those returned candidates afterward.

One important nuance

A rewrite can silently change the user’s intent. Adding a product name, date, or constraint that the conversation never established may retrieve highly ranked but irrelevant passages. Keep the original request, inspect or log the rewritten query, and evaluate it using retrieval outcomes. If the missing detail could change the answer, ask the user instead of filling it in.