Corrective RAG (CRAG)
The Corrective RAG (Retrieval-Augmented Generation) process is an advanced information retrieval and response generation system. It extends the standard RAG approach by dynamically evaluating and correcting the retrieval process, combining the power of vector databases, web search, and language models to provide accurate and context-aware responses to user queries.
While traditional RAG systems have improved information retrieval and response generation, they can still fall short when the retrieved information is irrelevant or outdated. The Corrective RAG process addresses these limitations by: 1. Leveraging pre-existing knowledge bases 2. Evaluating the relevance of retrieved information 3. Dynamically searching the web when necessary 4. Refining and combining knowledge from multiple sources 5. Generating human-like responses based on the most appropriate knowledge
What you'll learn
- 1FAISS Index: A vector database for efficient similarity search of pre-existing knowledge.
- 2Retrieval Evaluator: Assesses the relevance of retrieved documents to the query.
- 3Knowledge Refinement: Extracts key information from documents when necessary.
- 4Web Search Query Rewriter: Optimizes queries for web searches when local knowledge is insufficient.
- 5Response Generator: Creates human-like responses based on the accumulated knowledge.
About this tutorial
This hands-on Jupyter notebook is part of RAG Techniques, a free open-source repository by Nir Diamant covering rag techniques with runnable code examples and detailed explanations.
RAG Made Simple
The book that extends this repo: 22 RAG techniques with the intuition behind each, side-by-side comparisons of when each wins (and quietly fails), and original illustrations.
Get it on Amazon⭐ 4.4 stars · 1,500+ readers · Kindle $9.99 · Paperback $24.99 · Free with Kindle Unlimited
