What is query rewriting and why is it used in RAG?
RAG & Vector DB Interview: Advanced RAG, HyDE, Multi-Query, Self-Query, GraphRAG
Audio flashcard · 0:28Nortren·
What is query rewriting and why is it used in RAG?
0:28
Query rewriting uses a language model to reformulate the user's query before retrieval, improving recall on queries that are too short, ambiguous, or stylistically different from documents. Techniques include expansion to add synonyms, decomposition to split complex queries, and clarification using conversation history in chat applications. Query rewriting is particularly valuable in conversational RAG where pronouns and references to previous turns must be resolved before retrieval can find relevant context. It adds one language model call per query.
python.langchain.com