Chunking
Chunking is the preprocessing step that splits long documents into smaller pieces suited to embedding and retrieval. In vector-based RAG, documents may be divided by paragraph, sentence, structure, or token count, and the chunks are embedded for retrieval. Short documents may not need splitting.[2] Chunks that are too large mix in unrelated content, and chunks that are too small lose surrounding context. Chunk size, overlap, and boundary rules strongly affect retrieval quality, which makes chunking one of the first things to tune in a RAG system.[2][3]