Corrective RAG Walkthrough: A Compliance Assistant That Grades Its Own Retrieval and Answers
Affectionate_Slip654 · reddit · 2026-09-28
An open-source tutorial project building a "Veltra Pay Compliance Assistant" with Corrective RAG (CRAG): unlike vanilla RAG that answers with whatever it retrieved, this pipeline self-checks before responding.
Core mechanics
- Grades retrieved documents as relevant/irrelevant
- Rewrites the search query when retrieval is weak and retries
- Validates generated answers for grounding, hallucination risk and completeness; retries on failure and honestly says "I don't know" when sources can't support an answer
Stack: Python, LangGraph (StateGraph, conditional edges, bounded retry loops), Qdrant, pdfplumber PDF chunking, LLM-based grading/rewriting/validation, SSE streaming backend, and a real-time web dashboard. GitHub repo and YouTube walkthrough included.
More from coding & agent
- AI-made games are great only if you personally iterate on every detail down to the millisecond — IanArawjo · 2026-09-28
- cnakazawa: people are figuring out the best way to run the React Compiler — cnakazawa · 2026-09-28
- Google's Gemini Can Now Call Businesses for You on Pixel 11, Identifying Itself as AI — rvp · 2026-09-28
- Anthropic's Model Hardware Standard could bring AI to legacy factory equipment like PLCs and robots — burhop · 2026-09-28
- IndicBankBench: 799-case benchmark shows banking AI assistants top out at 58.2% strict reliability — NPCI · 2026-09-28
- Grok 4.8 spotted in Cursor's server-side model list, one week after Grok 4.7 — gaganghotra_ · 2026-09-28