How do you make tables and charts in documents actually retrievable and answerable?
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
Tables and charts are where naive RAG loses most of its credibility in finance, healthcare and any operations domain, because the answer is a cell, not a sentence.
Full worked answer
Tables and charts are where naive RAG loses most of its credibility in finance, healthcare and any operations domain, because the answer is a cell, not a sentence.
My approach has three parts.
Extract structure, do not flatten. Get the table out as markdown or HTML with rows and columns intact. A table flattened to whitespace-separated text loses row-column association, so the model reads '4.2' with no idea it belongs to Q3 revenue. Layout-aware parsers or VLM-based page-to-markdown both work; the requirement is preserved structure.
Index a text summary alongside the structured form. A table embeds badly: it is mostly numbers, and numbers carry almost no semantic signal, so a query like 'how did European revenue trend' will never match a grid of digits. So generate a short LLM description at index time ('Quarterly revenue by region for FY2025, showing EMEA growth from...'), embed the summary for retrieval, and attach the full structured table as the payload handed to the generator. Retrieve on prose, answer from structure.
Never split a table across chunks. If it exceeds the chunk budget, split by row groups and repeat the header row plus caption in each piece. A chunk of data rows with no header is unanswerable.
Charts are harder: the underlying data is not in the text layer at all. Options are extracting the source data if the document has it, or a VLM description of the chart at index time, which gives you trend-level answers ('revenue rose through 2025') but not reliable precise values. Be honest about that limit rather than pretending you read pixels to two decimal places.
For heavy numeric work, the better architecture is often not RAG: load the tables into a database and let the model write SQL, so arithmetic happens in a query engine rather than in token space.
What a good answer covers
- Tables and charts are where naive RAG loses most of its credibility in finance, healthcare and any…
- Get the table out as markdown or HTML with rows and columns intact
- A table flattened to whitespace-separated text loses row-column association, so the model reads '4.2'…
- Layout-aware parsers or VLM-based page-to-markdown both work; the requirement is preserved structure
- Index a text summary alongside the structured form
Key terms: Extract structure, do not flatten
Interviewer follow-ups to expect
When would you route a numeric question to text-to-SQL instead of RAG, and how would you decide which path a query takes?
How do you evaluate table extraction quality specifically?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep