from first concept to confident practice
Retrieval-Augmented Generation (RAG)
Connect language models to useful, traceable evidence.
About this track
Language models don’t know your documents, and they don’t know what changed yesterday. Retrieval-augmented generation fixes that: find the right passages first, then answer from them - with citations.
You’ll chunk documents, build keyword search with BM25 and semantic search with embeddings, fuse them, rerank, write grounded prompts that cite and abstain, evaluate retrieval and answers, and defend against leaks and prompt injection. Along the way you’ll slice documents in a chunk explorer, tune BM25, search an embedding map, score retrievers and hunt for unsupported claims. Every lesson ends with Python that runs in your browser, and the capstone builds a small RAG pipeline from scratch.
- No prior RAG experience needed.
- Basic Python helps; examples introduce the code as you go.
- A modern browser with JavaScript enabled.
Your path
0 of 11 lessons · 0%Restoring your progress…
- Unit 1 · 0/2 lessons
RAG foundations
Trace the pipeline, choose when to use RAG, and prepare a clean, well-chunked corpus. Badge: Corpus curator
- 0x001Understand the RAG pipelineSee why models need retrieval, trace a question through the pipeline, and know when RAG is the right tool. 20 min 0/2 exercises solved 20 min 0/2 exercises solved
- 0x102Prepare and chunk source documentsClean documents, split them into retrievable chunks, and keep the context and metadata each chunk needs. 22 min 0/2 exercises solved 22 min 0/2 exercises solved
- Unit 2 · 0/4 lessons
Retrieval systems
Search by keywords and by meaning, fuse and filter results, and rerank candidates. Badge: Evidence finder
- 0x203Search by keywords with BM25Build an inverted index and rank passages with BM25, the workhorse of keyword search. 22 min 0/2 exercises solved 22 min 0/2 exercises solved
- 0x304Represent meaning for retrievalTurn text into vectors, search by similarity, and see how vector indexes trade accuracy for speed. 24 min 0/2 exercises solved 24 min 0/2 exercises solved
- 0x405Combine keyword and vector searchFuse keyword and semantic rankings, and filter by metadata and permissions the right way. 20 min 0/2 exercises solved 20 min 0/2 exercises solved
- 0x506Retrieve, filter, and rerank evidenceCast a wide net, then reorder candidates with a cross-encoder and keep the set diverse. 20 min 0/2 exercises solved 20 min 0/2 exercises solved
- Unit 3 · 0/3 lessons
Grounding, evaluation and security
Generate cited answers, measure quality, and protect the data path. Badge: Grounded guide
- 0x607Generate answers grounded in sourcesBuild the prompt, order the context, demand citations, and let the model say “I don’t know”. 22 min 0/2 exercises solved 22 min 0/2 exercises solved
- 0x708Evaluate a RAG systemBuild a test set, measure retrieval and answers separately, and catch regressions before users do. 24 min 0/2 exercises solved 24 min 0/2 exercises solved
- 0x809Secure a RAG systemStop data leaks across users, defuse instructions hidden in documents, and handle outputs safely. 22 min 0/2 exercises solved 22 min 0/2 exercises solved
- Unit 4 · 0/2 lessons
Advanced patterns and capstone
Rewrite and expand queries, hop across documents, and build a RAG pipeline end to end. Badge: RAG engineer
- 0x9010Advanced RAG patternsRewrite queries, hop across documents, let an agent decide when to search, and know when not to use RAG. 22 min 0/2 exercises solved 22 min 0/2 exercises solved
- 0xA011Capstone: build a RAG pipelineChunk, index, retrieve and answer with citations - and abstain when the sources don’t cover the question. 35 min 0/2 exercises solved 35 min 0/2 exercises solved