Skip to content

APIFinTech · Financial operations

Invoice extraction that does not care what the invoice looks like

A document processing agent that reads invoices and contracts by understanding their content rather than matching their layout, with a deterministic validation layer that catches the errors the model would confidently miss.

92%less manual data entry

At a glance

Duration
13 weeks
Team size
1 person
Engagement
New build
Project type
AI & automation
Industry
Fintech

The situation

The challenge

Template-based OCR fails the moment a vendor changes their layout, and every new vendor means another rule. The goal was a system that reads content independent of presentation — while still being rigorous enough to spot a genuine error like a total that does not match its line items.

What we did

Extraction by comprehension, verification by arithmetic. The model reads; deterministic code checks its work.

The calls that mattered

  • Layout-agnostic extraction with structured schemas

    Documents are converted to model-readable form, with vision processing for scanned PDFs, and prompts carry an explicit schema plus few-shot examples spanning layout variation. Understanding the document beats matching it.

  • Validation outside the model's control

    Line-item totals, required fields and value ranges are checked in code, independent of the model's own confidence. A model that is confidently wrong is exactly the failure mode this has to survive, and self-reported confidence cannot catch it.

  • Route fields for review, not documents

    Field-level confidence sends only uncertain fields to a human. Escalating the whole document because one line was ambiguous is how a system that works still fails to save anyone time.

What changed

reduction in manual entry
92%reduction in manual entry
field-level extraction accuracy
98.4%field-level extraction accuracy
average processing time per document
<8saverage processing time per document
of total and line-item mismatches caught
100%of total and line-item mismatches caught
  • 92% — for routine invoice processing
  • 98.4% — on the validation set
  • 100% — by the validation layer, on the test set

92% less manual entry on routine processing, 98.4% field-level accuracy, under eight seconds per document, and every total or line-item mismatch in the test set caught before it reached a human.

Services used

  • Layout-agnostic extraction pipeline with vision fallback
  • Deterministic validation and discrepancy detection layer
  • Field-level confidence routing and human review queue
  • Serverless processing on Lambda with S3 document storage

What we would do differently

Every project has one of these. Publishing it is the point — a case study with no regrets in it is marketing, not evidence.

The extraction quality was never the hard part. The validation layer was, because it is the thing that makes the output trustworthy enough to act on automatically. Next time that layer gets designed first and the prompting second.