intermediate~3h

5 Chunking Strategies for RAG

Fixed-size, Semantic, Recursive, Document-structure-based, and LLM-based chunking — five distinct ways to split documents for RAG, each with different tradeoffs.

5 Chunking Strategies for RAG

How you split source documents directly determines retrieval quality — a chunk boundary that cuts through meaning is a chunk that will retrieve poorly.

How it splitsBest for
Fixed-sizeEqual-length blocks with a small overlap between adjacent chunksSimple, predictable pipelines; not sensitive to cutting mid-sentence
SemanticBoundaries placed exactly where cosine-similarity between sentences drops sharply (topic shifts)Content where topical coherence matters more than uniform size
RecursiveTwo-level cut — paragraph breaks first, then a second cut inside any paragraph still too largeGeneral-purpose documents with mixed structure
Document-structureSplits strictly along the document's own heading/section markersWell-formatted docs (manuals, reports) where structure = meaning
LLM-basedAn LLM judges where a 'semantically isolated and meaningful' unit endsHighest-quality boundaries when the extra LLM call cost is acceptable
5
Subtopics
1
Exercises
1
Projects
5
Quiz Qs
4
Flashcards
📚 Prerequisites(1)

🎓 Learning objectives

  • Implement and compare fixed-size, semantic, recursive, document-structure-based, and LLM-based chunking
  • Explain why chunk overlap matters for fixed-size chunking
  • Choose the right chunking strategy given content type, embedding model, and compute budget
  • Identify the specific failure mode each chunking strategy is prone to

5 Chunking Strategies for RAG is a Pro topic

Sign in, then upgrade to Pro or Power to unlock this topic and the full AI Engineering curriculum.

📂 Subtopics