Chunking
Definition
Chunking is splitting documents into smaller passages before they are embedded and stored for retrieval, so a search can return just the relevant part. Chunk size, where the splits fall and how much neighboring chunks overlap all affect how well RAG finds answers.
Choices that matter
- SizeToo small loses context; too large dilutes the match and costs more.
- BoundariesSplit at headings, paragraphs or sentences, not mid-sentence.
- OverlapRepeat a little text between neighbors so ideas aren't cut in half.
- ContextAdd the document or section title so each chunk makes sense alone.