What is chunking?
Chunking is splitting a long document into smaller passages, or chunks, before indexing it for search or retrieval-augmented generation. Each chunk is embedded and retrieved on its own, so chunk size is a trade-off: too small and a passage loses its context, too large and it mixes topics and wastes the model’s context window.
Good chunkers follow the document’s structure, such as sections and paragraphs, instead of cutting at a fixed number of characters.
Keeping each chunk’s page and position lets an answer cite exactly where its text came from.