Glossary · data

Chunking

Splitting source documents into pieces that a retrieval system can search and return, cut along headings and sections rather than fixed character counts.

Chunking is the step that cuts source documents into pieces before they are indexed for retrieval. Each piece becomes a unit the system can find and hand to a model. The size and the cut points decide what the model can see, so chunking is one of the most important and least visible choices in a retrieval system.

A poor chunk loses meaning. A clause split from its definition, or a table cut in half, gives the model an answer that looks right and is wrong.

In practice

I cut along the document's own structure first: headings, sections, numbered clauses, table rows. Only then do I apply a size limit, and when I do, I keep a small overlap between neighbouring chunks so that a sentence at a boundary is not lost. Each chunk keeps its heading path, so the model and the reader can see where it came from.

I test chunking with questions whose answers sit across a boundary. If the system cannot answer them, the chunks are wrong, however good the model is.

Example

[Composite] A policy library was split every 500 characters. Answers about exceptions were often wrong, because the exception sat in the next chunk without its rule. Cutting along clause numbers, and returning the clause heading with each chunk, made the same questions answerable without changing the model.

Common mistakes

  • Using fixed character counts for every document type. Contracts, manuals and tables need different cuts.
  • Dropping the heading path, so a chunk arrives without its context.
  • Tuning chunk size without a set of questions that cross boundaries to test it.

Related terms

Cite this definition

Chunking. Mayur Patil, mayurpatil.ai, updated 2026-11-02. https://mayurpatil.ai/glossary/chunking/

Enquiry

Tell me about the work

The use case, where it is blocked and who is involved. I reply with a suggested starting point. Or email hello@mayurpatil.ai.

Goes to my CRM and my inbox. No newsletter, no sharing. See Privacy (opens in a new tab).

Close