MODERN AI SYSTEMS
Retrieval-Augmented Generation
Learn how AI systems connect language models to external knowledge, from document ingestion and chunking through retrieval, context construction, citations and production architecture.
RAG Learning Path
Work through the modules in order. Each one builds toward a complete mental model for designing, evaluating and operating RAG systems.
Why RAG Exists
The realistic problem RAG was built to solve: what happens when an LLM needs to answer questions about information it was never trained on โ private, current, or enterprise-specific knowledge.
The Fundamental RAG Idea
Formalizing the without-RAG vs. with-RAG mental model as the foundation for this entire course, and precisely distinguishing what RAG is and is not.
RAG vs. Prompt Engineering vs. Fine-Tuning
A direct comparison of what each approach actually changes about a model's behavior, and a practical framework for choosing between them โ or combining them.
The Complete RAG Pipeline
The full, canonical RAG architecture: the offline/indexing pipeline that prepares knowledge, and the online/query pipeline that answers questions โ why RAG really has two distinct phases.
Documents & Ingestion
What exactly gets loaded into a RAG system, why metadata captured at ingestion time matters for everything downstream, and the wide variety of real-world data sources RAG must handle.
Document Parsing
Why extracting usable text from real documents is really harder than it looks โ tables, columns, headers, scanned pages โ and why poor parsing can silently doom an otherwise well-designed RAG pipeline.
Chunking Deep Dive
One of the most important decisions in a RAG system: how documents get split into retrievable units. Chunk size, overlap, and every major chunking strategy โ each with full, runnable code.
Structure-Aware & Semantic Chunking
Moving beyond structural signals like paragraphs and sentences to really meaning-aware chunking โ using document headings and detecting where topics actually change.
Chunk Metadata
What a chunk needs to carry beyond its raw text โ and why treating a chunk as 'just a string' quietly breaks filtering, citations, and access control later, closing out Level 2.
Embeddings in the Context of RAG
How chunks actually become searchable by meaning rather than exact words โ building directly on your LLM course's embedding foundations, applied specifically to retrieval.
Vector Space & Similarity
The mathematical comparison tools that turn 'close vectors' into an actual, computable ranking โ cosine similarity, dot product, and Euclidean distance, with intuition before formulas.
Vector Databases
Why storing and searching millions of embedding vectors is a fundamentally different problem than a traditional database's exact-match lookup, and what a vector database actually stores.
Vector Indexing & ANN
The actual solution to brute-force search's scaling problem: approximate nearest neighbor search, and why trading a small amount of accuracy for massive speed gains is usually the right choice.
HNSW and IVF Deep Dive
Two widely used ANN algorithm families, with a step-by-step walkthrough of how insertion works across their internal structures โ layer by layer for HNSW, cell by cell for IVF.
Top-K and Metadata Filtering
How many results to actually retrieve, and how to combine vector similarity search with metadata filters like access control and department, using Module 9's structured chunks.
BM25 and Sparse Retrieval
A really different retrieval approach from everything covered in Level 3: exact keyword matching, and when it outperforms semantic search entirely.
Dense vs. Sparse vs. Hybrid Retrieval
Combining Module 16's BM25 with Level 3's semantic search into one, really more robust retrieval system โ and how to merge two fundamentally different scoring systems fairly.
Two-Stage Retrieval & Reranking
Adding a second, more precise ranking stage on top of hybrid retrieval's initial candidate set โ the recall-first, precision-second mental model, closing out Level 4.
Query Transformation
User questions aren't always ideal search queries โ rewriting, expanding, and normalizing them before retrieval even happens, starting Level 5: Retrieval Quality.
Multi-Query & Query Decomposition
Extending query transformation to really complex questions requiring multiple separate searches โ when one question actually needs to become several.
Context Construction & Lost-in-the-Middle
Retrieval gives you chunks, but you can't blindly hand them all to the LLM โ organizing, deduplicating, and ordering retrieved context effectively, and why more context isn't always better.
Prompt Construction for RAG
Closing Level 5: assembling the final prompt from constructed context, system instructions, and the user's question, directly connecting to the Prompt Engineering course's foundations.
Grounded Generation & Citations
What it actually means for an answer to be grounded, and how to attach real, verifiable citations to generated responses โ starting Level 6: Grounded Generation & Trust.
RAG Failure Modes
A complete, end-to-end diagram of every point in the pipeline where things can really go wrong, from ingestion through generation โ and why a good LLM can't compensate for bad retrieval.
Hallucination in RAG & Conflicting Documents
Going deeper into the generation-stage failure Module 24's diagnostic process points toward, and the practical problem of multiple documents disagreeing with each other.
Document Versioning & Freshness
How a knowledge base should manage document updates over time, preventing the conflicts and outdated answers covered in Module 25 from arising in the first place.
RAG Security & Access Control
Closing Level 6: the real security requirements around retrieval, including enforcing permissions before content reaches a model and defending against prompt injection via retrieved documents.
Naive vs. Advanced RAG
The evolution from basic retrieve-then-generate toward Self-RAG and Corrective RAG architectures that reason about their own retrieval quality โ starting Level 7: Advanced RAG Architectures.
Agentic RAG & Graph RAG
Taking Self-RAG and Corrective RAG's reasoning further into really autonomous, multi-step retrieval, and introducing graph-based retrieval for relationship-heavy questions vector similarity cannot answer.
RAG with Structured Data & Tables
Recognizing when the right answer to 'where should this data live' is a SQL database, not a vector store at all โ and handling tables really well when they must live in RAG.
Multimodal RAG
Closing Level 7: extending retrieval beyond generic text to PDFs, web content, and code repositories โ each with really distinct handling requirements, unified through Module 5's loader pattern.
RAG Evaluation
How to systematically measure retrieval quality and generation quality SEPARATELY, closing in on the final production-readiness modules โ starting Level 8: Production RAG.
Production RAG
The final module of this course: observability, cost, latency, caching, the complete decision framework, common mistakes, case studies, and the final, unified mental model for everything RAG.
WHY RAG?
Build answers on evidence, not memory alone
RAG systems retrieve relevant source material at request time and place it in the model's context. That makes it possible to work with private, current and domain-specific knowledge without retraining the language model for every document change.