Query Reformulation
Overview
In a multi-turn conversation, users often ask follow-up questions that reference previous context:“How does the Builder pattern work?” “And for Bedrock?”The second question makes no sense to the vector store in isolation. Query reformulation solves this by rewriting the question into a self-contained query before retrieval:
“How does the Builder pattern work with AWS Bedrock in RAGLight?”This dramatically improves retrieval accuracy in conversational RAG.
How it works
Whenreformulation=True, the pipeline adds a reformulate step before retrieval:
INFO level so you can inspect what the model produced.
Configuration
Reformulation is enabled by default. You can disable it explicitly if needed.Via RAGConfig (simple API)
Via the Builder API
When reformulation helps
When to disable it
Summary
- Reformulation rewrites follow-up questions into standalone queries
- Enabled by default in
RAGConfigandBuilder.build_rag() - Uses the same LLM as generation — no extra model needed
- No-op on the first turn (no history)
- Disable via
reformulation=False