Skip to content
← All concepts
Concept

Chunking

Splitting long documents into smaller units for embedding and retrieval.

Why chunking strategy matters more than chunk size

The chunk is the unit of retrieval, so where you cut decides what can be found.

Simple explanation

LLMs and embedding models have input limits. Chunking breaks documents into smaller pieces so each can be embedded and retrieved independently. Good chunking preserves context; bad chunking splits concepts across boundaries.

Engineering explanation

Chunking strategies: fixed-size (simple, loses structure), recursive (splits on headers then size), semantic (groups by meaning), section-aware (uses document structure). A common starting point is 512 tokens with 64 overlap; tune it against your own retrieval evals. Chunk size trades off precision (small) vs recall (large). Overlap bridges concepts across boundaries.

Example

A 50-page policy document → 200 chunks of ~512 tokens each, each with metadata (source, section, permission_group).

When to use it

Always, in RAG. The chunk is the unit of retrieval — it defines what 'similar' means.

Common misconception

Chunking is NOT just 'splitting text'. The strategy (section-aware, semantic) matters more than the size. Poor chunking is one of the most common causes of bad RAG.