AI invoice processing, PDF to ERP

Invoices read by an AI model against a strict schema, routed for one-click approval in Slack, and synced into the ERP with an append-only audit log. 95%+ first-pass accuracy, in daily use.

Problem

Vendor invoices arrived as PDFs, were typed into the ERP by hand, and then chased for approval over chat. Slow, error-prone, and impossible to audit.

What I built

The full replacement, end to end.

  • Extraction. Invoices of 1 to 50 pages are read by an AI model against a strict schema, so every field lands in the right place.
  • Approval. Each invoice is routed to the right approver in Slack with one-click approve or reject.
  • Sync. Approved invoices flow into the ERP automatically, with an append-only audit log of every step.

Engineering details

  • A restart-safe extraction queue that survives container restarts.
  • Batched database writes and trigram search indexes.
  • Prompt caching to cut token costs.
  • 150+ automated tests, plus a CI guard that makes sure no bank details can ever leave the system.

Results

Metric Result
First-pass extraction accuracy 95%+
p95 processing time 8 s → 1.2 s
Invoice volume handled 3x, no extra infrastructure

In daily production use. Client work, so the code is private.