Content revision 4e771eaf0390cc87b6c7c6fd8469f3508f6ceeec7119472e6c1ccf17e2e1e5d2 ## Preserving the structure inside a table A Structure-Preserving RAG Ingestion Pipeline Source ID ragflow-pipeline:complex-tables Original https://www.henryw.me/#/ragflow-pipeline#complex-tables A merged cell can make one heading apply to several rows or columns. A nested table introduces a smaller set of relationships inside a single cell, such as the booking rules in this example. Flattening either into a sequence of words makes it harder to determine which condition governs which value. I tested both structures separately because success on merged cells would say little about a parser’s ability to recognise a table inside a table. MinerU’s OCR-based path, which recognises text and reconstructs layout, recovered the merged cells as HTML but missed the nested tables in the tests. Its built-in vision-language model (VLM), which interprets images as well as text, recovered both. HTML could express the resulting hierarchy explicitly through cells spanning rows or columns and tables contained within other cells. That result needed to survive the rest of the pipeline. In the RAGFlow path I tested, subsequent processing discarded the HTML tags. The parser’s output contained the relationships, but the material supplied for an answer had lost them. With LlamaIndex, a framework for organising content for retrieval, the structure remained available through indexing, retrieval and answer generation. I therefore selected MinerU’s built-in VLM with LlamaIndex, checking the evidence returned to the model as well as the parser’s output.