Loading video player...
Traditional RAG systems often suffer from "blind trust," where they generate answers based on irrelevant retrieved documents, leading to hallucinations. In this video, we explore Corrective RAG (CRAG), a robust architecture that evaluates the quality of retrieval before generating a response. We walk through the first principles of CRAG, moving from a traditional RAG setup to a complete system featuring Retrieval Evaluation, Knowledge Refinement, and Web Search integration using tools like Tavily. Whether the retrieval is correct, ambiguous, or incorrect, you'll learn how to ensure your LLM always has the best context to provide accurate answers. Resources: Github: https://github.com/campusx-official/corrective-rag Paper: https://arxiv.org/pdf/2401.15884 CampusX Blog [Bookmark It]: https://campusxainewsletter.my.canva.site/campusx-weekly-ai-insights CampusX Courses: https://learnwith.campusx.in/s/store π± Grow with us: CampusX' LinkedIn: https://www.linkedin.com/company/campusx-official CampusX on Instagram for daily tips: https://www.instagram.com/campusx.official My LinkedIn: https://www.linkedin.com/in/nitish-singh-03412789 Discord: https://discord.gg/PsWu8R87Z8 E-mail us at support@campusx.in βChaptersβ 00:00 β What is Corrective RAG (CRAG)? 01:12 β The problem with Traditional RAG: "Blind Trust" & Hallucinations 02:00 β Visualising the Vector Database & Retrieval Workflow 04:22 β Practical Example: When LLMs fail on "Out of Distribution" queries 07:04 β Code Walkthrough: Loading ML books and creating a basic Retriever 10:17 β Testing the Baseline: Bias-Variance Tradeoff vs. Recent AI News 13:51 β Identifying Hallucinations in the Transformer architecture query 15:53 β Deep Dive: The CRAG Research Paper & Proposed Architecture 17:20 β The 3 Retrieval Cases: Correct, Incorrect, and Ambiguous 21:01 β Retrieval Evaluator: Refining Internal vs. External Knowledge 23:02 β Iteration 1: Knowledge Refinement (Decomposition & Filtration) 30:11 β Code: Building the Refined Value Node with Sentence Strips 35:40 β Iteration 2: Retrieval Evaluation (Thresholding Logic) 45:36 β Code: Implementing the Evaluation Node & Pydantic Schema 51:40 β Testing the Evaluator: Correct vs. Incorrect Verdicts 53:42 β Iteration 3: Web Search Integration using Tavily 01:00:43 β Iteration 4: Query Rewriting for Better Search Results 01:07:18 β Handling Ambiguous Knowledge: Merging Internal & External Context 01:14:19 β Conclusion: Comparing our implementation to the Original Paper