Chunking Modes
structural (default)
Element-level chunks — one per paragraph, heading, table, or list.
structural produces one chunk per structural element: each heading, paragraph,
table, and list becomes its own chunk. It's the finest-grained mode and the best
choice when you want element-level control over indexing.
from py_chunks import get_chunks
chunks = get_chunks("report.docx", mode="structural")default vs structural
For most formats, default is element-level chunking.
- DOCX:
defaultis normalized tostructural— they're equivalent. - PDF:
defaultandstructuralare not the same.defaultuses a fast, lightweight path;structuraluses the full, font-size-weighted layout analysis. Usestructuralwhen heading detection matters.
If you're unsure, default is a safe starting point for every format.
content_type values
Chunks are typed by what they contain — common values include heading,
plain_paragraph, bullet_list, table, and code_block. See the full list
in the Output Schema.
When to use it
- Fine-grained retrieval where each element should be independently searchable.
- Downstream logic that re-groups elements itself.
- Precise citations back to a single paragraph or table.