loading
loading
Splitting documents into smaller pieces before embedding them, so retrieval returns a relevant passage instead of a whole file.
You can't embed a 50-page PDF as one vector — the meaning gets averaged into mush and you'd stuff the whole thing into context anyway. So you cut it into chunks (say 300-800 tokens) with a bit of overlap, embed each one, and retrieve only the chunks that match the query. Chunk too big and retrieval is imprecise; too small and you lose the surrounding context a chunk needs to make sense. Good chunking respects structure — split on headings, paragraphs, or code blocks, not blindly every N characters.
Plainly
Think of Chunking as a simple recipe for doing the work better. Splitting documents into smaller pieces before embedding them, so retrieval returns a relevant passage instead of a whole file.
In practice
Use it when you need a repeatable method instead of guessing from vibes. In practice, define the owner, input, output, and failure mode before you rely on it.