Day 2: RAG Architectures

Module Overview

Session: RAG Architectures

Session: RAG Architectures

What You’ll Learn Today

By the end of this session, you will:

  • Identify 8 key RAG architectures and their use cases
  • Understand when to add memory, branching, or agents to RAG
  • Recognize how to optimize retrieval for complex queries

1. Simple RAG

Simple RAG workflow

Simple RAG workflow
  • Workflow: Query → Retrieve → Generate
  • Use Case: FAQ systems, limited knowledge bases
  • Pros: Simple, fast, deterministic retrieval

2. Simple RAG with Memory

Simple RAG with Memory workflow

Simple RAG with Memory workflow
  • Addition: Conversation history
  • Workflow: Query + History → Retrieve → Generate
  • Use Case: Customer service chatbots, personalized recommendations

3. Branched RAG

Branched RAG workflow

Branched RAG workflow
  • Concept: Route query to specific sources
  • Workflow: Query → Classifier → Specific DB → Generate
  • Use Case: Legal tools, multidisciplinary research

4. HyDe (Hypothetical Document Embedding)

HyDe workflow

HyDe workflow
  • Concept: Generate answer first, then retrieve
  • Workflow: Query → Hypothetical Answer → Embed & Retrieve → Generate
  • Use Case: Vague queries, creative content, R&D

5. Adaptive RAG

Adaptive RAG workflow

Adaptive RAG workflow
  • Concept: Adjust strategy based on complexity
  • Workflow: Query → Complexity Analysis → Strategy A/B/C → Generate
  • Use Case: Enterprise search, varying query difficulty

6. Corrective RAG (CRAG)

Corrective RAG workflow

Corrective RAG workflow
  • Concept: Evaluate retrieval quality
  • Workflow: Query → Retrieve → Grade Documents → (Web Search if poor) → Generate
  • Use Case: High-accuracy domains (Medical, Legal)

7. Self-RAG

Self-RAG workflow

Self-RAG workflow
  • Concept: Model self-queries during generation
  • Workflow: Generate → Critique → Retrieve More → Generate
  • Use Case: Long-form content, exploratory research

8. Agentic RAG

Agentic RAG workflow

Agentic RAG workflow
  • Concept: Agents orchestrate retrieval
  • Workflow: Meta-Agent → Document Agents → Synthesis
  • Use Case: Complex research, multi-source aggregation

Summary

Key Takeaways

  • Start Simple: Standard RAG works for many use cases
  • Add Complexity only when needed: Memory, routing, or correction
  • Agentic patterns allow for reasoning and multi-step tasks
  • HyDe helps when queries are vague