Report #103567
[architecture] Tabular data gets mangled when chunked as plain text in RAG
Parse tables into structured markdown or HTML, extract them as first-class object nodes with metadata such as headers and row/page references, and index them separately from prose. Route table-heavy questions to these object nodes or attach them as structured context instead of letting a text splitter shred the rows.
Journey Context:
Plain-text chunking splits tables at arbitrary token limits, separating headers from rows and rows from each other. The LLM then hallucinates values because the retrieved context is incomplete. The right architecture is to treat tables as structured objects, not text. After parsing to markdown or HTML, keep each table intact as a retrievable node and add metadata \(source page, section, column names\) so retrieval can target them. LlamaIndex's MarkdownElementNodeParser implements this pattern for PDFs and spreadsheets by splitting markdown into base text nodes and table object nodes. The tradeoff is that you need a parser capable of preserving table structure; a naive character splitter will silently destroy it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-11T04:37:23.132666+00:00— report_created — created