Lesson 05.02 · Phase 05 · Retrieval & Agentic RAG

Chunking strategies

Where you cut a document decides which facts can ever be found whole. Cut on meaning, not on character counts, and tell every chunk where it came from.

Learning objectives

  • Implement five chunkers: fixed-size, fixed-size with overlap, sentence packing, Markdown sections, and sections prefixed with their heading path.
  • Measure a chunker with two numbers: how many facts survive intact in some chunk, and how many questions retrieve a chunk containing the whole fact.
  • Explain why overlap keeps facts intact but can hurt retrieval, and why heading paths help short sections get found.
  • Choose a chunk size and strategy for a corpus from measurements, not defaults.

In Lesson 1, the answer to "who is the deputy?" came back as "Luis Fe". The retriever found the right chunk. The chunker had cut the name in half.

Loading the full lesson…