How should you divide documents into passages?
Part 3 of 7: Start here
Once your application starts selecting passages instead of including whole documents, you need to decide where each passage starts and ends. Those boundaries affect whether the passage that settles a question can be found with enough wording to interpret it. This piece gives you a first setup to try, the settings other tools document, and a way to test whether your boundaries work for your documents.
A passage here is a piece of a document the application stores and can select for a request. Chunking means dividing documents into these passages.
The application does this ahead of time. For each question, it selects passages and builds a request for the model containing them and the question.
An embedding model turns text into numbers used to find similar text. Microsoft’s Azure AI Search guide says these models have input limits and that a document covering many topics may be better represented as several searchable passages.
Keep the wording that makes a passage apply
Take a gym member who asks whether they can cancel four days after joining. The gym’s policy collection is too large for one request. One document requires 30 days’ notice but allows immediate cancellation and a full refund in a table under the heading “Within seven days of joining”.
If the selected refund passage lacks its heading, the request carries no evidence of the seven-day condition. The same wording would also seem to support a refund two months after joining.
Choose how the boundaries are made
Size-based splitting divides text at a chosen length, measured in characters or tokens. Tokens are small pieces of text, often a word or part of a word. Overlap repeats wording across neighbouring passages so a condition can stay beside its rule.
A size-based cut can separate the gym table from its heading. Overlap can keep them together only if the heading falls within the repeated text.
Two documented starting points differ. OpenAI’s file-search API reference documents a default strategy that currently uses passages of at most 800 tokens, with 400 tokens of overlap. Microsoft’s Azure AI Search guide recommends starting with 512 tokens and 25% overlap. Check the unit each tool uses, pick one as a first trial, and judge it with your own questions.
Overlap can increase the number of passages to store and search. In the same guide’s example using an e-book PDF, a 2,000-character limit produced 85 passages without overlap and 113 with 500 characters of overlap. A 5,000-character limit produced 34 and 38.
Other tools cut along the document's own structure. LangChain’s documentation describes a recursive text splitter that tries paragraph breaks, then line breaks, then spaces, then individual characters. The gym table and its heading can still end up apart if they exceed the size limit.
Unstructured’s chunking documentation describes keeping sections separate and isolating each table in its own passage, though oversized tables can still require splitting. With the gym table isolated, check that the request also contains the heading from outside it.
Another approach changes what reaches the request. LlamaIndex’s documentation describes storing sentences with their neighbours, searching each sentence, and replacing a match with the surrounding wording when building the request.
It also describes linking small passages to larger ones they came from. With its auto-merging retriever, it replaces retrieved pieces with the source passage when most of that passage's pieces have been retrieved. For the member’s cancellation question, that larger passage may contain the table and its heading.
Check the text and preserve its source
Start with extraction, the step that pulls text from each file before splitting. One Docling user reported PDF pages silently skipped during extraction, and the lost-pages collection gathers similar reports. Missing pages leave no text to divide.
Another Docling user reported one extracted table with a wrong last row, and said the hybrid chunker then broke it into meaningless values. The tables and layout collection gathers similar reports. Inspect the resulting passages to see whether table headings and values remain connected.
Keep each passage’s source file so readers can check the evidence. Unstructured’s documentation explains that a passage built from several parts of a document can span pages, while those parts retain their individual page numbers. Preserve these so a single page number does not point readers to the wrong page.
Your boundaries can also set how precisely an answer points to its evidence. In Anthropic’s Claude citations documentation, plain text is divided into sentences. When the application supplies its own text blocks as custom content, each block is the smallest unit that can be cited. With that setup, the blocks you create set the finest detail a citation can point to.
Test boundaries against your questions
Two 2026 studies compared boundary methods and found different things.
A 2026 preprint tested 36 methods on plain-text passage finding. Paragraph grouping led overall, but the best method varied by domain. Its tests covered plain text only, with no tables or page layout.
A 2026 study tested four methods on 60 private oil and gas documents. Splitting by headings put the best passage first most often and made the fewest passages. Size-based and recursive splitting scored slightly higher on how many relevant passages came back overall. All four struggled with engineering diagrams, and passage sizes differed by method.
The leading method changed with the domain and the measure, so test the choice on your own documents and questions.
For a few questions whose answers depend on a table, an exception or a heading, record the supporting text. Check that tables retain their headings and values, exceptions retain their conditions, and the selected passages reach the request with their source and page.
One LangChain forum user reported relevant passages returned without necessary details spread elsewhere, and the missing documents and recall collection gathers similar reports.
A practical first setup is a documented size and overlap, headings and tables kept with their passages where your tool allows it, and each passage's source file and page recorded. Then choose a method by checking whether it returns the passage that settles your question together with the wording that makes it apply. For the gym question, finding the refund wording without its seven-day heading still leaves necessary evidence out of the request. The next piece covers which matching passages should reach the model.
Join the waitlist: one email when there is something to try.