Prerequisites
- A completed parse job.
- The structured result for element structure, or the
markdownformat when you want ready-to-index text.
Chunk on section boundaries
Headings mark where one topic ends and the next begins, and their level records the section hierarchy. Walking the elements and starting a new chunk at eachTitle or SectionHeader keeps a section’s content together and splits where the document itself splits. Carrying the current heading path onto each chunk gives every chunk a breadcrumb of where it sits.
Keep tables whole
A table loses its meaning when a fixed-size splitter cuts it in half. Because a table is a single element, you can keep it intact as its own chunk, and pair it with a nearby caption for context. Serializing the grid to Markdown or to rows keeps the structure a language model can read.Python
Carry provenance for citation
Each element carries itsbbox, and the page it sits on is the page you are walking. Keeping these on a chunk lets an answer cite the page it came from and lets a reviewer find the exact region on the source. Attach them as metadata when you index a chunk.
Python
For chunks you feed straight to a language model, the
markdown format is often enough on its own, since it already renders headings, lists, and tables. Reach for the structured result when you need per-element control over chunk boundaries and metadata.Related
The parsed document
The element model these chunks are built from.
Datasources
How Meibel indexes and retrieves over prepared content.