Skip to main content

Self-RAG & Corrective RAG (CRAG)

FOR AI AGENTChatGPTClaude

An adaptive search methodology where the language model autonomously assesses the relevance of retrieved documents, filters out noise, and dynamically reformulates the search query when information is lacking.

1. Concept Overview & Systemic Problem

The traditional RAG pipeline operates like a blind automaton: Query ➔ Search ➔ Generation. However, in real systems, vector search frequently makes mistakes:

  • A user asks about a technology that is not present in the company's internal knowledge base.
  • The database returns the 5 most similar terms, but they describe entirely different concepts.
  • The model receives this irrelevant context, attempts to connect incompatible elements, and produces a confident hallucination that could cost the company its reputation.

Self-Reflective RAG (Self-RAG & CRAG) introduces critical thinking into the search process: the model does not merely consume documents but acts as a stringent censor, evaluating the quality of extracted knowledge before generating each sentence.

2. Architectural Taxonomy & Mental Model

                       [ INPUT QUERY ]
                               │
                               ▼
                       [ Vector Search ]
                               │
                               ▼
            ┌──────────────────────────────────────┐
            │       EVALUATOR MODEL (CRAG)         │
            │ Assessment of Retrieved Documents [0..1] │
            └───┬──────────────────────────────┬───┘
                │                              │
                ▼ (> 0.7: Correct)             ▼ (< 0.4: Incorrect)
     ┌───────────────────────┐      ┌─────────────────────────┐
     │ KNOWLEDGE REFINEMENT  │      │ RE-WRITE QUERY & FALLBACK│
     │ Extracting Key Sentences│      │ • Discard Internal Noise │
     │ Filtering Out Noise    │      │ • Initiate Web Search    │
     └──────────┬────────────┘      └────────────┬────────────┘
                │                   └────────────┬────────────┘
                └───────────────┬────────────────┘
                                ▼
                   ┌────────────────────────┐
                   │ FACT-CHECKED GENERATION│
                   │ Each Statement         │
                   │ Verified by Source     │
                   └────────────────────────┘

3. Technical Pipeline & Internal Mechanics

01. Protection Against Outdated Documentation

A user inquires about configuring the latest React 19 feature. The internal database contains documents only for React 17. Self-RAG assesses the retrieved documents as irrelevant (confidence: 0.12), does not use them, and honestly responds: "There is no information about React 19 in the internal database; initiating a search in the official documentation."

02. Contextual Search Triggered Only When Necessary (Dynamic Retrieval)

If a user asks "What is a for loop in JavaScript?", Self-RAG recognizes this as basic model knowledge ([No-Retrieve]) and responds instantly without incurring time or queries to the vector database.

4. Production Engineering Scenarios

  • Latency Penalty: The document evaluation stage and potential re-search can add 1–2 seconds to response time. Use ultra-fast models for assessment (e.g., 1B–3B classifiers).
  • False Negatives: An overly strict cutoff threshold may lead the system to reject a useful document merely due to unusual phrasing.

5. Pitfalls, Common Mistakes & Security

Self-RAG has transformed search systems from naive pipelines into intelligent research agents. The system's ability to state: "The retrieved data does not answer your question; I will search further" is a fundamental prerequisite for zero tolerance towards hallucinations.

/ Frequently Asked QuestionsSchema.org FAQPage

FAQ: Self-RAG & Corrective RAG (CRAG)

Passive RAG blindly trusts the vector database: if a query is sent, the first 5 retrieved results are always fed into the prompt. Even if these results are unrelated to the essence of the question, the model feels pressured to 'use the provided context' and begins to fabricate non-existent facts.
/ Internal links
All terms

Related Ecosystem Resources

Explore practical workflows, core terminology, and engineering tools

Glossary Concept

Self-Reflective Search (Self-RAG & Corrective RAG)

The architectural approach of Self-RAG and Corrective RAG (CRAG) enables a language model to critically assess the relevance and completeness of retrieved documents before generating a response, avoiding blind reliance on initial search results. If the findings are insufficient or dubious, the system automatically reformulates the query and searches again or accesses the open web.

Glossary Concept

GraphRAG & Knowledge Graph Retrieval

The next generation of augmented generation search systems (GraphRAG) combines semantic vector search with knowledge graphs to synthesize global insights over large knowledge bases.

Practical Guide

The Autonomous Loop: A Practical Roadmap for Self-Sustaining Agentic Cycles

A step-by-step engineering roadmap for building resilient autonomous loops: deterministic oracles, stateless architectures, Docker isolation, the STATUS.md protocol, reward hacking mitigation, and JSONL telemetry.

Practical Guide

Self-Updating AI News Website in Claude Code: Complete Architecture Guide

Step-by-step engineering guide to creating an automated, self-updating newspaper-style AI news website with Claude Code: design prompts, trust boundaries, deduplication, and scheduled routines.

News

OpenAI Offers Free Resets to Subscribers

OpenAI is providing free resets to all subscribers daily until access to Astra is available.

News

OpenAI's Astra Model Now Available to All Subscribers

The Astra model from OpenAI is now accessible to all Plus, Pro, Enterprise, and Business subscribers.