Large Language Models (LLMs)
Transformers, attention, context windows, KV cache, training pipelines, and 10 curated deep-dive videos — everything to understand LLMs before building RAG or agents.
↗ Mental Model
An LLM is a next-token predictor built on stacked transformer blocks. At inference time it reads a prefix (your prompt + history), runs attention over all prior tokens, and samples one token at a time. “Understanding” an LLM means understanding tokenization → embeddings → attention → MLP → logits → sampling, plus how models are trained (pretrain → SFT → RLHF) and served (KV cache, context limits).
Concepts you must internalize
- Tokenization — BPE/WordPiece; why “hello” ≠ one token; subword tradeoffs
- Embeddings — discrete tokens → continuous vectors; positional encoding (learned, RoPE)
- Self-attention — Q, K, V matrices; scaled dot-product; causal (masked) attention in GPT
- Decoder-only vs encoder-decoder — GPT-style (generation) vs T5/BERT-style (understanding)
- Context window — max tokens the model can attend to; lost-in-the-middle; truncation strategies
- KV cache — why generation is slow without it; memory grows with sequence length
- Training stack — pretraining (next-token on internet) → SFT (instructions) → RLHF/DPO (preferences)
- Inference — prefill (parallel) vs decode (sequential); temperature, top-p, stop tokens
1 10 Videos for Deep Understanding Watch in order
Curated for depth, not hype. Start with Karpathy’s 1-hour intro, build visual intuition with 3Blue1Brown, then code transformers yourself, and finish with university lectures from the people who invented the architecture.
| # | Video | Link | Length | What you'll learn |
|---|---|---|---|---|
| 1 | Intro to Large Language Models Andrej Karpathy |
YouTube | ~1 hr | Big-picture map: pretraining, fine-tuning, inference, hallucinations, tool use — best single starting point. |
| 2 | Transformers, the tech behind LLMs 3Blue1Brown — Ch. 5 |
YouTube | ~27 min | Visual data flow: token embeddings, attention blocks, unembedding — no code required. |
| 3 | Attention in transformers, step-by-step 3Blue1Brown — Ch. 6 |
YouTube | ~28 min | Q/K/V intuition, attention patterns, multi-head attention — the math made visual. |
| 4 | Let's build GPT: from scratch, in code Andrej Karpathy |
YouTube | ~2 hrs | Implement a mini-GPT in PyTorch line by line — attention, causal mask, training loop. |
| 5 | Deep Dive into LLMs like ChatGPT Andrej Karpathy |
YouTube | ~3.5 hrs | The masterclass: tokenization, pretraining data, SFT, RLHF, inference, system prompts, agents — end to end. |
| 6 | Let's reproduce GPT-2 (124M) Andrej Karpathy |
YouTube | ~4 hrs | Training at scale: data loading, distributed training, checkpointing — bridges toy GPT to real models. |
| 7 | RNNs, Transformers, and Attention MIT 6.S191 |
YouTube | ~1 hr | Academic rigor: why attention replaced RNNs; transformer block anatomy. MIT |
| 8 | Large Language Models MIT 6.S191 (2025) — Google |
YouTube | ~1 hr | Modern LLM landscape: scaling, multimodal, safety — industry perspective. MIT |
| 9 | Transformers & LLMs — Lecture 1: Transformer Stanford CME295 |
YouTube | ~1.5 hrs | Full Stanford course lecture: theory + illustrated cheatsheet; entire playlist on cme295.stanford.edu. |
| 10 | How I Learned to Stop Worrying and Love the Transformer Ashish Vaswani — Stanford CS25 |
YouTube | ~1.3 hrs | From the co-author of “Attention Is All You Need” — motivations, evolution, open research directions. |
2 Free Courses Structured learning
| Course | Link | Time | Focus |
|---|---|---|---|
| Neural Networks: Zero to Hero | karpathy.ai/zero-to-hero | ~20 hrs | micrograd → makemore → nanoGPT — the coding path behind the Karpathy videos. |
| How Transformer LLMs Work | DeepLearning.AI | ~2 hrs | Jay Alammar — tokenization, embeddings, attention, KV cache. Best visual intro. |
| Attention in Transformers (PyTorch) | DeepLearning.AI | ~2 hrs | Code self-attention, masked attention, multi-head attention from scratch. |
| Generative AI with LLMs | DeepLearning.AI + AWS | ~12 hrs | Full lifecycle: pre-training, fine-tuning, RLHF, deployment. |
| Stanford CS336 — Language Modeling from Scratch | cs336.stanford.edu | Full course | Build and train GPT-style models from first principles. Expert |
| Stanford CME295 — Transformers & LLMs | cme295.stanford.edu | Full course | Illustrated cheatsheet + recorded lectures; theory meets production. |
| Stanford CS25 — Transformers United | web.stanford.edu/class/cs25 | Seminar series | Guest lectures from Vaswani, Karpathy, Kiela (RAG), Wei (chain-of-thought). |
| MIT 6.S191 — Intro to Deep Learning | introtodeeplearning.com | Full course | Lecture 5: RNNs → Transformers → Attention. MIT |
| MIT 15.773 Hands-On Deep Learning | MIT OCW | Full course | Lectures 6–8: embeddings, transformers, HuggingFace. MIT |
| Stanford CS224N | web.stanford.edu/class/cs224n | Full course | NLP with deep learning — word vectors through LLMs and agents. |
| Fast.ai — Practical Deep Learning | course.fast.ai | Full course | Top-down ML; Part 2 covers transformers and LLM fine-tuning. |
3 Transformers — Deep Dive
The transformer is the core invention. Decoder-only GPT stacks L identical blocks; each block has (1) multi-head self-attention with causal mask, (2) feed-forward MLP, (3) residual connections + layer norm.
Must-read explainers
- The Illustrated Transformer Jay Alammar — encoder-decoder attention; still the best first read.
- The Illustrated GPT-2 Decoder-only autoregressive generation — what ChatGPT is built on.
- Transformers from Scratch (e2eml.school) Math-heavy but clear: Q/K/V derivation, attention matrix, multi-head.
- The Transformer Family — Lilian Weng Survey of variants: RoPE, ALiBi, GQA, MoE, long-context architectures.
- LabML — Annotated Transformer Line-by-line PyTorch implementation with inline annotations.
- Transformer Explainer (Georgia Tech) Interactive GPT-2 visualization — see attention weights live.
Key equations (know these cold)
Causal mask: set future positions to −∞ before softmax
Multi-head: concat(head₁…headh) · WO
4 Context, Tokenization & KV Cache
“Context” is everything the model can attend to at once — your system prompt, chat history, and retrieved documents (in RAG). Context limits are hard (model architecture + memory); KV cache is how inference stays fast.
Tokenization
- HuggingFace NLP Course — Tokenizers BPE, WordPiece, SentencePiece; how vocab size affects cost and quality.
- Tiktokenizer Interactive — paste text, see exact GPT-4 token splits and counts.
- Simon Willison — GPT Tokenizers Practical implications: why token count ≠ word count; billing surprises.
Context window & long-context research
- Lost in the Middle (Liu et al.) Models ignore info in the middle of long contexts — critical for RAG chunk ordering.
- RoPE — Rotary Position Embeddings How modern LLMs encode position; enables longer extrapolation.
- Anthropic — Contextual Retrieval Prepends chunk context before embedding — bridges LLM context limits to RAG.
KV cache (inference memory)
- Sebastian Raschka — What is a KV Cache? Clear FAQ: why decode is O(n²) without cache; memory tradeoffs.
- Coding the KV Cache from Scratch Full implementation walkthrough with GitHub code.
-
HuggingFace — KV Cache Explained
How
past_key_valuesworks ingenerate(). - NVIDIA — LLM Inference Optimization GQA, FP8, continuous batching — production serving concepts.
5 Training Pipeline — Pretrain → SFT → Alignment
A “chat model” is not just pretrained — it goes through multiple stages. Understanding this explains why base models hallucinate freely while ChatGPT refuses harmful requests.
| Stage | What happens | Key resource |
|---|---|---|
| Pretraining | Predict next token on massive text; learns grammar, facts, reasoning patterns. | GPT-3 paper; Scaling Laws (Kaplan) |
| SFT | Supervised fine-tuning on (instruction, response) pairs; teaches format and helpfulness. | InstructGPT |
| RLHF / DPO | Reward model + PPO, or direct preference optimization; aligns with human values. | InstructGPT; DPO paper |
| Continued pretraining | Domain adaptation on your corpus before SFT — for specialized vocab. | HF — How to train |
- Lilian Weng — Prompt Engineering (incl. RLHF overview) Excellent survey connecting training stages to prompting behavior.
- Open LLM Leaderboard Compare open models by benchmark — see impact of SFT/RLHF variants.
6 Foundational Papers Read after videos
| Paper | Link | Why read it |
|---|---|---|
| Attention Is All You Need (2017) | arxiv.org/abs/1706.03762 | The original transformer. Encoder → BERT; Decoder → GPT. Read Section 3 carefully. |
| Improving Language Understanding by Generative Pre-Training (GPT-1) | OpenAI PDF | Decoder-only pretrain + task fine-tune — the GPT recipe. |
| Language Models are Unsupervised Multitask Learners (GPT-2) | OpenAI PDF | Zero-shot task transfer from scale alone. |
| Language Models are Few-Shot Learners (GPT-3) | arxiv.org/abs/2005.14165 | In-context learning — the foundation of prompting. |
| Scaling Laws for Neural Language Models | arxiv.org/abs/2001.08361 | Compute, data, parameters — why bigger models work predictably. |
| Training language models to follow instructions (InstructGPT) | arxiv.org/abs/2203.02155 | SFT + RLHF pipeline — birth of “chat” models. |
| LoRA: Low-Rank Adaptation | arxiv.org/abs/2106.09685 | Parameter-efficient fine-tuning — train adapters, not full weights. |
| Chain-of-Thought Prompting | arxiv.org/abs/2201.11903 | Why “think step by step” improves reasoning. |
7 Build From Scratch Code along
Reading papers is not enough — implement attention yourself. These repos are ordered from smallest to largest.
| Project | Link | What you build |
|---|---|---|
| microgpt | karpathy.github.io/microgpt | ~200 lines, pure Python — full GPT algorithm in one file. |
| micrograd | GitHub — karpathy/micrograd | Autograd engine — understand backprop before transformers. |
| minGPT / nanoGPT | GitHub — karpathy/nanoGPT | Clean, minimal GPT training — the Karpathy video companion. |
| build-nanogpt | GitHub — karpathy/build-nanogpt | Step-by-step git history for reproducing GPT-2 (124M). |
| LLM from Scratch (Raschka book code) | GitHub — rasbt/LLMs-from-scratch | Chapter-by-chapter GPT + LoRA + classification heads. |
| Annotated Transformer (LabML) | GitHub — labmlai | Original “Attention Is All You Need” reimplemented with notes. |
| Stanford CS336 assignments | GitHub — stanford-cs336 | Train BPE tokenizer, implement transformer, run pretraining. Expert |
8 Visual & Interactive Explainers
- 3Blue1Brown — Transformers (Ch. 5 & 6) Best visual intuition for embeddings and attention — companion to videos #2–3.
- LLM Visualization (Bert Hubert / bbycroft) Scroll through a tiny GPT — see every layer, every weight flow.
- Transformer Explainer Interactive GPT-2 — tweak input, watch attention heatmaps update.
- Tiktokenizer See how your prompts get split into tokens — essential for context budgeting.
- Stanford CS224N — Word Vectors Foundation for embeddings — directly relevant to RAG retrieval.
- MIT 15.773 — LLMs & RAG lecture Bridges LLM internals to RAG — watch before switching to the RAG tab. MIT
- Google PAIR — Explorables Interactive articles on attention, bias, and model behavior.
9 Inference & Serving
Production LLM apps are bounded by inference cost and latency. Two phases matter: prefill (process full prompt in parallel) and decode (generate one token at a time).
- Lilian Weng — LLM Inference Optimization Comprehensive survey: batching, quantization, speculative decoding, paging.
- vLLM docs PagedAttention — how production servers manage KV cache memory.
- HuggingFace — Generation strategies Temperature, top-k, top-p, beam search — sampling controls explained.
- OpenAI — Reasoning models (o-series) How “thinking” tokens and extended context change inference patterns.
10 Prompting & Fine-tuning
- Prompt Engineering Guide CoT, few-shot, system prompts — essential before building agents.
- OpenAI — Prompt Engineering Official best practices for instruction-following models.
- HuggingFace PEFT / LoRA Parameter-efficient fine-tuning — when you need style/format, not facts (use RAG for facts).
- MIT — LoRA Colab (Lecture 10.5) Hands-on LoRA fine-tuning notebook from 15.773.
11 Expert Track Go deep
After the 10 videos and a working nanoGPT, these resources take you to research-engineer level.
| Resource | Link | Why it's expert-level |
|---|---|---|
| Stanford CS336 — Language Modeling from Scratch | cs336.stanford.edu | Full stack: BPE tokenizer → transformer → distributed pretraining → eval harness. |
| Stanford CS25 — Transformers United | CS25 recordings | Seminars from Vaswani, Karpathy, Kiela (RAG), Hinton, Fan (agents). |
| Spinning Up in Deep RL (OpenAI) | spinningup.openai.com | Background for understanding RLHF reward modeling and PPO. |
| The Batch — Andrew Ng | deeplearning.ai/the-batch | Weekly research digest — stay current without reading every paper. |
| Papers With Code — Language Modelling | paperswithcode.com | SOTA benchmarks + linked implementations. |
| Sebastian Raschka — Ahead of AI | magazine.sebastianraschka.com | Deep technical articles: KV cache, MoE, quantization, new architectures. |
| Lilian Weng's Blog | lilianweng.github.io | Canonical surveys: transformers, RLHF, agents, diffusion. |
| Distill.pub (archive) | distill.pub | Beautiful interactive explanations of attention and representation learning. |
12 Books & Long-form Guides
| Resource | Link | Level |
|---|---|---|
| Build a Large Language Model (From Scratch) | Manning — Sebastian Raschka | Best code-first book — pairs with Karpathy videos and CS336. |
| Hands-On Large Language Models | O'Reilly — Alammar & Grootendorst | Practical — embeddings, fine-tuning, RAG, evaluation. |
| Speech and Language Processing (Jurafsky & Martin) | web.stanford.edu/~jurafsky/slp3 | Free textbook — NLP foundations through transformers. Expert |
| Deep Learning (Goodfellow, Bengio, Courville) | deeplearningbook.org | Free — math foundations for backprop, optimization, regularization. |
| LLM Course (GitHub) | mlabonne/llm-course | Free curated roadmap: fundamentals → training → deployment. |
| Stanford CME295 Cheatsheet | cme295.stanford.edu | Illustrated reference — transformer variants, training, inference. |
13 8-Week Deep Learning Plan
- Week 1 — Intuition: Videos #1–3 (Karpathy intro + 3Blue1Brown). Read Illustrated Transformer + Illustrated GPT-2.
- Week 2 — Code: Video #4 (build GPT). Complete micrograd + nanoGPT first training run.
- Week 3 — Depth: Video #5 (Karpathy deep dive). Read Attention paper + Scaling Laws.
- Week 4 — Scale: Video #6 (reproduce GPT-2). Start Raschka book Ch. 1–4 or CS336 assignment 1.
- Week 5 — University: Videos #7–8 (MIT 6.S191). CS224N lectures on transformers.
- Week 6 — Theory: Videos #9–10 (CME295 + Vaswani). Read InstructGPT + LoRA papers.
- Week 7 — Context & inference: KV cache coding article. Lilian Weng inference post. Experiment with tiktokenizer + vLLM.
- Week 8 — Apply: Switch to RAG tab. You now understand what the LLM is doing when you feed it retrieved context.
Retrieval-Augmented Generation (RAG)
Patterns, use cases, MIT expert track, interactive demos, and production evaluation — everything for mastering RAG.
↗ How to Use This Guide
RAG is not one technique — it is a stack of decisions. Most production failures happen in retrieval and chunking, not in the LLM.
Impact order when tuning (highest leverage first)
- Better chunking / contextual retrieval
- Cross-encoder reranking
- Hybrid search (dense + BM25)
- Query transformation (multi-query, HyDE, rewrite)
- Swap embedding model
- Swap LLM (last resort)
Recommended production stack (2026 consensus)
▶ Visual & Interactive Resources
See how RAG works — animated pipelines, live demos, 3D embedding maps, and videos with diagrams. Start here if you learn better by watching and clicking than by reading.
Interactive demos Click & play
| Resource | Link | What you see |
|---|---|---|
| RAG Visualized Start here | zackproser.com/demos/rag-visualized | Animated pipeline — Play or step through each stage; live Inspector shows data flow at every step. |
| RAG Playground | rag-play.vercel.app | Hands-on tabs: text splitting → vector embeddings → semantic search → context generation. |
| How Does RAG Work | how-does-rag-work.vercel.app | 4-step sidebar: query term analysis, similarity bar chart, source cards, augmentation. Hover words to see retrieval links. |
| Unravel (live demo) | Unravel on Streamlit | 5-step pipeline with 3D embedding map (UMAP), chunk explorer, and retrieval tuning. |
| Revelio | GitHub — krxthx/revelio | 3D embedding space, retrieval workbench (cosine vs MMR), exact prompt context sent to the LLM. |
| RAG Playground (PDF) | playground.vercel.app | Upload a PDF; split-screen highlights which chunks were retrieved with similarity scores. |
Videos with diagrams Watch
| Resource | Link | Length | Style |
|---|---|---|---|
| What is RAG? Explained | YouTube | ~10 min | Clear diagrams: retrieval layer → context assembly → generation. |
| Intro to RAG | YouTube | ~15 min | Workflow diagrams; Volvo manual example (with vs without RAG). |
| RAG in 60 Seconds | YouTube | 1 min | Quick animated mental model — great before diving deeper. |
| LangChain: Chat with Your Data | DeepLearning.AI | ~1.5 hrs | Video lessons + code; chunking and retrieval shown live. |
Articles with strong diagrams
- Pinecone — What is RAG? Full pipeline diagram; traditional RAG vs agentic RAG side by side.
- Qdrant — What is RAG in AI? Step-by-step flow illustration: query → retriever → LLM.
- IBM — RAG Architecture Pattern Build-time vs runtime architecture diagrams; enterprise reference.
- Engineering Handbook — RAG Pipelines Pipeline diagrams with production defaults and pattern overview.
Open-source visualizers (run locally)
| Project | Link | Highlight |
|---|---|---|
| RAG Visualizer | GitHub — KHemanthRaju/RAG_Visualizer | Web app + demo video: chunking, embeddings, cosine similarity scores. |
| RAGflow | GitHub — sap156/RAGflow | Animated step-by-step flow on each question (demo GIF in README). |
| Unravel | GitHub — jvorndran/Unravel | 3D UMAP embedding explorer + retrieval strategy comparison. |
| How Does RAG Work (source) | GitHub — JessePeplinski/how-does-rag-work | Next.js source for the live demo; similarity landscape + hover highlighting. |
Which stage to explore where
| Pipeline stage | Best place to see it visually |
|---|---|
| Chunking | RAG Playground — Text Splitting tab |
| Embeddings / vector space | Unravel or Revelio — 3D map |
| Similarity search | How Does RAG Work — similarity bar chart |
| Context → LLM | RAG Visualized — Inspector panel |
| Which chunks were used | RAG Playground (PDF) — document highlight view |
1 Foundations
Start here. Understand what RAG is and why retrieval quality dominates answer quality.
| Resource | Why read it |
|---|---|
| Original RAG paper (Lewis et al., NeurIPS 2020) | The source. Defines parametric + non-parametric memory, RAG-Sequence vs RAG-Token. |
| Meta Research — RAG publication page | Same paper, easier to skim with a plain-language summary. |
| RAG: The Complete Guide (Medium) | End-to-end overview: pipeline, hybrid search, reranking, evaluation, tech stack. |
| RAG Complete Guide 2026 (Huzaifa Tahir) | Production-focused: chunking, metadata, hybrid search, deployment checklist. |
| Comet — RAG Developer's Guide | Good bridge from the academic paper to modern LLM applications. |
2 Build Your First RAG
Hands-on courses and official tutorials. Build something before reading advanced patterns.
Free short courses Free
| Course | Instructor | Time |
|---|---|---|
| LangChain: Chat with Your Data | Harrison Chase | ~1.5 hrs |
| Building Agentic RAG with LlamaIndex | Jerry Liu | ~1 hr |
| JavaScript RAG Web Apps with LlamaIndex | Laurie Voss | ~1 hr |
| LangChain for LLM Application Development | Harrison Chase & Andrew Ng | ~1.5 hrs |
| Retrieval Augmented Generation (full course) | Zain Hasan | ~26 hrs |
| 12 Best RAG Courses in 2026 (Class Central) | Curated list | Reference |
Official docs & tutorials
- LlamaIndex — Starter (local) 5-line starter with local embeddings and Ollama.
- LlamaIndex — Advanced RAG cookbooks O'Reilly course notebooks: eval, metadata, multimodal, agents.
- LlamaIndex — Query Pipelines Rewrite → retrieve → rerank → generate as a DAG.
- LangChain — Retrieval concepts 2-step RAG vs agentic RAG, knowledge base patterns.
- LangGraph — Agentic RAG tutorial Grade docs, rewrite query, conditional retrieval loop.
- LangChain OpenTutorial — Naive RAG Progressive series: naive → hybrid → query rewrite.
- Convly — Build a RAG Pipeline 2026 Step-by-step with verified tool versions and defaults.
- Pinecone — Choosing an Embedding Model Part of Pinecone's excellent free RAG learning series.
- Pinecone Learn (full series) Browse all RAG articles from Pinecone.
3 Core Components
Chunking, embeddings, and vector stores — the decisions that matter most.
3A — Chunking
- Engineering Handbook — RAG Pipelines Production defaults, contextual retrieval numbers, pattern overview.
- Convly — Pipeline guide Practical chunk / embedding / rerank defaults.
| Chunking strategy | When to use |
|---|---|
| Recursive character split | Default for most documents |
| Markdown / header split | Docs with clear headings (wikis, READMEs) |
| Parent–child | Precise retrieval but need full paragraph context |
| Semantic chunking | Unstructured prose where fixed size breaks meaning |
| Contextual retrieval | Chunks lose document context when embedded alone |
3B — Embeddings
- MTEB Leaderboard (Hugging Face) Industry-standard embedding benchmark. Focus on Retrieval / NDCG@10.
- EngineersOfAI — Embedding Deep Dive MTEB categories, bi-encoder vs cross-encoder, domain eval.
- learnwithparam — 5 Criteria for Choosing Dimensionality, sequence length, cost, license.
- Microsoft Azure — Generate Embeddings for RAG Domain-specific vs general models, embedding economics.
- Galileo — Selecting an Embedding Model MTEB limits, custom eval on your dataset.
| Model | When to use |
|---|---|
| text-embedding-3-small / large (OpenAI) | Fast to ship, good general English |
| voyage-3-large | Strong for Claude / Anthropic stacks |
| bge-large / e5 / nomic-embed | Self-hosted, cost-sensitive |
| voyage-code-3 | Code search RAG |
3C — Vector databases
- Jose Nobile — Vector DB Guide 2026 Comprehensive comparison: pgvector, Qdrant, Pinecone, Weaviate, Milvus.
- Tensoria — 100M Vector Benchmark Pinecone vs Qdrant vs Weaviate vs pgvector at scale.
- KnowSync — Qdrant vs Pinecone vs pgvector Decision-focused comparison with latency numbers.
- Neuroscale — Vector DB at Scale When pgvector stops being enough; Qdrant filtered search.
- Kolonell — Vector DB 2026 Comparison Cost, setup time, and scale decision table.
| Database | When to use |
|---|---|
| pgvector | Already on Postgres, <5–10M vectors, need SQL + vectors together |
| Qdrant | Fast filtered search, self-host, open source |
| Pinecone | Zero ops, ship fast, large scale, managed SaaS budget |
| Chroma | Local dev and prototypes |
| Weaviate / Milvus | Large-scale hybrid search, enterprise deployments |
4 Retrieval Patterns
The core of advanced RAG — when to use each pattern and where to learn it.
Pattern decision matrix
| Pattern | Problem it solves | When to use | Complexity |
|---|---|---|---|
| Naive RAG | Baseline | Prototype only | Low |
| Hybrid search (dense + BM25 + RRF) | Misses exact terms (SKUs, names, codes) | Default for production | Medium |
| Reranking (cross-encoder) | Top-k has noise | Almost always after hybrid | Medium |
| Multi-query | Vague or multi-faceted queries | Low recall, exploratory Q&A | Medium |
| HyDE | Query–document vocabulary mismatch | Short queries vs technical corpus | Medium |
| Query rewriting | Conversational follow-ups | Chatbots with history | Medium |
| Contextual retrieval | Orphaned chunks without doc context | Long docs, reports, policies | Med–High |
| Parent–child retrieval | Small chunks retrieve, large chunks context | PDFs, legal, technical docs | Medium |
| Contextual compression | Too many tokens in context | Long retrieved documents | Medium |
| MMR | Redundant similar chunks | Need diverse sources | Low |
| Metadata filtering | Multi-tenant, dates, doc types | SaaS, permissions, time-sensitive data | Low–Med |
| GraphRAG | Multi-hop reasoning, corpus themes | Research, investigations, entity-heavy domains | High |
| Self-RAG | Model decides if to retrieve | Agentic systems, uncertain queries | High |
| Agentic RAG | Dynamic retrieve-or-answer | Agents, tool-using assistants | High |
Best resources per pattern
| Pattern / topic | Resource |
|---|---|
| All 12 advanced techniques | Atlan — 12 Advanced RAG Techniques |
| Hybrid search + reranking | Canonical — Hybrid Search and Reranking |
| Hands-on code tutorial | RubyHalib — Advanced RAG Tutorial |
| Query transformations | LangChain Blog — Query Transformations |
| Recall vs precision (rewrite + rerank) | Jatin Bansal — Query Transformations |
| Contextual retrieval (49% → 67% failure reduction) | Anthropic — Contextual Retrieval |
| GraphRAG (official) | Microsoft GraphRAG (GitHub) |
| GraphRAG explainer | Medium — GraphRAG Complete Guide |
| Agentic RAG tutorial | LangGraph — Agentic RAG |
| Agentic RAG notebook | GitHub — langgraph_agentic_rag.ipynb |
| Adaptive RAG (local) | LangGraph — Adaptive RAG tutorial |
5 Evaluation & Production
Measure retrieval and generation separately. Build a golden set from real logs.
Evaluation frameworks
| Tool | Link | Best for |
|---|---|---|
| RAGAS | docs.ragas.io | Faithfulness, context precision/recall, answer relevance |
| RAGAS quickstart | RAGAS Quick Start | Get running in minutes |
| RAGAS metrics | RAGAS Metrics Overview | Understanding each metric |
| DeepEval | docs.confident-ai.com | Pytest-style CI/CD gates |
| Tool comparison | Braintrust — Best RAG Eval Tools 2026 | Production traces → eval datasets |
Production evaluation guides
- Respan — 6 Metrics That Matter Golden set from production logs, LLM-as-judge, failure surfaces.
- CalibreOS — Production RAG Evaluation Three-tier architecture: offline, canary, continuous monitoring.
- Inductivee — Continuous Eval Pipeline CI/CD deployment gates with RAGAS metrics.
- NomadX — Ragas on Kubernetes Scheduled + sampled online evaluation at scale.
- AIVeda — Production RAGAS Guide SLOs, canary mode, continuous improvement loop.
Key metrics
| Metric | Layer | What it catches |
|---|---|---|
| Context recall | Retrieval | Right doc never retrieved (~60% of prod failures) |
| Context precision | Retrieval | Too much irrelevant context |
| Faithfulness | Generation | Hallucination beyond retrieved context |
| Answer relevance | Generation | Answer doesn't address the question |
| Citation accuracy | End-to-end | Wrong source attribution |
6 Use-Case Playbooks
Pick the right pattern for your scenario before over-engineering.
| Use case | Recommended approach | Start with |
|---|---|---|
| Internal docs Q&A | Hybrid + rerank + metadata filters | LangChain Chat with Your Data |
| Customer support | Hybrid + rerank + query rewrite for chat history | Agentic RAG (LangGraph) |
| Code search | voyage-code-3 + hybrid (semantic + keyword on symbols) | Pinecone embedding guide |
| Legal / compliance | Parent–child + citations + faithfulness eval | Contextual retrieval + RAGAS |
| Research / corpus themes | GraphRAG or RAPTOR | Microsoft GraphRAG |
| Multi-modal (PDFs + images) | Multi-modal RAG index | LlamaIndex Multimodal Cookbook |
| Low-latency chat | pgvector + small embedder + rerank top-5 | Convly local stack guide |
| Enterprise permissions | Metadata pre-filtering + pgvector or Qdrant | Vector DB filtered search guide |
? RAG vs Alternatives
Know when RAG is the right tool — and when it isn't.
| Approach | Use when |
|---|---|
| RAG | Knowledge changes often, need citations, proprietary data, no fine-tuning budget |
| Fine-tuning | Style/format control, domain language, task-specific behavior (not facts) |
| Long context only | Small corpus that fits reliably in the context window |
| GraphRAG | Relationship-heavy data, multi-hop questions, corpus-wide themes |
| Tool / API agents | Live data (CRM, DB, APIs) — connect as tools, not a vector index |
4 4-Week Learning Plan
A practical schedule with a deliverable each week.
| Week | Focus | Deliverable |
|---|---|---|
| Week 1 | Foundations + naive RAG | Working chatbot over your own PDFs |
| Week 2 | Hybrid search + reranking | Measurable recall improvement vs baseline |
| Week 3 | Evaluation with RAGAS | Golden set of 50+ questions + baseline scores |
| Week 4 | One advanced pattern | Contextual retrieval or agentic RAG for your use case |
◆ Expert Track — MIT & Deep Foundations
Go beyond tutorials: understand retrieval theory, read the papers that shaped modern RAG, and study how MIT teaches and builds production RAG systems. Rigorous, not academic for its own sake.
MIT — courses & lectures MIT
| Resource | Link | Why it matters for experts |
|---|---|---|
| 15.773 Hands-On Deep Learning (full course) | MIT OCW — 15.773 | Free graduate course. Lectures 6–10 cover embeddings → transformers → LLMs → RAG → LoRA fine-tuning. |
| Lecture 9 video: LLMs & RAG (1h 14m) | MIT Learn — Lecture 9 | Full lecture on next-word prediction, prompting, and retrieval-augmented generation. |
| Lecture 10 slides: RAG + LoRA | Lecture 10 PDF | RAG vs fine-tuning, when you can't fit data in context, Colab notebook linked. |
| RAG Colab notebook | Assignments — Colab: RAG (Lecture 10) | Hands-on: HODL-SP24-Section-A-Lec-10-Retrieval-Augmented-Generation. Build it yourself. |
| 6.5830 Database Systems — Lec 17 | Embeddings, RAG, and Vector DBs (PDF) | CSAIL depth: word2vec → RAG architecture → vector DB internals (HNSW, NSW indexing). The systems layer most RAG blogs skip. |
| 6.5830 course schedule | MIT 6.5830 Schedule | Full database systems curriculum; Lecture 17 is the RAG/vector DB week. |
| Archi (A2rchi) — MIT RAG framework | GitHub — archi-physics/archi | Production RAG built at MIT (SubMIT, courses 8.01/8.511, CSAIL). Study real architecture, not toy demos. |
| Archi documentation | archi-physics.github.io/archi | Ingestion pipelines, Piazza integration, deployment patterns for academic/research RAG. |
| MIT ORCD — Run your own RAG | ORCD Docs — RAG recipe | Practical guide: vector store from PDFs/Markdown, HuggingFace LLMs, cluster deployment. |
| MIT GenAI — A2rchi overview | genai.mit.edu — A2rchi | Research context: why MIT built open-source RAG for courses and research support. |
| CSAIL talk: Search for LLM workloads | Chroma CTO at MIT CSAIL | Hybrid search architecture, context rot research, how retrieval systems should be designed for LLMs. |
| MIT xPRO — RAG & Context Engineering Paid | MIT xPRO program | 8-week professional program: hybrid retrieval, multihop pipelines, production eval, capstone. Optional if you want structured credential. |
Information retrieval foundations Prerequisite
RAG experts understand why BM25 still matters and how vector search relates to classical IR. Don't skip this.
- Introduction to Information Retrieval Manning, Raghavan, Schütze — free full textbook. The bible of search.
- IR Book — HTML edition Read Ch. 6 (vector space model), Ch. 8 (evaluation: precision/recall), Ch. 11 (BM25).
- Stanford CS224N — RAG & Agents (slides) Bridges IR → DPR → RAG → agents. BM25 vs DPR vs ColBERT, joint retriever training.
- Stanford CS224N — QA & RAG (slides) REALM, retriever saturation (why top-10–20 docs matter), citation problems.
- CS224N course page Full syllabus with paper readings for Agents, Tool Use, and RAG week.
Paper reading ladder Core papers
Read in this order. Each paper builds on the last. Skip surveys until you've read at least the first four.
| # | Paper | Link | What you'll learn |
|---|---|---|---|
| 1 | DPR — Dense Passage Retrieval | arxiv.org/abs/2004.04906 | Bi-encoder retrieval, dual-encoder training — the foundation under every vector DB query. |
| 2 | RAG — Lewis et al. (NeurIPS 2020) | arxiv.org/abs/2005.11401 | Parametric + non-parametric memory, RAG-Sequence vs RAG-Token. |
| 3 | REALM — Retrieval-augmented pre-training | arxiv.org/abs/2002.08909 | Training the retriever end-to-end; async re-indexing during training. |
| 4 | FiD — Fusion-in-Decoder | arxiv.org/abs/2007.01282 | How to feed many retrieved passages into the generator efficiently. |
| 5 | Self-RAG | arxiv.org/abs/2310.11511 | Reflection tokens: when to retrieve, grade passages, critique output. |
| 6 | CRAG — Corrective RAG | arxiv.org/abs/2401.15884 | Evaluate retrieved docs; web fallback when retrieval quality is low. |
| 7 | RAPTOR — Tree-organized retrieval | arxiv.org/pdf/2401.18059 | Hierarchical summarization for thematic / multi-level retrieval. |
| 8 | GraphRAG — Microsoft | arxiv.org/abs/2404.16130 | Knowledge graphs + community summaries for corpus-wide questions. |
Paper guides & reading lists
- 12 Papers That Shaped Modern RAG Curated ladder with plain-English summaries — best companion while reading papers.
- PKU-DAIR RAG Survey (GitHub) Massive categorized paper list: query-based RAG, finetune retriever, model-based RAG, frameworks.
- RAG Paper Analysis + Production Architecture Deep walkthrough: DPR bi-encoder math, Self-RAG, CRAG, RAGAS metrics — connects theory to production.
- Systematic Literature Review (128 papers, PRISMA) 2020–May 2025 survey: modular RAG, hybrid retrieval, eval practices, security. Read after core papers.
- Same review — MDPI full text HTML version with tables and taxonomy of RAG architectures.
12-week expert curriculum
| Weeks | Focus | Resources | Deliverable |
|---|---|---|---|
| 1–2 | IR foundations | Manning IR book Ch. 6, 8, 11 | Implement BM25 + explain precision/recall on a toy corpus |
| 3 | Dense retrieval | DPR paper + facebookresearch/DPR | Embed + retrieve with a bi-encoder; measure Recall@k |
| 4 | Canonical RAG | RAG paper + MIT 15.773 Lecture 9–10 + Colab | End-to-end RAG with citations |
| 5 | Systems layer | MIT 6.5830 Lec 17 + vector DB guide | Explain HNSW vs brute-force; tune pgvector/Qdrant |
| 6 | Hybrid + rerank | Canonical blog + hands-on tutorial | Hybrid pipeline with measured precision lift |
| 7 | Advanced patterns | Self-RAG + CRAG papers | Implement document grading loop (LangGraph) |
| 8 | Evaluation discipline | RAGAS + Respan production eval guide | Golden set 100+ Qs; separate retrieval vs generation metrics |
| 9 | Production RAG | Study Archi source + ORCD recipe | Deploy RAG with observability and metadata filters |
| 10 | Structured retrieval | GraphRAG paper + Microsoft repo | GraphRAG on a small corpus; compare vs flat RAG |
| 11 | Field survey | Systematic review (128 papers) + PKU survey | Written taxonomy: which pattern for which failure mode |
| 12 | Capstone | Your domain corpus | Production RAG with eval CI gate, hybrid + rerank, documented architecture |
★ Top 10 Links
If you only bookmark ten resources, make it these.
- Original RAG paper (Lewis et al., 2020)
- Complete RAG guide (Medium)
- LangChain Chat with Your Data (free course)
- 12 Advanced RAG Techniques (Atlan)
- Anthropic Contextual Retrieval
- Canonical — Hybrid Search + Reranking
- LangGraph Agentic RAG
- RAGAS documentation
- MTEB embedding leaderboard
- Vector DB decision guide
Building AI Agents
Production-grade agents: ReAct loops, LangChain DAGs, LangGraph state machines, MCP tools, memory, evaluation, and observability — curated for deep conceptual understanding.
↗ Mental Model — Agents vs Workflows
Anthropic draws a critical distinction: a workflow is a predefined code path (DAG); an agent lets the LLM dynamically decide which tools to call and when to stop. Production systems usually blend both — deterministic steps where reliability matters, agentic loops where flexibility matters.
The 5 building blocks (CoALA framework)
- LLM (brain) — reasoning, planning, tool selection
- Tools (hands) — APIs, DB queries, search, code execution, MCP servers
- Memory — working (context window) + long-term (vector store, LangGraph Store)
- Orchestration — LangChain chains (linear DAG) or LangGraph StateGraph (cyclic state machine)
- Observability + eval — traces, trajectory scoring, regression datasets (non-optional in production)
1 15 Conceptual Videos Theory, not tutorials
Lectures, keynotes, and architecture deep-dives — not step-by-step coding walkthroughs. Watch in rough order.
| # | Video | Link | Length | What you'll learn |
|---|---|---|---|---|
| 1 | Learn to Build Effective Agentic AI Systems Andrew Ng |
YouTube | ~15 min | 4 agentic design patterns in raw Python; why disciplined error analysis (evals) is the #1 success predictor. |
| 2 | Stanford CS230 — Agents, Prompts & RAG Kian Katanforoosh |
YouTube | ~1.5 hrs | Full university lecture: agent components (prompts, memory, tools), agentic workflows, MCP, multi-agent, RAG bridge. |
| 3 | Language Agents: From Reasoning to Acting Shunyu Yao + Harrison Chase |
YouTube | ~1 hr | ReAct author + LangGraph creator discuss ReAct, Reflexion, CoALA, and the future of language agents. |
| 4 | Keynote — The Second Half (AI Agents) Shunyu Yao [OpenAI] |
YouTube | ~25 min | Why agents work now: language prior + reasoning as action space + RL; test-time scaling and operator models. |
| 5 | Anthropic's Blueprint for Building Effective Agents Blog walkthrough |
YouTube | ~30 min | Workflows vs agents, prompt chaining, routing, parallelization, orchestrator-workers, evaluator-optimizer. |
| 6 | LLM Chronicles — ReAct (Reason + Act) Research breakdown |
YouTube | ~20 min | Thought → Action → Observation loop; why the agent executor parses LLM output; reasoning traces in context. |
| 7 | ReAct Agent Explained Simply Conceptual overview |
YouTube | ~15 min | When ReAct helps vs overkill; tools as "hands," LLM as "brain," prompt template structure. |
| 8 | LangChain vs LangGraph — A Tale of Two Frameworks | YouTube | ~12 min | DAG (linear chains) vs cyclic graphs; state management; when each framework fits. |
| 9 | Introduction to LangGraph (Course Launch) Harrison Chase |
YouTube | ~8 min | Why LangGraph exists: precision, control, HITL, memory — production agent runtime philosophy. |
| 10 | What's Next for AI Agents Harrison Chase @ Sequoia AI Ascent |
YouTube | ~15 min | Planning, UX, and memory as the three frontiers for production-ready agents. |
| 11 | Enterprise Agents & Observability Harrison Chase interview |
YouTube | ~45 min | Why traces are the foundation of reliable agents; LangSmith insights, regression testing, debug mode. |
| 12 | MIT 6.S191 — LLMs (ReAct section) Google Research |
YouTube | ~1 hr | ReAct vs chain-of-thought vs act-only; why interleaving reasoning and action prevents loops. |
| 13 | How to Build AI Agents (Stanford) Kian Katanforoosh |
YouTube | ~1.5 hrs | Working vs archival memory, tool design, agentic workflow design for production. |
| 14 | Multi-Agent Architectures (Conceptual Guide) LangChain team |
YouTube | ~15 min | Supervisor, hierarchical teams, shared state keys, message-list communication patterns. |
| 15 | AutoGen — Complex Tasks via Multi-Agent Workflows Microsoft Research |
YouTube | ~30 min | Task ledger, agent specialization, inner progress loop — multi-agent from first principles. |
2 Free Courses & Structured Learning Hands-on after theory
| Course | Link | Time | Focus |
|---|---|---|---|
| Agentic AI | DeepLearning.AI — Andrew Ng | ~5 hrs | 4 patterns in raw Python: reflection, tool use, planning, multi-agent. Eval-driven development. |
| AI Agents in LangGraph | DeepLearning.AI | ~1.5 hrs | Scratch agent → LangGraph rebuild. Persistence, HITL, agentic search. |
| LangChain Academy — Intro to LangGraph | LangChain Academy | ~6 hrs | State, memory, HITL, deployment — official production-focused course. |
| Hugging Face Agents Course | hf.co/learn/agents-course | ~10 hrs | smolagents, LangGraph, LlamaIndex — full curriculum with certification. |
| Functions, Tools and Agents with LangChain | DeepLearning.AI | ~1.5 hrs | Tool binding, OpenAI function calling, agent executor loops. |
| Multi AI Agent Systems with crewAI | DeepLearning.AI | ~2 hrs | Role-based multi-agent delegation — contrast with LangGraph supervisor pattern. |
| Building Agentic RAG with LlamaIndex | DeepLearning.AI | ~1 hr | Bridges agents + RAG — prerequisite for Agentic RAG tab. |
| Stanford CS224G — Generative AI Agents | web.stanford.edu/class/cs224g | Full course | Lecture 7: Agent Orchestration & Workflow Design (LangGraph vs CrewAI, MCP, state). |
3 Agent Architecture — CoALA & Components
The CoALA (Cognitive Architectures for Language Agents) framework organizes every agent into memory, action space, and decision-making cycles.
| Component | What it does | Deep resource |
|---|---|---|
| Planning | CoT, ReAct, Tree-of-Thoughts, plan-and-execute | Lilian Weng survey |
| Memory | Working (context) + long-term (vector store, graph, LangGraph Store) | LangChain Memory concepts |
| Tool use | Function calling, structured outputs, tool schemas | OpenAI Function Calling guide |
| Reflection | Self-critique and retry (Reflexion pattern) | Reflexion paper |
| Multi-agent | Supervisor, hierarchical teams, peer handoffs | LangGraph Multi-Agent blog |
- CoALA — Cognitive Architectures for Language Agents The taxonomy paper — maps 100+ agent systems into one framework. Expert
- Awesome Language Agents (CoALA) 300+ paper bibtex organized by CoALA dimensions.
- Anthropic — Building Effective Agents Production patterns: augment LLM, workflows vs agents, when NOT to use agents.
- IBM — What is Agentic Architecture? Enterprise framing: perceive → reason → act → learn loop.
- Agents Design — Lilian Weng breakdown Structured summary of planning, memory, tool use with implementation notes.
4 LangChain vs LangGraph — DAG vs State Machine
LangChain orchestrates linear pipelines (DAG): prompt | model | parser — great for RAG, summarization, fixed flows.
LangGraph compiles a cyclic state machine: nodes mutate shared state, edges route conditionally, loops are native.
| Dimension | LangChain (LCEL / chains) | LangGraph (StateGraph) |
|---|---|---|
| Execution model | Directed acyclic graph (DAG) — forward only | Cyclic state machine — loops, branches, retries |
| State | Implicit between steps | Explicit TypedDict/Pydantic, checkpointed to DB |
| Human-in-the-loop | Manual workaround | Native interrupt() + resume |
| Multi-agent | Possible but awkward | Nodes as agents, supervisor routing, subgraphs |
| Production fit | Simple RAG, classification, ETL | Tool agents, long-running workflows, compliance gates |
- LangGraph Overview (official) When to use LangGraph vs LangChain — the canonical decision guide.
- Building LangGraph — Design from First Principles Why LangGraph was built: checkpointing, durability, low abstraction, OTEL tracing. Must read
- Thinking in LangGraph How to decompose agents into nodes; store raw data in state, not formatted strings.
- Pregel Runtime (under the hood) BSP execution model: Plan → Execute → Update channels. Actor-model internals.
- Milvus — LangChain vs LangGraph Developer Guide Side-by-side comparison with production decision matrix.
- Stanford CS224G — Agent Orchestration (PDF) University lecture slides: LangGraph vs CrewAI, MCP, checkpointing, safety.
5 Core Agentic Patterns
| Pattern | How it works | When to use | Resource |
|---|---|---|---|
| ReAct | Interleaved Thought → Action → Observation loop | Dynamic tool use, QA with search | ReAct paper |
| Plan-and-Execute | Planner creates steps; executor runs them | Predictable multi-step tasks, lower cost | LangChain Planning Agents |
| Routing | Classifier picks which sub-agent or tool chain to run | Multi-domain support bots | Anthropic Agents Cookbook |
| Prompt chaining | Output of step N → input of step N+1 | Fixed pipelines (translate → summarize) | Anthropic workflows |
| Orchestrator-workers | Central LLM delegates subtasks to workers | Parallel research, multi-perspective analysis | Claude Cookbook |
| Evaluator-optimizer | Generator + critic loop until quality threshold | Writing, code generation, translation | Anthropic Cookbook |
| Reflexion | Agent critiques own output, retries with memory | Tasks with verifiable feedback | Reflexion paper |
| Supervisor (multi-agent) | Router delegates to specialist sub-agents | Complex workflows with role separation | LangGraph Supervisor tutorial |
| StateGraph | Nodes + conditional edges + shared state + reducers | Production agents needing control + durability | LangGraph Graph API |
| Human-in-the-loop | interrupt() pauses graph; human approves/edits; resume |
Irreversible actions, compliance, billing | LangGraph Interrupts |
- AgentPatterns.ai Pattern catalog with tradeoffs: ReAct vs plan-execute, when each pays off.
- Andrew Ng — How Agents Improve LLM Performance Reflection, tool use, multi-agent — the 4 workflow patterns explained.
6 LangGraph Deep Dive — Production Concepts
LangGraph is a state machine compiler. You define typed state, nodes (functions), edges (routing), and a checkpointer (persistence).
Core concepts
| Concept | What it means | Docs |
|---|---|---|
| State schema | TypedDict/Pydantic — every node reads/writes named channels | State |
| Reducers | add_messages merges message lists; custom reducers for lists/dicts |
Reducers |
| Checkpointing | Serialize state after every node — resume, time-travel, HITL | Persistence |
| thread_id | Unique ID per conversation/run — required for multi-tenant production | Threads |
| Subgraphs | Nested StateGraphs — hierarchical multi-agent teams | Subgraphs |
| Command | Node returns Command(goto=…, update=…) for dynamic routing |
Command |
| Store | Long-term memory across threads (user profiles, facts) | Store |
| recursion_limit | Hard cap on loop iterations — always set in production | Recursion limit |
Production checklist
- 5 LangGraph Production Patterns Postgres/Redis checkpointer, retry budgets, interrupt gates, error state handling.
- LangGraph State Machine — Principal Engineer Deep Dive Reducers, parallel branches, per-node eval hooks, LangSmith replay workflow.
- LangSmith Deployment Deploy stateful graphs to production infrastructure.
- Deep Agents harness Planning, subagents, filesystem memory for long-running tasks (Claude Code pattern).
7 Tools, Function Calling & MCP
Tools extend the LLM beyond text. Modern stacks use OpenAI-style function calling or the Model Context Protocol (MCP) for standardized tool discovery.
| Layer | What it is | Resource |
|---|---|---|
| Function calling | LLM outputs structured JSON → runtime executes function | OpenAI guide |
| LangChain tools | @tool decorator, bind_tools(), ToolNode |
LangChain Tools |
| MCP | Open protocol: Host → Client → Server (tools, resources, prompts) | MCP Architecture |
| A2A | Agent-to-Agent protocol (Google) for inter-agent communication | A2A spec |
| Tool design | Good schemas = reliable agents; return structured errors | Anthropic Tool Use |
- Anthropic — Introducing MCP Why MCP exists: replace M×N integrations with one protocol.
- HuggingFace — MCP Key Concepts Tools vs resources vs prompts; JSON-RPC; stdio vs Streamable HTTP.
- Addy Osmani — MCP Deep Dive When MCP vs simple CLI tools; security and OAuth 2.1.
- LangChain MCP integration Connect LangGraph agents to MCP servers in production.
8 Agent Memory & State
- LangChain — Memory overview Short-term (conversation buffer) vs long-term (vector store, entity memory).
- LangGraph — Persistence & checkpointing PostgresSaver, RedisSaver — never use MemorySaver in production.
- LangGraph Store — cross-thread memory User profiles and facts that persist across conversations.
- Runtime & Context injection Pass user_id, DB connections, config into tools without globals.
- Pinecone — Conversational Memory patterns Buffer, summary, entity — when each memory type fits.
9 Agent Observability Production critical
Agents are non-deterministic. You cannot debug them with print statements — you need traces (full execution trees), spans per node/tool call, and trajectory evaluation (did the agent take the right steps?).
Observability platforms
| Platform | Type | Best for | Link |
|---|---|---|---|
| LangSmith | Managed (LangChain-native) | LangGraph teams — graph traces, Studio debugger, multi-turn evals | docs.langchain.com/langsmith |
| Langfuse | Open-source / cloud | Self-hosted, OTel-native, cost dashboards, agent graph viz | langfuse.com/docs |
| Arize Phoenix | Open-source (ELv2) | OTLP-native tracing, embeddings viz, eval harness | docs.arize.com/phoenix |
| Braintrust | Managed | Experiment-driven evals, CI/CD for agents, scorer library | braintrust.dev/docs |
| MLflow Tracing | Open-source (Apache 2.0) | Full MLOps lifecycle, 60+ framework integrations via OTel | mlflow.org/tracing |
| Helicone | Proxy gateway | Zero-code cost/latency tracking across 300+ models | docs.helicone.ai |
| Datadog LLM Observability | Enterprise APM | Teams already on Datadog — unified infra + LLM traces | Datadog LLM Obs |
Deep guides
- Langfuse — AI Agent Observability Guide End-to-end: trace structure, tool-call analytics, monitors, alerts, OTel integration.
- LangSmith — End-to-End OpenTelemetry OTel export from LangGraph; interoperate with Datadog, Grafana, Jaeger.
- LangChain — Trajectory vs Output Evaluation Why scoring final output alone misses 20–40% of agent failures.
- AI Agent Observability 2026 — Stack Guide What to log, OTel GenAI conventions, platform comparison by deployment model.
- MLflow — Top 5 Agent Observability Tools Feature matrix: open-source, OTel support, LangChain integration depth.
- Arize — Compare 7 Eval Platforms Side-by-side: tracing, CI/CD evals, self-hosted vs managed.
10 Agent Evaluation & Safety
Production agents need offline evals (regression datasets) and online evals (sampled production traffic) — especially multi-turn trajectory scoring.
- LangSmith — Multi-turn Online Evals Score full threads: semantic intent, outcome, tool-call trajectory.
- LangSmith Insights Agent Auto-cluster production failure patterns from traces.
- LangSmith Evaluation overview Datasets, experiments, LLM-as-judge, human annotation queues.
- Braintrust — Evals guide Scorers, playgrounds, CI integration for agent behavior specs.
- Phoenix — LLM Evals Hallucination, relevance, toxicity evaluators on trace data.
- Prompting Guide — Agent eval strategies Tool-call accuracy, step correctness, end-goal achievement metrics.
Safety & guardrails
- LangSmith Guardrails PII detection, prompt injection, policy violations at runtime.
- NVIDIA NeMo Guardrails Colang-based rails for topic control, fact-checking, jailbreak defense.
- FAccT Tutorial — LM Agents: Prospects and Impacts Societal risks, guardrails, and responsible deployment framing.
11 Foundational Papers
| Paper | Link | Why read it |
|---|---|---|
| ReAct | arxiv.org/abs/2210.03629 | The agent loop foundation — reasoning + acting interleaved. |
| CoALA | arxiv.org/abs/2309.02427 | Taxonomy for all language agents — memory, action, decision-making. |
| Reflexion | arxiv.org/abs/2303.11366 | Verbal reinforcement learning — agent learns from self-critique. |
| Toolformer | arxiv.org/abs/2302.04761 | LLMs learn to call APIs via self-supervised annotation. |
| Tree of Thoughts | arxiv.org/abs/2305.10601 | Search over reasoning paths — planning at inference time. |
| Generative Agents | arxiv.org/abs/2304.03442 | Memory + planning + reflection for believable agent behavior. |
| MRKL Systems | arxiv.org/abs/2205.00445 | Modular neuro-symbolic routing to expert modules. |
12 Framework Comparison
| Framework | Model | Production fit | Link |
|---|---|---|---|
| LangGraph | Explicit state machine (graph) | Best for compliance, HITL, audit trails, long-running agents | GitHub |
| LangChain | LCEL chains (DAG) + agent executors | Component library, simple agents, RAG pipelines | GitHub |
| CrewAI | Role-based agent teams | Fast multi-agent prototypes; less control than LangGraph | docs.crewai.com |
| AutoGen (Microsoft) | Conversation-based multi-agent | Research, group chat agents, task ledgers | microsoft.github.io/autogen |
| OpenAI Agents SDK | Handoffs + guardrails | OpenAI-native agents with built-in tracing | OpenAI Agents SDK |
| smolagents (HF) | Minimal code-first agents | Learning and lightweight agents; code-as-action | HF smolagents |
| Google ADK | Workflow graphs + agents | Google Cloud / Gemini ecosystem | ADK docs |
13 Hands-on Repos & References
- LangGraph 101 (official) 101 + 201 notebooks: middleware, email agent, multi-agent, deep agents.
- Anthropic Agents Cookbook Minimal Python — no framework magic. Prompt chaining, routing, orchestrator-workers.
- LangGraph Examples Official examples: ReAct, supervisor, HITL, persistence, streaming.
- HF Agents — LangGraph unit Exercises with smolagents + LangGraph side by side.
- langgraph-supervisor-py Pre-built supervisor pattern library for multi-agent systems.
- Built with LangGraph — case studies LinkedIn, Uber, Klarna production agent architectures.
14 When to Use What
| Approach | Use when | Avoid when |
|---|---|---|
| Simple chain / LCEL | Fixed pipeline, predictable I/O, low latency | Need loops, dynamic tool selection |
| ReAct agent (LangGraph) | Dynamic tool use, open-ended queries | Every step must be auditable/deterministic |
| Workflow (Anthropic patterns) | Known steps with optional LLM at each node | Truly unpredictable user intent |
| Multi-agent supervisor | Specialized roles, complex branching | Simple single-tool tasks (overkill) |
| Agentic RAG | LLM decides if/when to retrieve | All queries need same retrieval (use 2-step RAG) |
15 8-Week Production Agent Learning Plan
| Week | Focus | Deliverable |
|---|---|---|
| 1 | Mental model + videos #1–5 | Read Anthropic + Lilian Weng; explain workflow vs agent to a colleague |
| 2 | ReAct + function calling | Agent with 3+ tools; trace every step in LangSmith |
| 3 | LangChain LCEL chains | Linear RAG/summarization pipeline (DAG mental model) |
| 4 | LangGraph StateGraph | ReAct agent with conditional edges + add_messages reducer |
| 5 | Persistence + HITL | Postgres checkpointer + interrupt before irreversible actions |
| 6 | MCP + tool design | Connect agent to 1 MCP server; structured error handling |
| 7 | Observability + evals | Langfuse/LangSmith: trajectory evals, failure → regression dataset |
| 8 | Multi-agent or production deploy | Supervisor pattern OR LangSmith deployment → move to Agentic RAG tab |
Agentic RAG — Frontier & Production
Beyond 2-step RAG: agent-controlled retrieval, multihop reasoning, GraphRAG, multimodal docs, massive corpora, scaling DevOps, and rigorous evaluation — architecture-first.
↗ Evolution: Naive → Advanced → Agentic RAG
Naive RAG always retrieves top-k and generates. Advanced RAG adds hybrid search, reranking, contextual chunks, query transforms. Agentic RAG puts an LLM (or LangGraph state machine) in control: decide whether to retrieve, which tool/index to query, when to rewrite, and when to stop.
| 2-Step RAG | Agentic RAG | |
|---|---|---|
| Control flow | Fixed DAG — always retrieve → generate | Cyclic graph — LLM/agent routes dynamically |
| Retrieval | Single top-k pass | Multi-hop, multi-index, optional skip |
| Self-correction | None | CRAG / Self-RAG grading loops |
| Latency & cost | Low | 2–5× LLM calls |
| Best for | Docs Q&A, support bots | Multihop research, mixed sources, high-stakes accuracy |
1 RAG Frontier — 2025–2026 Patterns Architecture map
The field moved from "better embeddings" to orchestrated retrieval strategies. Use this table to pick patterns by query type — not hype.
| Pattern | Core idea | Query type | Deep resource |
|---|---|---|---|
| Agentic RAG | Retriever as tool; agent decides when/how | Mixed intent, tool selection | Agentic RAG Survey (2025) |
| Self-RAG | Reflection tokens: retrieve? relevant? supported? | High-stakes factual QA | Self-RAG paper |
| CRAG | Grade docs; web search fallback on low relevance | Stale internal KB + live web | CRAG paper |
| Adaptive RAG | Route by complexity: skip / vector / web / agent | Diverse query mix (cost optimization) | LangGraph Adaptive RAG |
| GraphRAG | KG + community summaries; global/local search | "What are the main themes?" corpus-wide | Microsoft GraphRAG |
| RAPTOR | Recursive clustering → tree retrieval | Long docs needing hierarchical context | RAPTOR paper |
| Contextual Retrieval | Prepend chunk context before embedding | All production corpora (Anthropic −49% failures) | Anthropic research |
| ColPali / Vision RAG | Page-as-image embeddings; no OCR pipeline | Infographics, tables, slide decks, scans | Microsoft ColPali RAG |
| PageIndex | Vectorless tree navigation over document TOC | Long structured PDFs (financial, legal) | PageIndex intro |
| Agentic GraphRAG | Agent picks vector vs graph traversal vs Cypher | Relational + multi-hop entity queries | Memgraph Agentic GraphRAG |
| HyDE | Generate hypothetical answer → embed → retrieve similar real docs | Low-recall queries with vocabulary mismatch | HyDE paper |
| RRF hybrid fusion | Merge BM25 + dense rankings without score normalization | Production hybrid search baseline | OpenSearch RRF |
- Agentic RAG: A Survey (Singh et al.) Taxonomy: agent cardinality, control structure, memory — maps 100+ systems. Must read
- AgenticRAG-Survey GitHub Companion repo with framework comparisons and paper links.
- RAG in Production — Complete Architecture Guide Latency budgets per technique; when agentic retrieval pays off vs costs 2–5×. Production
- Self-Correcting Retrieval Loops for Production Query planning, reflection agents, stuck-loop detection, cost guards.
- Production-Ready RAG Architecture in 2026 Full stack reference: hybrid + rerank + agentic coordinator + RAGAS thresholds (faithfulness <0.9 → fix retrieval first).
- Agentic RAG Production Guide — Real Costs $0.02–$0.31/query cost ranges; four failure modes (infinite loops, never-reject graders, context overflow, latency spirals).
2 Agentic RAG Pattern Deep Dive
| Pattern | Architecture | LangGraph nodes | Resource |
|---|---|---|---|
| Canonical Agentic RAG | generate_query_or_respond → retrieve → grade → rewrite loop | 5-node StateGraph | LangGraph docs |
| CRAG | Retriever → relevance grader → [generate | web search] | Conditional edge on doc score | CRAG tutorial |
| Self-RAG | Retrieve decision → grade relevance → grade support → generate | Multiple grader nodes | Self-RAG tutorial |
| Adaptive RAG | Query classifier → vectorstore | web | no-retrieval | Router node first | Adaptive RAG tutorial |
| Modular RAG | Swappable retrieval modules per query type | Subgraphs per module | Modular RAG survey |
| Hybrid future | Self-RAG reflection + agentic planning + CRAG correction | Composable subgraphs | Anthropic patterns |
3 Multihop & Query Decomposition
Multihop queries need sequential retrieval — step 2's documents depend on step 1's answer. Single-pass top-k retrieval is structurally insufficient for questions like "Compare revenue of companies founded in the same city as X."
| Technique | How it works | When to use | Resource |
|---|---|---|---|
| IRCoT | Each CoT sentence becomes next retrieval query | Research QA, HotpotQA-style | IRCoT paper · code |
| Self-Ask | LLM generates follow-up questions before answering | Composable with any retriever | Self-Ask paper |
| Query decomposition | Planner splits query → parallel sub-retrievals → merge | Compare/contrast, multi-entity | LlamaIndex Agentic RAG |
| AtomRAG | Atomic requirements → plan-then-retrieve for vector DBs | Structured multihop over unstructured data | AtomRAG paper |
| IRCoT-style agent loop | LangGraph: retrieve → reflect → rewrite → repeat | Production agentic multihop | Production RAG Agent Platform (paper) |
- Agent-Orchestrated Adaptive RAG — MuSiQue study Shows decomposition helps structured domains but can hurt multihop benchmarks — apply selectively.
- Jerry Liu — Adding Agentic Layers to RAG Why naive RAG fails on multipart questions; routing and query planning architecture.
4 Production Agentic RAG Architecture (LangGraph)
The canonical 5-node graph — implement this before exotic variants. Add checkpointing, recursion limits, and faithfulness verification for production.
- generate_query_or_respond — LLM with retriever tool; decides retrieve or answer directly
- retrieve — hybrid search (BM25 + dense) → rerank top 5–10
- grade_documents — LLM relevance grader; route to rewrite or generate
- rewrite_question — reformulate query if docs irrelevant (max N retries)
- generate_answer — grounded generation + optional faithfulness check
Production extensions
- langgraph_agentic_rag.ipynb Official runnable notebook — start here.
- Stanford CS224N — RAG & Agents (PDF) Academic bridge: retrieval fundamentals → agentic tool use.
- Google Cloud — GraphRAG + Agent Platform architecture Enterprise reference: ingestion subsystem + serving subsystem split.
- Google — Multimodal GraphRAG orchestration Multi-agent ingestion + search workflows over knowledge graphs.
- Pinecone — Traditional vs Agentic RAG diagram Visual comparison of fixed pipeline vs agent-controlled retrieval.
5 Multimodal RAG — Infographics, Tables & Visual Docs
Text-only RAG loses layout, charts, and table structure. Three architectures dominate for visual-heavy corpora in 2026.
| Architecture | Pipeline | Best for | Tradeoff |
|---|---|---|---|
| Caption-and-index | VLM captions images → embed captions as text | Simple image search | Loses spatial layout detail |
| Unified multimodal embeddings | Cohere Embed v4, Voyage-multimodal, Gemini embeddings | Mixed text+image corpora at scale | Weaker on hardest visual reasoning |
| ColPali / page-as-image | Render PDF page → vision encoder → multi-vector MaxSim | Infographics, financial reports, slide decks | 100–1000× more vectors per page |
- AI System Design Guide — Multimodal RAG Production architecture patterns, doc classifier routing, hybrid late-fusion. Architecture
- Microsoft — Multi-Modal RAG with ColPali Production reference implementation; late interaction + quantization strategies.
- ViDoRe benchmark (HuggingFace) Benchmark for visual document retrieval — InfographicVQA, ArxivQA, tables.
- Multimodal RAG in 2026 — Architecture comparison ColPali vs unified embeddings; storage and recall tradeoffs.
- ColPali paper (ICLR 2025) Vision-first retrieval — why OCR pipelines fail on layout-heavy docs.
- LlamaParse + multimodal ingestion High-fidelity PDF parsing preserving tables and images for agentic RAG.
6 Massive Corpora & Document Ingestion
Agentic RAG at scale requires treating ingestion as a separate write-path from the query read-path — never block queries during reindexing.
Patterns for huge data
| Pattern | What it solves | Resource |
|---|---|---|
| Parent-child chunking | Retrieve small children (512 tok), generate on large parent (2–4k) | LangChain parent retriever |
| Contextual retrieval | LLM prepends situating context to each chunk before embed | Anthropic contextual retrieval |
| Incremental / CDC ingestion | Content-hash IDs; queue-driven updates on doc change | K8s RAG reference arch |
| GraphRAG indexing | Entity extraction → Leiden communities → community reports | GraphRAG indexing pipeline |
| RAPTOR tree | Recursive cluster + summarize for hierarchical retrieval | RAPTOR paper |
| PageIndex filesystem | File-level tree index over millions of structured docs | PageIndex at scale |
- Scaling RAG Infrastructure — Prototype to Production Kafka ingestion, sharded indexes, batch vs streaming embed jobs.
- LlamaIndex — Chunk size evaluation Data-driven chunk size selection — don't guess.
7 Scaling RAG — DevOps & Infrastructure Production
Production RAG separates write path (ingestion queue) from read path (query gateway → cache → vector DB → rerank → LLM). Scale each layer independently once you pass ~500–1000 QPS.
| Layer | Production pattern | Deep resource |
|---|---|---|
| Ingestion | Kafka/Redis Streams/SQS → idempotent workers; content-hash point IDs | Scalable RAG — 10K+ QPS design |
| Vector DB | One collection + tenant_id filter; shard ≥ 2× peers; int8 quant @ 50M+ vectors |
K8s RAG Stack 2026 |
| Embedding service | TEI/vLLM on GPU; batch ingest, real-time query; horizontal scale | Enterprise RAG architecture |
| Query cache | Redis: embed cache + retrieval result cache; biggest p95 win | p95 <200ms RAG engineering |
| LLM gateway | LiteLLM proxy; circuit breakers; rate limits per tenant | GCP RAG on Vertex AI |
| Agentic loops | recursion_limit, max iterations, cost caps, stuck-loop detection |
Self-correcting loops guide |
| Observability | Langfuse/LangSmith traces per retrieval hop; OTel GenAI conventions | Langfuse agent observability |
| Semantic cache | Redis LangCache / embed-similarity cache for repeated queries | Redis semantic caching |
Reference architectures (open source)
- hybrid-rag-system Qdrant + Elasticsearch + Neo4j + CRAG LangGraph + RAGAS dashboard — full production stack walkthrough.
- agentic-RAG template RRF hybrid + GraphRAG global path + HyDE + RAGAS/TruLens/DeepEval eval harnesses; HotpotQA/MuSiQue hooks.
- Graip.AI — Production RAG Agent Platform (paper) 94.5% HotpotQA; modular subgraphs; data preprocessing dominates end-to-end performance.
8 RAG & Agentic RAG Evaluation
Evaluate retrieval and generation separately, then end-to-end. For agentic systems, add trajectory eval — did the agent retrieve the right hops in the right order?
Core metrics
| Metric | What it measures | Production threshold* |
|---|---|---|
| Context precision | Retrieved chunks actually relevant | ≥ 0.70 |
| Context recall | All needed info was retrieved | ≥ 0.80 |
| Faithfulness | Answer grounded in context (no hallucination) | ≥ 0.75 |
| Answer relevancy | Answer addresses the question | ≥ 0.80 |
| Trajectory adherence | Agent took correct retrieval steps | Domain-specific rubric |
*Starting thresholds — calibrate on your domain with human-labeled examples.
Evaluation stack (2026 consensus)
| Tool | Role | Link |
|---|---|---|
| RAGAS | Offline dataset experiments; reference-free RAG metrics | docs.ragas.io |
| DeepEval | Pytest-native CI gates; agent + RAG metrics | deepeval.com |
| LangSmith | Trace → dataset; multi-turn + trajectory evals | LangSmith evals |
| Arize Phoenix | OTel traces + embedding drift + eval harness | Phoenix docs |
| Braintrust | Experiment-driven; scorer library; CI integration | Braintrust evals |
| TruLens | Production RAG triad: context relevance, groundedness, answer relevance | trulens.org |
- Trajectory vs Output Evaluation Why final-answer scoring misses 20–40% of agent failures.
- RAGAS + DeepEval + TruLens stack guide RAGAS for experiments, DeepEval for CI, TruLens for production monitoring.
- FinanceBench Financial doc QA benchmark — PageIndex/GraphRAG eval standard.
- RAGBench — 100k examples Large-scale RAG evaluation dataset across domains.
9 Frontier Papers Read selectively
| Paper | Link | Why it matters |
|---|---|---|
| Agentic RAG Survey | arxiv.org/abs/2501.09136 | Definitive 2025 taxonomy of agentic retrieval systems. |
| Self-RAG | arxiv.org/abs/2310.11511 | Reflection tokens for retrieve/grade/generate decisions. |
| CRAG | arxiv.org/abs/2401.15884 | Corrective retrieval with web fallback. |
| GraphRAG (Microsoft) | arxiv.org/abs/2404.16130 | Global corpus reasoning via knowledge graphs. |
| IRCoT | arxiv.org/abs/2212.10509 | Interleaved retrieval + chain-of-thought for multihop. |
| ColPali | arxiv.org/abs/2407.01449 | Vision-first document retrieval. |
| Contextual Retrieval | Anthropic | Chunk contextualization — production must-have. |
| Modular RAG | arxiv.org/abs/2407.21078 | Composable retrieval modules framework. |
10 Conceptual Videos Architecture talks
| Video | Link | Focus |
|---|---|---|
| Adding Agentic Layers to RAG — Jerry Liu | YouTube | Why naive RAG fails; routing, query planning, agentic loops over data. |
| Agentic RAG with Knowledge Graphs — Neo4j | YouTube | GraphRAG + agentic automation; MCP; multi-hop entity reasoning. |
| Stanford CS230 — Agents, Prompts & RAG | YouTube | Full lecture: RAG → agentic workflows → multihop → eval. |
| Top 3 RAG Evaluation Frameworks | YouTube | RAGAS vs DeepEval vs Opik — metric concepts explained. |
| Agentic GraphRAG — KGC 2025 | KGC 2025 | Combining vector + graph retrieval in agent architectures. |
| Microsoft GraphRAG — Architecture Deep Dive | YouTube | Indexing pipeline, community detection, global vs local search modes. |
| Building Production RAG — Anthropic Contextual Retrieval | YouTube | Chunk contextualization architecture; hybrid + rerank production stack. |
| ColPali — Visual Document RAG Explained | YouTube | Why page-as-image beats OCR for infographics and financial tables. |
| LangGraph Agentic RAG — Official Walkthrough | YouTube | 5-node StateGraph: grade → rewrite → generate loop in production terms. |
11 Courses & Tutorials Hands-on
| Resource | Link | Focus |
|---|---|---|
| LangGraph Agentic RAG (official) | LangGraph docs | Canonical grade → rewrite → generate loop. |
| Building Agentic RAG with LlamaIndex | DeepLearning.AI — Jerry Liu | Router → tool calling → multi-step research agent → multi-doc. |
| HF Agents — Agentic RAG unit | HF Agents Course Unit 3 | Cross-framework agentic RAG exercises. |
| CRAG / Self-RAG / Adaptive (local) | LangGraph RAG tutorials hub | All three pattern implementations with local LLMs. |
| Microsoft GraphRAG | GraphRAG get started | Index pipeline + global/local/DRIFT search modes. |
| ColPali multimodal RAG | Microsoft ColPali repo | Production visual document retrieval architecture. |
| PageIndex agentic vectorless RAG | PageIndex GitHub | Tree-index navigation without vector DB. |
| Adaptive/Corrective/Modular RAG | LangGraph pattern guide | Side-by-side architecture comparison. |
| hybrid-rag-system (full stack) | GitHub | Qdrant + ES + Neo4j + CRAG + RAGAS dashboard — clone and study. |
| agentic-RAG template | GitHub | RRF + GraphRAG + HyDE + multihop datasets + eval CI. |
12 Production Checklist
- Baseline 2-step RAG with hybrid + rerank hitting Recall@10 ≥ 0.85 on golden set
- Contextual chunks or parent-child indexing for your doc types
- LangGraph agentic loop with
recursion_limitand max rewrite attempts (3) - Faithfulness verifier node before returning answer to user
- Async ingestion queue — never block queries during reindex
- Per-tenant isolation via metadata filters, not per-tenant collections
- LangSmith/Langfuse traces on every retrieval hop + tool call
- RAGAS offline eval on every chunking/embedding change
- DeepEval CI gate — faithfulness ≥ threshold blocks merge
- Cost guards — skip agentic path for simple queries (Adaptive RAG router)
13 When to Use Agentic RAG
| Scenario | Pattern | Why |
|---|---|---|
| Internal docs chatbot, fixed corpus | 2-step RAG + hybrid + rerank | Simpler, faster, cheaper — agentic is overkill |
| Mixed queries (some need docs, some don't) | Adaptive RAG | Router skips retrieval when unnecessary |
| Multihop research / compare entities | Agentic + IRCoT | Sequential retrieval depends on prior hops |
| Infographics, financial PDFs, slide decks | ColPali / multimodal RAG | OCR pipelines lose layout and tables |
| "What are the main themes?" over corpus | GraphRAG global search | Vector RAG fails on holistic questions |
| Long structured reports (SEC, legal) | PageIndex or RAPTOR | Tree navigation beats flat chunking |
| High-stakes compliance / medical | Self-RAG + CRAG | Grading loops reduce hallucination 30–60% |
| Latency-sensitive chat (<2s) | 2-step RAG | Agentic adds 2–5+ LLM calls per query |
| Entity-relationship queries | Agentic GraphRAG | Graph traversal + vector hybrid |
14 8-Week Agentic RAG Mastery Plan
| Week | Focus | Deliverable |
|---|---|---|
| 1 | RAG tab phases 1–3 + contextual retrieval | Hybrid + rerank baseline with RAGAS scores |
| 2 | LangGraph canonical agentic RAG | 5-node graph with grade → rewrite loop |
| 3 | CRAG or Self-RAG tutorial | Web fallback or reflection grading |
| 4 | Multihop — IRCoT or query decomposition | Multihop golden set with trajectory eval |
| 5 | Adaptive RAG router | Simple vs complex query paths; cost comparison |
| 6 | Multimodal OR GraphRAG (pick one) | ColPali demo OR GraphRAG on small corpus |
| 7 | Scaling — async ingestion + observability | Queue pipeline + Langfuse traces per hop |
| 8 | Production eval harness | RAGAS experiments + DeepEval CI gate + deploy |