AI Engineering · interactive
Chunking strategies
Before retrieval can work, documents are cut into chunks, and the model only ever sees the chunks that come back. Cut in the wrong place and the answer is split in half. Try three ways to cut the same help page.
4 chunks · 725 characters stored
Answer cut in half
chunk 1 · chars 0–2002 words matched (5×) · retrieved
# Acme Store help ## Refunds You can ask for a refund within 30 days of delivery. Refunds go back to the original payment method. Once approved, a refund takes 5 to 7 business days to show up on your
chunk 2 · chars 200–4001 words matched
statement. Gift cards are refunded as store credit. ## Shipping Standard shipping takes 3 to 5 business days. Express shipping arrives the next business day if you order before 2 pm. We ship to the
chunk 3 · chars 400–6000 words matched
US, Canada and the UK. ## Damaged items If an item arrives damaged, send us a photo within 48 hours. We will send a replacement at no cost, and you do not need to return the damaged item. ## Account
chunk 4 · chars 600–7250 words matched
You can change your email address in Settings. To delete your account, contact support. Deletion is permanent after 14 days.
Fixed size: the answer sits across a chunk boundary. The model only gets part of it, so it may guess the rest.
Question
Strategy
Chunk size (characters)
1 2 3 4 An answer cut across two chunks reaches the model only partly. Bigger or overlapping chunks fix that, but every extra character is more to read and pay for.
Answer cut in half. 136 characters of other text came along with it.
- Fixed size (200)1 of 3 answered whole
- Fixed size + overlap (200)2 of 3 answered whole
- By heading3 of 3 answered whole
In production
Tools and technologies
Every RAG pipeline has a splitter; most offer the same three choices: size, overlap and structure.
Not tied to one language — use these names when you search docs or design a system.
- LangChain text splittersSoftware
Character, recursive, Markdown-header and token splitters.
Documentation ↗ - LlamaIndex node parsersSoftware
Sentence, semantic and hierarchical chunking.
Official site ↗ - UnstructuredSoftware
Parse PDFs, slides and HTML into titled elements before chunking.
GitHub ↗ - ChonkieSoftware
A small chunking library with token, sentence and semantic chunkers.
GitHub ↗