Hierarchical Document Structure as a Retrieval Infrastructure Contract Not a Parsing Bonus
Chunking that ignores document structure loses the links retrieval needs.

A document splitting and semantic chunking API for RAG pipelines should preserve section hierarchy, reading order, evidence relationships, and source-page links. The reliable pipeline parses documents, splits along logical boundaries, and enriches each unit with navigable structure and confidence scores. Hierarchical document structure is a retrieval infrastructure contract, because downstream retrieval and generation depend on relationships established at ingest.
Why flat chunking breaks retrieval before it begins
The widespread assumption that parsing is a preprocessing courtesy puts retrieval on a weak foundation. The dominant pattern splits documents into fixed-size token windows, embeds them, and retrieves by similarity. That operation is not neutral. Chong’s 2026 ToC-RAG work identifies how chunking destroys heading hierarchies, section boundaries, and cross-references between related content.
HiKEY, introduced by Shin et al. in 2026, names two things that go wrong, routing failure and evidence fragmentation. The first prevents the system from locating the correct document or section, while the second separates connected evidence, including tables and figures. VecTree-RAG, introduced by Zhong et al. in 2026, describes the problem in scientific papers, where results become detached from methods and qualifications. Similarity does not reliably reconstruct those connections. When a question spans related sections, organizationally relevant passages may remain semantically distant from its wording, and retrieving more passages adds redundancy without restoring their relationships.
What document hierarchy actually encodes and why it is a retrieval signal, not metadata
Document hierarchy encodes semantic scope at several levels. KohakuRAG formalizes these levels as a tree of document, section, paragraph, and sentence, with bottom-up embedding aggregation propagating meaning upward. These units are not interchangeable containers for text. Section structure has strong semantic consistency with its content and suits a fused representation, while document structure works better as an independent retrieval signal. Flattening both into one representation removes distinctions that retrieval could otherwise use.
Those distinctions also provide addresses for evidence. HiKEY encodes parent–child relationships so that a path such as 1 → 1.2 → 1.2.1 becomes navigable. An in-text pointer such as “Table 2” depends on a map connecting it to its referent. The table of contents provides a routing index that covers more than a local text chunk can show. Hierarchy is therefore a semantic input, even when an API stores it in metadata fields.
This signal need not depend on embedded bookmarks. Chong’s layout analysis recovered hierarchical tables of contents from all eight documents in the tested enterprise corpus, including PDFs without bookmark metadata. It looked at font sizes, weights, and spacing across the whole document without LLM calls. Visual formatting supplied evidence about organization.
How broken structure at ingest propagates as a deficit through every downstream stage
Misaligned tables, merged columns, and disrupted logical units can prevent relevant information from reaching the answer stage even when much of the text survives extraction. HIEVI-RAG, introduced by Xiong et al. in 2026, identifies a compounding mechanism in which semantic similarity retrieves topically overlapping but answer-void distractor pages. Single-pass pipelines rely heavily on which pages are chosen at that first step. Missing core evidence therefore creates cascading errors.
Routing failure and evidence fragmentation affect different parts of that cascade. Losing section-path context impairs corpus exploration, while losing relationships between sections and figures prevents complete evidence assembly after a relevant passage is found. Retrieval can be locally correct yet insufficient. A passage may address the topic without the table or qualification needed to interpret it, leaving generation to work from incomplete support.
Multimodal documents expose this dependency especially clearly. Tables and charts contain evidence whose role depends on section context and in-text references. VecTree-RAG retains full text in a page store and exposes it progressively after structural localization. That ordering makes the dependency explicit, because locating the evidence structurally precedes reading it in full.
What the retrieval layer actually needs from the ingestion layer — the structural contract
The ingest layer must produce a hierarchical index that maps each content unit to its section path. HiKEY uses hierarchical indexing for global routing before fine-grained retrieval within routed documents, so both stages depend on navigable structure. Reading order belongs in the same contract because sequential reasoning requires the content of a located section to arrive in its logical order.
The index must also keep source-page links and make parent–child relationships clear. VecTree-RAG links document and section representations to original pages through a source-verified hierarchical index, allowing navigation to end in traceable evidence. HiKEY represents paragraphs, tables, and figures as section-annotated evidence units, then assembles an evidence subgraph under a fixed token budget. Its packing strategy prioritizes siblings and semantic associates. These operations require relationships established at ingest, rather than independent passages that happen to rank together.
A parallel heading index provides another retrieval route without additional LLM inference. Chong’s Three Sides of Retrieval reports that ToC-guided retrieval contributed 20% of citations while adding only 2.9 pages per query. Headings that are recovered correctly can therefore help select evidence more narrowly.
Evidence that structure-aware retrieval outperforms flat retrieval — and what the gaps reveal

HiKEY reports improvements of up to 12.9% in retrieval recall and end-to-end QA performance over page- and chunk-based baselines on ODQA benchmarks. Chong finds a significant main effect from ToC retrieval on answer quality, with d = +0.41 and p = 0.031, and the largest gains in completeness and usefulness. VecTree-RAG achieves the highest observed answer score across QASPER, LitQA2, and MOSAIC against Dense RAG, reranked Dense RAG, RAPTOR, and Search-o1. Its QASPER evidence-page precision reaches 0.274 versus 0.046–0.071 for the baselines. Together, these findings support hierarchy as an operational retrieval signal.
KohakuRAG supplies an important counterpoint to ingest-first investment. Its ablations show that prompt ordering and retry mechanisms each contribute larger relative improvements than adding sparse-dense hybrid retrieval on top of hierarchical retrieval. That comparison deserves its full qualification. It measures additions to an already hierarchical system. Chong’s factorial evidence finds no significant interaction between document-side and answer-side gains, and ToC retrieval with verification outperforms query decomposition with verification, supporting complementary investment.
The evidence also has limits under production conditions. Many established benchmarks use clean, well-aligned digital pages that omit capture distortions, shadows, and illumination changes. Wild-OmniDocBench, Real5-OmniDocBench, and PureDocBench explicitly include such conditions, but clean-page results alone cannot establish reliability on degraded enterprise inputs. It is still unclear whether the parser can supply the structure that the retrieval method needs.
What should a document splitting and semantic chunking API preserve for RAG?
Production ingestion must preserve structure through parsing, splitting, and classification. Missing PDF bookmarks cannot justify a silent fallback to flat extraction when visual heading signals remain available. Chong demonstrates that full-document typographic analysis can recover hierarchy without LLM calls. Correct words in the wrong order across columns or sidebars still break the retrieval contract.
Splitting must use section endings, completed tables, and figure-caption pairs to set boundaries, with token count as only one guide. Each resulting unit must retain its document, section, subsection, and element path as directly queryable metadata. Parent–child relationships must survive extraction too. Otherwise, even a parser that seems structure-aware can feed a flat index that leaves retrieval unable to bring connected evidence together.
Those same logical units must each have a confidence score. A score for a recognized header, table, or figure-caption pair shows which part of the recovered structure may be wrong. An arbitrary chunk score does not identify that boundary. Uncertain table alignment or heading level must be flagged before it becomes a silent indexing error, making confidence a first-class output for each logical unit.
Where the structural contract is hardest to honor — complex document types and degraded inputs
Multi-column pages challenge reading order, merged table cells challenge field relationships, and page breaks can separate figures from captions. HiKEY characterizes industrial documents as spanning dozens of pages with mixtures of tables, figures, schematics, captions, and footnotes. Recovering the heading tree is only partial success. If a table loses its structure, the section address still points to damaged evidence.
Financial, healthcare, and legal documents make these failures consequential. In financial documents, minor structural misreadings can lead to regulatory non-compliance downstream. Workflows in real estate, logistics, and legal domains that must meet compliance rules rely on confidence scores below the threshold to trigger human review before a downstream write. That decision requires a meaningful scoring unit. A confidence threshold cannot reliably pinpoint a flaw in the structure when the scored text spans logical units that are unrelated.
Captured documents introduce another source of uncertainty. Shadows, skew, and mixed scan quality can obscure the visual signals used to distinguish headings, columns, and tables. Working reliably on clean digital pages does not show that a system will work reliably on those inputs. Structural confidence must therefore be tracked during production, even after a development benchmark has tested it.
Why general-purpose models cannot honor the structural contract without specialized infrastructure
General-purpose foundation models applied through prompts do not reliably guarantee structural recovery across complex, degraded, and multimodal documents. Heading recognition, table-cell separation, and figure-caption association require attention to document-specific visual signals. Specialized vision models target those tasks directly. Yet model choice alone is insufficient, because splitting, extraction, and parsing also depend on the surrounding system harness. That harness must enforce relationships, source locations, reading order, and confidence outputs.
An infrastructure layer that brings the APIs together sets out those requirements for parsing, extraction, splitting, and classification. Extend is one option for document processing infrastructure, with specialized vision models that work on complex layouts, reading order, and field relationships. It treats the parsing layer beneath retrieval and agents as infrastructure to be benchmarked and held to a standard, with structured output, hierarchical metadata, and confidence scoring provided by the pipeline.
Agentic workflows make that distinction more consequential still. A section that is misclassified can affect routing, and a low-confidence extraction can feed a write operation as well as a weak search result. The classify-validate-route loop depends on units that correspond to real source boundaries. Without that correspondence, validation and routing inherit the parser’s uncertainty.
Designing an ingest pipeline that treats structure as a contract from the start
Retrieval requirements should be defined before tools are chosen. A team should specify the structural signals used for routing, the evidence granularity used for assembly, and the confidence thresholds used for review. Those decisions establish the parser’s acceptance criteria. Evaluation must then cover reading order, table structure, and hierarchy recovery, rather than OCR accuracy alone, so that ingestion is tested against what its consumers require.
The default pipeline should parse, split along logical boundaries, and enrich each unit with navigable relationships and source-page links. Fixed-size chunking is a fallback only when no structural signals are recoverable. That fallback should be marked as contract degradation. Section paths and parent–child relationships must remain first-class metadata throughout indexing, while page links preserve traceable citations. A structure-aware split loses its value if later stages discard its addresses.
Confidence instrumentation should score sections, table cells, and figure-caption pairs on their own, so structural failures are not averaged into a score for the whole document. Low-confidence recovery should trigger human review or re-parsing before indexing. End-to-end evaluation should test retrieval quality on complex layouts, mixed modalities, and enterprise document classes. These tests connect parser performance to the evidence the system can actually use.
Teams that establish the contract at architecture time build retrieval systems that inherit structural correctness from ingest. Teams that treat hierarchy as a parsing bonus must retrofit recovery into systems designed around its absence. The former approach is cheaper and more reliable because preservation precedes dependency. Production-grade document AI requires that infrastructure commitment from the start.
Sources
- Three Sides of Retrieval: Factorial Evidence for Document-Side, Query-Side, and Answer-Side Complementarity in RAG
- VecTree-RAG: An Agentic Retrieval-Augmented Generation Framework Combining Vector and Tree Retrieval for Efficiency and Accuracy
- HiKEY: Hierarchical Multimodal Retrieval for Open-Domain Document Question Answering
- KohakuRAG: A simple RAG framework with hierarchical document indexing
- Hierarchical Evidence-Driven Reasoning for Long Document Understanding
- Infinity-Parser2 Technical Report


