Query Understanding
The question is the weak link: rewrite it, expand it, split it, resolve "it" in a conversation, route it, and read filters out of it before retrieval runs.
Everything so far improved the index. This phase improves the other input: the question. Real questions are short, vague, misspelt, and full of "it" and "that". The best index in the world cannot find what the question never pointed at. You will fix questions before retrieval, with plain rules first and a model only where rules cannot do the job.
You will build the standard query tools by hand: cleaning and rewriting, expansion with synonyms and with a guessed answer (hypothetical document embeddings), several phrasings fused with reciprocal rank fusion, turning a follow-up into a standalone question, routing a question to the right place or to no retrieval at all, and reading metadata filters out of the question as validated structured output. Every tool costs an extra step, so each topic also shows how to measure whether the step earned its place.
The phase ends by adding a query layer to AskDocs, with each step switchable and scored, and a playbook with a checklist for deciding whether an extra model call is worth it.
Practise this phase
Hands-on exercises: write the code, run it, and press Check to have it tested automatically.