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.

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