How does document chunking work?
The invisible step that decides what retrieval can find. Cut a document well and search feels brilliant; cut it badly and no model can save it.
Chunking cuts a long document into the passages that a search system can find and a model can read at once. A document is indexed in pieces because questions are answered by passages, not by whole books. Each piece is embedded and stored, retrieval surfaces the pieces that match a question, and their boundaries decide whether the model sees a complete thought or a fragment. Good chunking follows the document's own structure.
Why documents are cut at all.
Two limits force the cut. First, a model reads only so much at once, and a two-hundred-page report does not fit; retrieval has to be selective, and selective retrieval needs passages smaller than the whole. Second, precision: a whole document can only be matched as a whole, while a passage can match the exact thought you asked about. The pieces are what embeddings describe, so the piece boundaries are where meaning is either kept or lost, and the passages are also where the model reads best when only a few are placed in front of it. That is why chunking, a step nobody sees, quietly decides how good the whole system feels.
What good boundaries preserve.
The naive approach splits at every thousand characters, and it shows: tables separated from their captions, definitions separated from the terms they define, a sentence that begins a thought filed under the previous one. The better habit is to cut where the document already has structure, at paragraph and section edges, and to let headings travel with their body text. A passage that makes sense read cold is a passage that can be cited cold. When the boundaries are right, the model quotes the passage cleanly; when they are wrong, it hedges, or worse, answers from a fragment with confidence.
The local version.
Chunking is plain text processing, and it happens on your machine: the document is read from disk, split into passages, embedded, and filed into the index that retrieval searches. No upload, no parsing service, no per-page fee. That locality has a quiet benefit: the settings are yours. If a collection of legal depositions needs bigger passages than a stack of abstracts, you can re-chunk and re-embed without asking anyone's permission or paying twice, which is how a private research loop stays tunable as well as private.