Week 2 (Friday): RAG and Embeddings — grounding in your own data
Make your /ask endpoint answer from your documents, not training data. Running example: Northwind Robotics policy corpus throughout.
10 lessons · Back to full syllabus
Week 2 homework
Extend Week 1 /ask with RAG + POST /ingest
Same Render service as Week 1: add a vector store (Pinecone recommended), an ingest endpoint for new documents, and retrieval-augmented generation on /ask. Test retrieval before you wire the LLM.
What you keep
How to make a model answer from your data instead of its training, and why naive RAG fails — plus Claude Code skills, MCP, and eval habits that make the build repeatable.
You ship
Week 1 /ask extended with a vector store, POST /ingest for new docs, RAG query with citations + refusal, and a golden-set eval on your live Render URL.
Recommended reading (async)
RAG foundations — watch & read (async)
Before or after the live Session 2 deck, these videos and articles give you the industry vocabulary for retrieval, chunking, and production RAG — complementary to the Northwind hands-on work in the lessons below.
Videos
What is Retrieval-Augmented Generation (RAG)?
IBM Technology — plain-English overview of why RAG exists and how it fits together.
Retrieval-Augmented Generation (RAG) Patterns and Best Practices
InfoQ — practitioner patterns for designing RAG systems that hold up beyond demos.
Articles
- What is Retrieval-Augmented Generation (RAG)? — Google CloudEnterprise framing: grounded generation, when to use RAG vs fine-tuning.
- Introduction to LLM RAG — WeaviateDeep dive on RAG architecture, pipelines, and evaluation.
- Building Enterprise AI: Hard-Won Lessons from 1200+ Hours of RAG — ByteVagabondProduction lessons: chunking, hybrid search, and what breaks at scale.
Live session resources
Week 2 live session slides — RAG + Vector Databases
Session 2 deck: why RAG exists, embeddings, chunking, vector DBs, live LangChain build, failure modes, evals, and homework.
Open resourceWeek 2 live session notebook (GitHub)
Hands-on RAG notebook: embeddings, chunking, vector DBs, LangChain Document Q&A build, and evaluation. Clone and run with your OpenAI key.
Open resourceNorthwind Robotics demo corpus (sample_docs)
Four policy documents for live demos and homework: handbook, expenses, security, product spec.
Open resourceLessons
Embeddings intuition
Similar meanings sit close together in vector space — retrieval quality depends on this mental picture.
Build naive RAG, and watch it fail
Embed, store, retrieve, stuff into prompt — then break it instructively on the Northwind corpus.
Chunking
How you split documents decides what retrieval can find — most bad RAG is bad chunking.
Reranking and hybrid search
Reranking reorders candidates by relevance; hybrid search catches exact terms embeddings miss.
RAG evals
Measure retrieval and generation separately — wrong chunks vs right chunks ignored.
Graph RAG
When knowledge has structure and relationships, plain vector RAG leaves value on the table.
Multimodal RAG
Retrieve over images, tables, and diagrams — not just prose.
Claude Code layers — skills, MCP, subagents, and plugins
One reference for which layer does which job: CLAUDE.md, skills, MCP, subagents, hooks, plugins.
Week 2 assignment support: RAG on your Week 1 endpoint
Copy-paste prompts to add POST /ingest, vector store, retrieval-first testing, and RAG on POST /ask.
Week 2 homework: RAG on your Week 1 endpoint
Extend POST /ask with a vector store, POST /ingest for new docs, retrieval-first testing, and a golden-set eval.
Lessons in this module