Skip to main content

Command Palette

Search for a command to run...

Advanced Rags

Published
3 min readView as Markdown
Advanced Rags

Advanced RAGs (Retrieval-Augmented Generation)

I explored advanced types of RAG frameworks beyond the basic architecture. These are designed to make retrieval more intelligent, context-aware, and adaptive.

1. Self RAG (sRAG)

  • Concept:

    The model critiques its own retrieval results before generating an answer.

  • Mechanism:

    • Retrieves documents.

    • Performs self-evaluation to judge if retrieved documents are relevant.

    • May re-query or refine retrieval before final answer.

  • Benefit:

    Higher quality responses by avoiding irrelevant or low-quality context.

  • Diagram Idea:

      Query → Retriever → Self-Check → (Refine?) → Generator → Answer
    

2. Agentic RAG

  • Concept:

    Instead of a fixed retriever, the model acts like an agent that can dynamically decide what, when, and how to retrieve.

  • Mechanism:

    • Uses a reasoning loop.

    • May call multiple retrieval tools.

    • Plans retrieval steps based on the task (multi-hop retrieval, iterative refinement).

  • Benefit:

    More flexible and task-specific.

  • Diagram Idea:

      Query → Planner/Agent → Multiple Retrieval Actions → Aggregation → Generator
    

3. Corrective RAG (cRAG)

  • Concept:

    A corrective feedback mechanism built into RAG to refine wrong or incomplete answers.

  • Mechanism:

    • Generator produces an answer.

    • A separate module (or the model itself) evaluates correctness.

    • If errors detected, retrieves more information and regenerates.

  • Benefit:

    Reduces hallucinations, improves factual grounding.

  • Diagram Idea:

      Query → Retriever → Generator → Corrector (Feedback Loop) → Final Answer
    

✅ These models push RAGs towards self-improving, agent-like systems where retrieval isn’t static but adaptive, iterative, and self-aware.

Comparison of Advanced RAGs

TypeKey IdeaWhen to UseStrengthsLimitations
Self RAG (sRAG)Model critiques its own retrieved docs before generating an answer.- When retrieval quality is inconsistent. - Tasks where wrong retrieval can severely hurt accuracy (e.g., legal, medical, financial Q&A).- Reduces irrelevant context. - Improves factual correctness.- Extra computation overhead due to self-check.
Agentic RAGModel acts as an agent, dynamically deciding retrieval strategy.- Complex reasoning tasks. - Multi-hop queries (e.g., “Compare Tesla’s revenue growth with Toyota in the last 5 years”). - Open-ended research.- Flexible and adaptive. - Can use multiple tools/databases.- More complex to implement. - Slower due to reasoning loops.
Corrective RAG (cRAG)Adds a correction/feedback loop after initial answer.- High-stakes tasks where accuracy matters most (e.g., enterprise knowledge bases, compliance). - When hallucinations are unacceptable.- Strong guardrails against hallucinations. - Learns from errors in real-time.- Higher latency (needs correction step). - May still fail if correction mechanism is weak.

Rule of Thumb:

  • Use sRAG when your retriever is shaky.

  • Use Agentic RAG when queries require reasoning + multi-step retrieval.

  • Use cRAG when correctness is more important than speed.