Adaptive RAG
Adaptive RAG: analyse each query, choose the retrieval strategy and parameters, build an optimal context and generate, with the 7-step pipeline, query analysis decisions, six retrieval strategies, a decision table, context building, learning, metrics, variants and best practices.
Cheat sheet
In this diagram
- Adaptive RAG
- Adaptive Retrieval-Augmented Generation
- What is Adaptive RAG?
- Dynamically adapts retrieval strategy based on the query type and context need.
- Selects the best retrieval path, params and tools at runtime.
- Optimizes for accuracy, latency and cost.
- Continuously learns from feedback and improves over time.
- Core Components
- User Query
- Query Analyzer (Understand Intent, Complexity & Need)
- Adaptive Retriever (Choose Strategy, Params & Sources)
- Context Builder (Assemble Optimal Context)
- LLM Generator
- Response
- Query Analyzer : Analyzes query to determine intent, complexity and info need.
- Adaptive Retriever : Chooses the best retrieval strategy, sources and parameters.
- Context Builder : Builds the most relevant and compact context.
- LLM Generator : Generates the final answer using the adaptive context.
- Adaptive RAG Pipeline
- Raw Documents
- • Cleaning • Chunking • Metadata • Extraction • Embedding
- Preprocessing
- Vector DB(s) + Metadata Store
- Indexing
- Understand Query • Intent • Type • Complexity • Domain
- Query Analysis
- Select Strategy • Dense / Sparse • Hybrid • Multi-hop • Graph / KB • Web / API
- Adaptive Retrieval
- Rank & Filter Deduplicate Compress Reorder
- Context Assembly
- LLM (Generate Answer)
- Generation
- Query Analysis (Decisions)
- Query Analyzer
- Decide
- Query Type (Factual / Analytical / Exploratory)