Imagine you have a massive library of enterprise documents — financial reports, research papers, pharmaceutical studies. Much of the critical data lives inside charts and figures, not in plain text.
Traditional retrieval systems work like this:
User Question → Search Text Index → Return Relevant Pages → Generate Answer
The problem has two layers:
| Layer | Problem | Consequence |
|---|---|---|
| Retrieval | Text search cannot "see" chart values | Wrong pages returned |
| Answering | Agent only gets an image or vague caption | Cannot count/read precise values |
Question: "How many local maxima are on this chart?"
| Approach | Method | Time Spent | Answer |
|---|---|---|---|
| Frontier Agent | Analyzed raw image | 50 seconds | 17 ❌ |
| Databricks Genie | Used structured JSON extraction | Fast | 18 ✅ |
Key insight: The image alone is ambiguous. Structured data is precise.
Instead of treating a chart as just an image, ai_parse_document converts it into structured JSON — a machine-readable format containing:
BEFORE (Image Only): AFTER (Structured JSON):
┌─────────────────┐ {
│ 📊 [chart img] │ → "type": "line_chart",
│ │ "x_axis": ["Q1","Q2","Q3"],
│ (opaque blob) │ "series": [
└─────────────────┘ {"name": "Oil VIX",
"values": [45, 62, 80]}
]
}
When chart values become text in the index, the search engine can now match:
PDF Documents
│
▼
ai_parse_document ──→ Extracts text + Chart JSON
│
▼
ai_prep_search ──────→ Chunks content into retrieval-ready pieces
│
▼
ai_search (BGE 300M text embedder) ──→ Builds searchable index
│
▼
User Query ──→ Retrieve top chunks ──→ (Optional: add images) ──→ Generate Answer
| Component | Role | Size/Cost |
|---|---|---|
ai_parse_document | Extracts structured chart JSON | Preprocessing step |
ai_prep_search | Chunks and prepares content | Lightweight |
| BGE Text Embedder | Creates searchable vectors | 300M parameters (small) |
ai_search | Retrieves relevant chunks | Fast at query time |
Benchmark 1: ViDoRe V3 Subset
Benchmark 2: Chart-RAG (Synthetic)
Retrieval Quality:
├── Hit Rate@10 → Did the correct page appear in top 10 results?
└── nDCG@10 → Were the most relevant pages ranked highest?
Answer Quality:
└── LLM Judge scores each answer as:
✅ Correct / ⚠️ Partially Correct / ❌ Incorrect
| Question | Without Chart JSON | With Chart JSON |
|---|---|---|
| "What peak level did Oil VIX reach in Q1 2026?" | "I cannot find specific information..." ❌ | "Approximately 80 percentage points" ✅ |
After retrieving text chunks with JSON, optionally passing the top 3 page images to the agent adds further gains:
Text + JSON only: baseline
+ Top 3 images: +4.0 pp on Chart-RAG
+2.6 pp on ViDoRe V3
Why? Some questions depend on visual appearance (colors, shapes, layout), not just numerical values.
| Model | Type | Parameters | Approach |
|---|---|---|---|
| This approach | Text + JSON | ~300M | Structured extraction |
| ColQwen2.5-3B | Multi-vector multimodal | 3B | Late-interaction scoring |
| Qwen3-VL-Embedding-2B | Single-vector multimodal | 2B | Cosine similarity |
| Jina CLIP v2 | Single-vector multimodal | 0.9B | Cosine similarity |
| CLIP ViT-L/14 | Single-vector multimodal | 428M | Cosine similarity |
| Dataset | This Approach (JSON + 3 images) | Best Multimodal Baseline |
|---|---|---|
| ViDoRe V3 | 75.9% correct | Lower |
| Chart-RAG | 75.1% correct | Lower |
ColQwen2.5-3B: 3,000M parameters + complex late-interaction
This approach: 300M parameters + simple text search
─────────────────────────────────────────
Difference: ~10x smaller, simpler, yet MORE accurate
PROBLEM: Charts are invisible to text search → wrong retrieval → wrong answers
SOLUTION: Convert charts to structured JSON → text search can find chart data
→ correct retrieval → correct answers
BONUS: Add top retrieved page images at answer time for visual questions
RESULT: Outperforms models 10x larger with less complexity
Structured > Visual for Retrieval
Retrieval Quality Drives Answer Quality
Efficiency Matters
Test your understanding:
ai_parse_document produce that makes charts searchable?Answers: (1) Charts are images — text search can't read pixel values. (2) Structured JSON with axis labels and data values. (3) When questions depend on visual appearance, not just numbers. (4) It outperforms it while being ~10x smaller. (5) Hit Rate@10 and nDCG@10.