JT / SAGE IDEAS Work with me

Glossary · RAG & Retrieval

Query rewriting

Rephrasing a user’s messy question into one that retrieves better.

Query rewriting takes a user's raw question and rephrases it into something your retriever can actually find. The user types "why won't it charge," and you turn that into a clean query with the missing product name and context filled in. The catch: the rewrite happens before retrieval, so if it drops the wrong detail, every step after it works from the wrong question.

Why it matters

Real questions are messy. They are vague, full of pronouns, riddled with typos, or split across a chat where "that one" means something three messages ago. Vector search takes those words literally, so a bad phrasing pulls back junk and the model answers from junk. Query rewriting cleans the question up before it hits your index, which lifts context recall without touching the documents at all.

How it works

A small model rewrites the query first. Common moves: expand vague terms, resolve "it" and "that" from the chat history, fix spelling, or split one loaded question into several focused ones and retrieve for each. You measure it by checking whether retrieval improved. Run your golden set with and without the rewrite, then compare context recall and precision. If the rewritten query pulls the right chunks more often, it earns its place.

Receipts · the newsletter

Receipts: AI engineering, with the evidence attached.

One real finding with its proof, one runnable lab, and one thing I would do differently. Weekly, Tuesday morning, a five-minute read.

required

Free. One email a week. Confirm first, unsubscribe in one click. How it works

Not ready to talk yet?

Get the AI release-readiness checklist

Eighteen checks to pass before an LLM feature meets a customer. The checklist is free and open: no email wall. Leave one email and I also send the sample evaluation report that goes with it. One email is all I ask for.

required

Inside the checklist: 18 checks, 5 groups

  • Ground truthwithout this, every other check is opinion3 checks
  • Measurement"it seems better" is not a metric4 checks
  • Safety batterythe failure modes that end up in screenshots5 checks
  • The gatea red eval that blocks nothing is decoration3 checks
  • Blast-radius controlautonomy is earned with evidence, never assumed3 checks

Have a system that needs to work?

Tell me the problem. I will tell you honestly whether I am the right engineer for it.

Book a 15-minute call Run a free audit Not sure what you need? Answer 3 questions