Chunking is splitting long documents into smaller passages before they are embedded and stored, so a RAG system can retrieve just the relevant pieces and pass them to the model.
A model cannot usefully search a 200 page manual in one go, and sending the whole thing with every question is slow and expensive. So the manual is cut into chunks, each chunk is turned into an embedding and stored, and at question time only the few most relevant chunks are fetched. For example, a returns policy might be split so that the section on refunds for damaged items is its own chunk, which can then be found directly when a customer asks about a broken product.
The common strategies are fixed size chunks, often a few hundred tokens with some overlap between neighbours so a sentence is not cut in half; structure based chunks that follow headings, paragraphs or table boundaries; and semantic chunking, which splits where the topic changes. There is no single best chunk size. Small chunks are precise but can lose the surrounding context, while large ones keep context but dilute the match. A few hundred tokens is a common starting point, tuned from there by testing retrieval on real questions.
A chunk that has lost its context is the most common failure, such as a passage that says revenue grew 3 percent without saying which company or quarter. Anthropic found that adding a short explanation of where each chunk sits in its document, a method it calls contextual retrieval, reduced failed retrievals by 49 percent, and by 67 percent when combined with reranking. Good chunking is unglamorous, and it matters more to answer quality in a RAG system than the choice of model.
Saraswati Stitch®