# Query rewriting

Canonical page: https://www.theglitch.ai/ai-glossary/query-rewriting

Rephrasing a search request before retrieval so the search system can find the intended material. In a conversation, this can mean turning a follow-up into a question that makes sense on its own.

[Query rewriting, common card \#256 in The Glitch AI glossary: Rephrasing a search request before retrieval so the search system can find the intended material. In a conversation, this can mean turning a follow-up into a question that makes sense on its own.](https://www.theglitch.ai/images/cards/glossary/query-rewriting.png?v=7cfa3ee06a51f720)

GLS 256 · common

Also called: Query reformulation.

For: Builders · Marketers

## Why it matters

Someone searching a product manual can say “Does it work offline?” The document index may need the product name and feature from the previous turn to retrieve the right section.

## In practice

Try writing the search you would send to the index. Start with “How do I export a route from Map A?” Then ask “And offline?” A useful rewrite is “Can Map A export a route while offline?” Searching for “offline maps” drops the export task and could surface instructions for downloading a map instead.

## Watch for

A rewrite should preserve uncertainty. If two products were under discussion and “it” could mean either one, ask which product before looking up an answer.

## Related terms

[Conversational search](https://www.theglitch.ai/ai-glossary/conversational-search) · [Query fan-out](https://www.theglitch.ai/ai-glossary/query-fan-out) · [Semantic search](https://www.theglitch.ai/ai-glossary/semantic-search)

## Try it here

[See how an AI visibility audit works](https://www.theglitch.ai/learn/ai-visibility-audit)

## Sources

- [Elgohary et al. · Rewriting questions in context](https://aclanthology.org/D19-1605/)

- [Google Cloud · Processing a search with follow-ups](https://docs.cloud.google.com/generative-ai-app-builder/docs/answer)

Use in an AI agent: connect MCP at https://www.theglitch.ai/mcp and call get\_glossary\_term with query-rewriting, or read the [Markdown edition](https://www.theglitch.ai/ai-glossary/query-rewriting.md).

Definition updated 2026-11-27.

[The Ultimate AI Glossary (2027): every term](https://www.theglitch.ai/ai-glossary)

---

Site: [The Glitch](https://www.theglitch.ai) · [About Rabin](https://www.theglitch.ai/about) · [Agent guide](https://www.theglitch.ai/agent.md)
