- Home
- Skills
- APIs & Backend
- financial statement extraction
financial statement extraction
Extracts and arithmetically validates financial statements from PDFs into a relational database using a staged pipeline.
Free
Works with the AI Agents you already use
financial statement extraction
Example session with this skill installed
Triage the remaining failed reports for the 2023 annual cycle and generate batches for the vision subagents.
- Read your context and instructions
- Compiled the financial statement extraction
I have analyzed the extraction results for the 2023 annual reports. Out of 45 reports, 38 were EXTRACTED, 4 are PARTIAL, and 3 FAILED due to complex multi-column layouts and arithmetic mismatches in the Cash Flow statements.
Triage Summary
| Report ID | Company | Status | Reason | Page Hints |
|---|---|---|---|---|
| CSE_JKH_2023 | John Keells | PARTIAL | FAIL (Assets check) | 42, 44 |
| CSE_HAYL_2023 | Hayleys PLC | FAILED | UNCHECKED (New layout) | 110-115 |
| CSE_SAMP_2023 | Sampath Bank | PARTIAL | no_months | 55 |
Vision Transcription Batch: b05_2023_annuals.json
{
"batch_id": "b05_2023_annuals",
"target_worker": "vision-subagent",
"tasks": [
{
"document_id": "CSE_JKH_2023",
"pages": [42, 43, 44, 45],
"context": "Arithmetic failure in BS: Equity + Liabilities off by 9 units. Verify if rounding or print error.",
"output_path": "reviewed/vision/jkh_2023.txt"
},
{
"document_id": "CSE_HAYL_2023",
"pages": [110, 112, 114],
"context": "Custom grouping in P&L not recognized by current checks.py. Transcribe full table for layout analysis.",
"output_path": "reviewed/vision/hayl_2023.txt"
}
]
}
Next steps
- Trigger the vision subagents using
scripts/make_batches.pywith the generated JSON. - Update
checks.pyif the Hayleys layout shows a recurring non-standard subtotal pattern. - Run
stage_publish.py --project .once transcriptions are marked as PASS.
Connects securely to your tools. The creator never sees your data.
About this skill
Manual data entry for financial reports is slow and prone to error, while generic OCR fails on complex layouts and arithmetic inconsistencies. This skill implements a strict, check-driven pipeline to extract income statements, balance sheets, and cash flow data from company PDFs into a relational database.
What it does
- Multi-source extraction parses native PDF text layers and uses vision-capable subagents to transcribe scanned or complex statement pages.
- Arithmetic validation enforces hard checks (Assets = Equity + Liabilities) to ensure only mathematically sound data enters the database.
- Automated triage categorizes failures by reason (e.g., unit unproven, check failed, missing columns) to minimize manual review time.
- Staged loading manages a rigorous audit process that prevents data regression, integrity errors, or scale outliers during publication.
- Batch orchestration coordinates subagents to process high volumes of reports in parallel based on precise triage hints.
How it works
- Scope and Parse: Define the period range and run
extract_all.pyto attempt automated parsing of all project PDFs. - Triage: Run
triage.pyto identify which statements failed to load and why, generating batch files for manual or agent-led review. - Transcribe: Use vision-capable agents to process failed pages, following
worker_brief.mdto produce checked transcriptions. - Audit and Publish: Execute
stage_publish.pyto run final integrity checks and merge verified facts into the production database.
Frameworks & tools
Python-based pipeline using SQL for fact storage and schema management. Utilizes OCR engines for scans and vision LLMs for layout-sensitive transcription.
Why this beats prompting it yourself
Prompting an LLM to "extract data" often results in hallucinated figures or ignored rounding errors. This skill uses a code-first validation layer that rejects any data that doesn't sum up, ensuring your database contains verified facts rather than just "likely" numbers.
Use cases
- Building a historical financials database from years of exchange filings.
- Auditing existing financial datasets for arithmetic errors or mislabelled items.
- Automating the processing of quarterly interim reports at scale.
- Recovering data from poor-quality scans that standard parsers ignore.
Known limitations
Requires a structured project directory and specific database schema. Arithmetic checks may reject reports with extreme printing errors unless manual overrides are recorded.
Requires structured project directory. Arithmetic checks reject mathematically inconsistent reports. Standard line items depend on label_alias dictionary. Needs vision-capable models for scans.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 9 days ago
- Free with an Agensi account
Requires