Skip to main content

Self-RAG & Corrective RAG (CRAG)

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