🔀Use Query Expansion to Improve RAG Recall
Compare four query-expansion patterns — synonym, multi-query, step-back, and HyDE — on the same hard query so each one's strength is visible, then design a query-expansion stage for a customer-support RAG with 30% short queries.
Phase 1Why Short Queries Break RAG Before the Retriever Ever Runs
See why short user queries embed badly and what retrieval misses
RAG fails at the query, not the retriever — and you keep blaming the retriever
6 minRAG fails at the query, not the retriever — and you keep blaming the retriever
Watch 'how do I cancel?' embed straight into shipping policies
6 minWatch 'how do I cancel?' embed straight into shipping policies
Four ways to expand a query, ranked by how much help they actually offer
6 minFour ways to expand a query, ranked by how much help they actually offer
The query you'll torture all week — and why one is enough
5 minThe query you'll torture all week — and why one is enough
Phase 2Multi-Query Rewriting on a Hard Question, Side by Side
Run multi-query rewriting and merge results from each variant
Run plain retrieval on the hard query and capture the floor
5 minRun plain retrieval on the hard query and capture the floor
Ask an LLM for three paraphrases — the entire trick is the prompt
6 minAsk an LLM for three paraphrases — the entire trick is the prompt
Retrieve for each rewrite and fuse with RRF — that's the whole pipeline
7 minRetrieve for each rewrite and fuse with RRF — that's the whole pipeline
Compare baseline and multi-query on one query — and write down what you see
6 minCompare baseline and multi-query on one query — and write down what you see
Two prompt knobs explain ninety percent of multi-query quality
7 minTwo prompt knobs explain ninety percent of multi-query quality
Phase 3Step-Back, HyDE, and Picking the Right Expansion Per Query
Map step-back, HyDE, and where each beats plain retrieval
Step-back prompting trades specificity for grounding — and wins on niche questions
6 minStep-back prompting trades specificity for grounding — and wins on niche questions
HyDE fixes the question-voice vs answer-voice mismatch
7 minHyDE fixes the question-voice vs answer-voice mismatch
Four expansion techniques, one query — and the table that makes the choice obvious
7 minFour expansion techniques, one query — and the table that makes the choice obvious
Three signals tell you which expansion to run before retrieval
7 minThree signals tell you which expansion to run before retrieval
Phase 4Design a Query-Expansion Stage for a Real Support RAG
Design a query-expansion stage for a real support RAG
Design a query-expansion stage for a support RAG with 30% short queries
8 minDesign a query-expansion stage for a support RAG with 30% short queries
Frequently asked questions
- What is query expansion in RAG and why does it improve recall?
- This is covered in the “Use Query Expansion to Improve RAG Recall” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
- How does multi-query rewriting differ from synonym expansion?
- This is covered in the “Use Query Expansion to Improve RAG Recall” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
- What is HyDE and when does it beat plain vector retrieval?
- This is covered in the “Use Query Expansion to Improve RAG Recall” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
- When should I use step-back prompting instead of multi-query?
- This is covered in the “Use Query Expansion to Improve RAG Recall” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
- Does query expansion always help, or can it hurt precision?
- This is covered in the “Use Query Expansion to Improve RAG Recall” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
Related paths
🐍Python Decorators Introduction
Build one mental model for Python decorators that covers closures, argument passing, functools.wraps, and stacking — then ship a working caching or logging decorator from scratch in under 30 lines.
🦀Rust Lifetimes Explained
Stop reading `'a` as line noise and start reading it as scope arithmetic — one failing snippet at a time — until you can thread lifetimes through a small parser or iterator adapter without fighting the borrow checker.
☸️Kubernetes Core Concepts
Stop drowning in 30+ resource types. Build the mental model one primitive at a time -- pods, deployments, services, ingress, config -- then deploy a real app with rolling updates and health checks.
📈Big O Intuition
Stop treating Big O as math you memorized for an interview — build the intuition to spot O(n²) disasters, pick the right data structure without thinking, and rewrite a slow function from O(n²) to O(n) in under five minutes.