Agentic Table Extractor: Introduction
This feature is available in Unstract Cloud Edition and Unstract On-Premise Edition.
What is Agentic Table Extractor?
Agentic Table Extractor is a multi-agent pipeline within Prompt Studio that extracts structured table data from documents. Unlike standard extraction prompts that treat tables as flat text, Agentic Table Extractor uses a sequence of specialized agents — each backed by a Vision Language Model (VLM) — to detect, analyze, and extract tables with structural awareness.
It handles PDFs, Excel files (.xlsx/.xls), and images, and works especially well on complex tables that span multiple pages, have merged cells, or contain nested structures.
Standard Table Extraction vs. Agentic Table Extraction
Standard table extraction (enforce_type: table) sends a single prompt to one LLM and asks it to extract table data in one pass. This works for simple, well-formatted tables but struggles with:
- Tables that span multiple pages, where rows may be split across page breaks
- Complex table structures with merged cells or hierarchical headers
- Documents where tables need to be located among other content first
- Large tables where a single LLM call can't capture all rows accurately
Agentic Table Extraction (enforce_type: agentic_table) addresses these limitations by breaking the problem into specialized stages, each handled by a dedicated agent.
| Aspect | Standard (table) | Agentic (agentic_table) |
|---|---|---|
| LLM calls | Single call | Multi-agent pipeline (6 agents) |
| Page handling | Entire document at once | Page-by-page scanning with parallel processing |
| Multi-page tables | Often splits or misses rows | Detects and merges cross-page rows |
| Table detection | Relies on prompt instructions | Dedicated detection agent screens pages |
| Output transformation | None | Code generation for JSON schema mapping |
| LLM adapters required | 1 (project LLM profile) | 2 (advanced + lite) + X2Text adapter |
| File types | PDF, images | PDF, images, Excel (.xlsx/.xls) |
| Cost | Lower (single call) | Higher (multiple agent calls) |
The 6-Agent Pipeline
Agentic Table Extractor processes documents through a pipeline of six specialized agents:
Document
│
▼
Agent 0: DetectorPromptGenerator (advanced LLM)
│ Generates a detection prompt from your target table description
▼
Agent 1: PresenceDetector (lite LLM)
│ Screens pages in parallel to find which ones contain the target table
▼
Agent 2: TableDetector (advanced LLM)
│ Analyzes table structure — headers, columns, data types
▼
Agent 3: ContentExtractor (advanced LLM)
│ Extracts row data page by page, merges rows that span page breaks
▼
Agent 4: CodeGenerator (advanced LLM)
│ Generates Python transformation code to map raw data to JSON structure
▼
Agent 5: CodeExecutor (no LLM)
Runs the generated code in a sandboxed environment
Agent 0 — DetectorPromptGenerator
Uses the advanced LLM to turn your natural-language target table description into a structured detection prompt. This prompt is used by Agent 1 to screen pages efficiently.
Agent 1 — PresenceDetector
Uses the lite LLM to screen each page of the document in parallel, determining whether the page contains (or is part of) the target table. Pages that don't contain the table are skipped, saving time and cost on large documents.
Agent 2 — TableDetector
Uses the advanced LLM to analyze the structure of detected tables — identifying column headers, data types, and table boundaries. This structural understanding guides the content extraction.