Retrieval quality · about 20 minutes of study

Query rewriting

Query rewriting transforms a question into a search-friendly form while preserving the user intent and known facts. It must not invent details.

Before you start: Review Reranking first. Python-like examples use variables, lists and functions.

Guided concept walkthrough

Follow the mechanism

Original intent

Identify the actual user question.

1 / 4

A conceptual animation, not a live model trace. Play advances every five seconds and stops at the final stage.

Start with an everyday explanation

A librarian may turn “Why was it rejected?” into a clearer search after you identify the claim. Guessing the missing claim number would change the question.

See a concrete example

“What about its grace period?” can become “Grace period for policy POL-42” only if POL-42 is established in the current authorized context.

A claim to question

A rewrite must not assume the rejection reason before retrieving evidence.

Try before revealing the answer

Rewrite an ambiguous follow-up about a claim when two policies were discussed.

Show the worked answer

Ask which policy the user means, or retrieve separately with clear labels if the product permits. Do not silently choose one or insert an unverified lapse date.

Now explain the idea to someone else using your own example. If you cannot explain a stage, revisit it before moving on.

Your explanation and revision notes

Loading local notes…

Read the primary reference

Retrieval-Augmented Generation

The explanation and exercises are original teaching material. The linked source provides background; examples and assumed numbers here are not claims about a particular company.