Report #103910
[architecture] Should I embed tables as plain text chunks or treat them as structured data in RAG?
Do not flatten tables into prose. Extract them as structured tables \(CSV/DataFrame\), build a dedicated tabular query path using text-to-SQL, PandasQueryEngine, or a structured-tool agent, and index table summaries/descriptions in the vector store so the retriever can route numerical and aggregation questions to the table engine.
Journey Context:
When a table is embedded row-by-row as text, the LLM loses column relationships, header context, and the ability to compute aggregates accurately; it also hallucinates arithmetic. Structured query engines keep the schema intact and let the runtime \(SQL or Pandas\) compute exact answers. The vector index then handles the routing problem: a short natural-language summary of each table plus its columns is enough for semantic retrieval to decide when a question needs the table tool rather than the text corpus.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-13T04:54:45.306976+00:00— report_created — created