Writing Prompts for Agentic Table Extractor
Prompt Structure
The prompt for Agentic Table Extractor is a single text field with three components:
Target Table (required)
A natural-language description of the table you want to extract. This is the only required part of the prompt. Be specific about what the table contains, where it typically appears in the document, and any distinguishing characteristics.
Example:
Extract the line items table that lists all products/services with columns for
item description, quantity, unit price, and total amount.
JSON Structure (required)
A JSON structure that defines the desired output format using an example object with placeholder values. This is not formal JSON Schema syntax — you provide a sample object showing the shape you want. The pipeline uses Agents 4–5 to generate and execute transformation code that maps the raw extraction into your structure. See JSON Schema Transformation for details.
Example:
{
"items": [
{
"description": "string",
"qty": "number",
"unit_price": "number",
"total": "number"
}
]
}
Instructions (optional)
Additional guidance for the extraction agents. Use this for edge cases, special handling rules, or formatting preferences.
Example:
If a row spans two lines, merge them into a single row.
Ignore any subtotal or total rows at the bottom of the table.
Dates should be in YYYY-MM-DD format.
The Readiness Checklist
The prompt card displays three checkboxes that validate your prompt in real time. These checkboxes are evaluated by the lite LLM (configured in the prompt's settings) to ensure your prompt is well-formed before running extraction.
How validation works
As you type, a debounced validation request is sent (2.5 seconds after you stop typing) via a POST /validate/ call. The lite LLM evaluates the prompt text and returns the status of each checkbox.
All three checkboxes should pass for optimal extraction results. You can still run extraction with unchecked items, but the results may be less accurate.
Tips for Effective Prompts
- Be specific about the table. Instead of "extract the table," describe what the table contains: "Extract the table listing employee names, departments, and salaries."
- Mention identifying features. If the table has a title or header row, mention it: "The table is titled 'Schedule of Values' and starts with columns: Item No., Description, Value."
- Describe the table's location when the document contains multiple tables: "Extract the table on the first page that shows payment terms, not the line items table."
- Specify handling for edge cases. If rows might be merged or span pages, mention how they should be treated.
- Keep it concise. The detection and extraction agents work best with clear, focused descriptions rather than lengthy instructions.
Example Prompts
Invoice Line Items
Extract the line items table from the invoice. The table contains columns for
item/service description, quantity, unit price, and line total. Ignore subtotal,
tax, and grand total rows.
Financial Statement
Extract the balance sheet table showing account names and their corresponding
amounts for each period. The table typically has columns: Account, Current Year,
Prior Year.
Insurance Schedule
Extract the schedule of coverages table listing each coverage type, limit,
deductible, and premium amount. The table may span multiple pages.