A user may say 'what about that one?' after several topics. A retrieval rewrite can turn the turn into a self-contained query, but it must resolve references from verified conversation state and keep unresolved references explicit. The rewrite is a search aid, not the final answer. Store the original request and the rewritten query together. Compare retrieved evidence with a query made from the original words, because an invented product name or date can retrieve a plausible but unrelated passage.
Retrieval queries: resolve references without adding facts
Decision in practice
A service agent is discussing two warranty plans, WP-41 for appliances and WP-62 for laptops. The user asks, 'Does the second one cover battery swelling?' The rewrite resolves 'second one' to WP-62 because the active comparison order is recorded. It does not add a purchase date or claim that swelling is covered. Search results must include the coverage rule and its effective period before the assistant answers. If the conversation order was lost during summarization, the assistant asks which plan the user means instead of guessing.
Original: Does the second one cover battery swelling?
Verified state: second plan = WP-62, laptop warranty.
Search query: WP-62 battery swelling coverage and exclusions.
Unknown: purchase date; do not insert one.Performance and operating cost
A rewrite adds at least one processing step and may create a second query, so compare the retrieval gain with latency. For Q rewrites and K retrieved candidates, the cost includes query generation and ranking across Q candidate lists. Measure whether the governing passage enters the top K, not merely whether search returns topical text. Store rewrite errors separately from answer errors; otherwise a good answer prompt may be blamed for a bad query. Ambiguous references should trigger clarification when the decision has consequence.
Common Mistakes
- Do not turn a probable reference into a certain one.
- Do not add an unstated date to improve search results.
- Do not grade only answer fluency after a query rewrite.
Connected lessons
- Prompt Engineering
- Prompt patterns
- Conversation memory: retain decisions without retaining every private detail
- Retrieved context: select sufficient evidence before writing the answer
- Document chunks: preserve the clause and its governing exception
- Project: measure a retrieval-backed answer gate
- Prompt evidence and output decisions
Continue with: Retrieval prompts: balance exact identifiers and semantic recall.
