← Back to Glossary
Query Expansion & Rewriting
Phase 03 · RAGtechnique

Using an LLM to rephrase or expand a user query into multiple variations before retrieval to improve document recall.

Why it exists

User queries are often brief or poorly phrased. Expanding them generates richer keywords and semantic angles.

How it works

An LLM takes 'fix error 404' and generates: 1) 'HTTP 404 missing route', 2) 'webpage not found troubleshooting'. Queries run in parallel.

Where you'll use this