AI glossary
Chunking
Chunking is cutting long documents into smaller passages before embedding them, so a search can return just the part that answers a question.
A whole manual has one embedding that means "everything", which matches nothing well. Cut into passages of a few hundred tokens, each chunk can match the question it answers.
Chunks can be cut by size, with some overlap so a sentence is not split from its context, or by structure: headings, paragraphs or functions in code.
Too small and a chunk loses the context that gives it meaning; too large and it carries noise into the prompt. Chunk size is a setting to test, not to guess.
Learn it hands-on
These free lessons teach it with commands to run in a lab and checked tasks. Read them whole with no account.