Chunk Size
Chunk size is the maximum number of characters or tokens in each text chunk, controlling the granularity of retrieval — smaller chunks give precise snippets, larger chunks provide richer context.
What is Chunk Size?
Chunk size is the maximum number of characters or tokens in each text chunk, controlling the granularity of retrieval — smaller chunks give precise snippets, larger chunks provide richer context.
Chunk size is the maximum number of characters or tokens in each text chunk, controlling the granularity of retrieval — smaller chunks give precise snippets, larger chunks provide richer context.
Where is it used?
Typical RAG setups use 256–1024 tokens; OpenAI's file search uses ~800-token chunks; LlamaIndex and Haystack expose chunk size as a tunable parameter that trades recall against noise.
How to build it
Run retrieval with chunk sizes 256, 512, and 1024 on the same corpus, measure recall@5 against a labelled QA set, and pick the size that maximises answer accuracy.