The Alternatives Issue For tool owners Sign in

Prompt rewriter

A prompt rewriter is a layer — often a small LLM — that takes the user's raw query and rewrites it into a form that downstream retrieval or generation handles better.

In more detail

What it means

User queries are messy: typos, missing context, ambiguous wording, implicit references to earlier turns. A prompt rewriter normalises them: resolve coreferences from chat history, expand abbreviations, fill in implicit context, decompose multi-part questions. Used heavily in production RAG and search systems in 2026 because retrieval quality is highly sensitive to query phrasing. Implementations: a small LLM with a tight system prompt, a fine-tuned classifier, or a semantic rewriter (HyDE-style hypothetical document generation).

Part 1 of 2

When to use it, and when not

Use it for

  • RAG over user queries that miss context.
  • Multi-turn chat where queries reference earlier turns.
  • Voice agents where ASR adds noise.

Part 2 of 2

Common mistakes

  • Rewriter that's stronger than the answer model — adds cost without proportional quality.
  • No eval on the rewriter — drift goes unnoticed.

FAQ

Questions readers ask.

What is prompt rewriter?

A prompt rewriter is a layer — often a small LLM — that takes the user's raw query and rewrites it into a form that downstream retrieval or generation handles better.

When should you use prompt rewriter?

RAG over user queries that miss context. Multi-turn chat where queries reference earlier turns. Voice agents where ASR adds noise.

What are the common mistakes with prompt rewriter?

Rewriter that's stronger than the answer model — adds cost without proportional quality. No eval on the rewriter — drift goes unnoticed.

Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/prompt-rewriter.md. Found a mistake? Tell us.