Syllabus
This course teaches you to build, evaluate, and harden a production-grade Retrieval-Augmented Generation system from first principles. A large language model's knowledge is frozen at its training cutoff, it can't see your private documents, and it will confidently fabricate an answer rather than admit a gap. RAG is the engineering pattern that fixes all three by retrieving the right facts at query time and putting them in front of the model. You will start with nothing assumed about RAG and finish having shipped a system that ingests a real corpus, retrieves with hybrid search and reranking, generates grounded and cited answers, and is measured by a real evaluation harness. This is a hands-on engineering course, not a survey: every concept is built up from the original papers and exercised in runnable code.
What you'll be able to do
By the end of this course you will be able to:
- Explain the retrieve-then-read architecture and the distinction between a model's parametric (in-weights) and non-parametric (in-index) knowledge, and articulate exactly which failure each half addresses.
- Build the full RAG pipeline yourself — chunk a corpus, embed it, store the vectors, run top- similarity search, and write a generation prompt that grounds the answer in retrieved text.
- Choose an embedding model deliberately using benchmark evidence, tune a vector index for your recall/latency budget, and fine-tune a retriever when off-the-shelf embeddings underperform.
- Raise retrieval quality with contextual chunking, rerankers, and query transformation (HyDE, multi-query, rewriting).
- Recognize when naive RAG has plateaued and reach for the right advanced pattern — Self-RAG, Corrective RAG, GraphRAG, or routing between long context and retrieval.
- Extend retrieval beyond plain text to images, tables, and PDF layout.
- Measure a RAG system rigorously: retrieval metrics (recall@k, MRR, nDCG) and generation metrics (faithfulness, answer relevancy, context precision/recall).
- Operate RAG in production — manage latency, caching, and index freshness — and defend it against indirect prompt injection through poisoned documents.
Prerequisites
This course is self-contained — no prior RAG knowledge is assumed, and no other LearnOS course is required. You should be comfortable with:
- Python — you can read and write functions, loops, and list/dict comprehensions. Code examples and runnable exercises are in Python.
- Calling an LLM API — you've sent a prompt to a model like GPT or Claude and gotten a completion back. You do not need to understand transformer internals.
A little linear-algebra vocabulary (vectors, dot products) helps but is reintroduced where it's used.
The roadmap
The course is a straight build: foundations first, then each module sharpens one stage of the pipeline, and the capstone ties everything together. Module 01 unlocks everything; the middle modules can be studied in order or dipped into once foundations are solid.
| # | Module | What it covers | Lessons |
|---|---|---|---|
| 01 | RAG Foundations | Parametric vs. non-parametric memory; the full pipeline; ANN + hybrid search; failure modes | 4 |
| 02 | Embeddings & Indexing, deeper | Choosing models (MTEB), index internals & knobs, fine-tuning retrievers | 3 |
| 03 | Advanced Chunking & Retrieval Quality | Contextual retrieval, reranking, query transformation | 3 |
| 04 | Advanced & Agentic RAG | Self-RAG, Corrective RAG, GraphRAG, long-context vs. RAG | 3 |
| 05 | Multimodal RAG | Retrieval over images, tables, and PDF layout | 1 |
| 06 | Evaluation & Grounding | Citation/attribution, retrieval metrics, RAGAS | 3 |
| 07 | Production & Capstone | Latency/caching/freshness, prompt-injection security, capstone build | 3 |
Time commitment
About 13–16 hours of focused work across 20 lessons. A sustainable cadence is one module per week over seven weeks, doing the runnable exercises rather than only reading them. If you're cramming for a project, Module 01 alone (≈2 hours) is enough to stand up a working prototype; the remaining modules turn that prototype into something you'd trust in production.
How to study in LearnOS
Read actively, not passively. The single highest-leverage habit is retrieval practice — testing yourself instead of re-reading — and spacing that practice out over days rather than massing it in one sitting; the distributed-practice effect is one of the most robust findings in the learning-science literature (Cepeda et al., 2006). LearnOS is built around this:
- Run the code. Every foundations lesson has a runnable Python block. Edit the inputs and predict the output before you hit Run — that prediction is the retrieval practice.
- Use the flashcards. LearnOS schedules cards with the SM-2 spaced-repetition algorithm (Wozniak, 1990), which expands the interval between reviews as you get an item right. Review daily; it's minutes a day and it's what makes the material stick.
- Chat with the lesson when something doesn't click — ask for a worked example or a re-explanation, and it answers grounded in that lesson's text.
- Take notes and highlight the load-bearing claims; they become searchable and feed your review sessions.
- Build the projects. Each module's exercises accumulate toward the capstone — don't skip them.
The capstone
You will ship an end-to-end RAG system over a corpus you choose (your own documents, a documentation set, a paper collection). It must: ingest and chunk the corpus with a contextual strategy, retrieve with hybrid dense + keyword search and a reranker, generate answers that are grounded in and cite their sources, decline gracefully when the corpus can't answer, and come with an evaluation harness reporting both retrieval metrics and RAGAS-style generation metrics. This is the portfolio artifact that demonstrates you can do RAG, not just describe it.
What this course omits
To stay focused and standalone, this course deliberately does not cover:
- Transformer and LLM internals — how attention works, training, or fine-tuning the generator. We treat the LLM as an API you call.
- Pretraining or RLHF of language models.
- A vendor framework tutorial. We teach the concepts and build pipelines in plain Python; LangChain/LlamaIndex are referenced as implementations of ideas you'll already understand, not taught as APIs to memorize.
- General information-retrieval theory beyond what RAG needs — we use BM25 and IR metrics, but this is not a full IR course.
- Production MLOps (orchestration, infra-as-code, autoscaling) beyond the RAG-specific concerns of latency, caching, freshness, and security.