RAG Explained: From BM25 to Agentic RAG | Stanford CS329Z Lecture 3 with Diyi Yang
From Stanford Online · · 1 hr 16 min

The player loads from YouTube only when you click. It uses YouTube's privacy-enhanced mode.
If the video does not play, the owner may have turned off embedding. Watch it on YouTube instead.
Description
Browse Stanford's online courses in Agentic AI: https://stanford.io/4AIRb2z
Self-paced online Agentic AI course: https://online.stanford.edu/programs/agentic-ai?utm_source=youtube&utm_medium=social&utm_content=cs329z-01-what-are-agentic-systems
Lecture Overview: How does retrieval-augmented generation (RAG) work, and do frontier models still need it? In this Stanford CS329Z: Engineering AI Agents lecture, Stanford professor Diyi Yang walks through the full RAG pipeline: chunking and contextual retrieval, RAPTOR and GraphRAG, vector search with HNSW, BM25 vs. dense retrieval (DPR), hybrid search, rerankers and ColBERT, and agentic RAG methods like Self-RAG, CRAG, and Search-R1.
Speaker: Diyi Yang
Diyi Yang is an assistant professor in the Computer Science Department at Stanford University, also affiliated with the Stanford NLP Group, Stanford HCI Group and Stanford Human Centered AI Institute. Her research focuses on human-centered LLMs and human-AI interaction. She is a recipient of IEEE “AI 10 to Watch” (2020), Microsoft Research Faculty Fellowship (2021), NSF CAREER Award (2022), and a Sloan Research Fellowship (2024).
Chapters: 0:00 Introduction & course project guidelines 5:53 Why RAG? Grounding answers in evidence 8:55 From retriever-reader QA to RAG 20:22 Q&A: do frontier models still need RAG? 23:28 Indexing: embeddings & chunking strategies 29:25 Contextual retrieval & late chunking 36:27 Hierarchical & graph RAG: RAPTOR, GraphRAG 40:25 Q&A: GraphRAG & compounding errors 45:14 Vector search: ANN & HNSW 48:42 BM25 vs. dense retrieval (DPR) 55:42 Retrieval metrics & hybrid search 1:02:34 Bi-encoders, cross-encoders & ColBERT 1:08:18 Agentic RAG: Self-RAG, CRAG, Search-R1 1:14:29 RAG failure modes
Course website: https://cs329z.stanford.edu/
Watch the full CS329Z playlist: https://youtube.com/playlist?list=PLPRcF5HR02_U&si=3Z4OYphngcmQ0GIy
Recorded 9/30/2026 in CS329Z: Engineering AI Agents, a graduate course at Stanford University taught by Diyi Yang, Michael Ryan, and John Yang.
#RAG #AIAgents #Stanford