Trail 03 · 12 lessons · 9 on video
RAG and context
Give the model the right information at the right time: embeddings, retrieval, hybrid search, reranking, chunking, and long conversations that do not rot.
- 01Fundamental▶ 8 minEmbeddingsText turned into vectors: what similarity captures and where it misleads.
- 02Pattern▶ 9 minRetrieval-Augmented Generation (RAG)Fetch relevant passages and hand them to the model along with the question.
- 03Smell▶ 8 minRAG for Small DataA vector search pipeline for 20 pages that fit entirely in the context.
- 04Refactoring▶ 8 minReplace RAG with Direct ContextWhen the material fits in the window, send it whole and use prompt caching.
- 05Pattern▶ 8 minContextual ChunkingSplit documents along their structure and attach to each chunk the context it came from.
- 06PatternHybrid SearchCombine keyword and vector search so you miss neither synonyms nor exact codes.
- 07PatternRerankingRetrieve many candidates and use a sharper model to pick the best ones.
- 08PatternQuery RewritingTurn the user's question into one or more better searches.
- 09Smell▶ 8 minContext RotA long session drags old history that confuses the model and makes every turn pricier.
- 10Refactoring▶ 9 minReplace History with SummaryReplace old turns with a summary and with facts stored outside the context.
- 11Pattern▶ 8 minContext CompactionSummarize or prune the context as it grows, keeping what matters.
- 12Real-world scenario▶ 9 minInternal knowledge base chatAnswer employee questions from wikis, policies, and manuals.
- Final projectLangGraph LabInternal knowledge chatA chat that answers company questions with the source, without leaking what it should not.