Phase 1 · Building with LLMs · Context & retrieval
Chunking documents
Split long documents so the right piece can be retrieved.
Open this lesson Create a free account
Why it matters
A 40-page brand book or a year of campaign reports can't be searched well as one blob: its single embedding is a blurry average of every topic in it. Chunking, cutting documents into passages before you embed them, decides what your search can find. Good chunks make retrieval precise; bad chunks cut facts in half. It's unglamorous and it's where most RAG quality is won.
What you'll be able to do
- Explain why long documents are split into chunks before embedding
- Split text into fixed-size chunks with overlap
- Split text along paragraphs, merging small ones
- Keep each chunk's source and position so answers can cite it
Before this lesson
Next in this phase: Vector databases