An autonomous AP agent handling 2,000+ invoices a month

Every supplier sends a different PDF and template OCR breaks on that. A hybrid agent handles 2,000+ invoices a month.

Aralab
2,000+
supplier invoices processed a month
3
finance FTEs redirected to strategic work
6 weeks
to live, built by one engineer

The challenge

Twistag built an autonomous accounts-payable agent for Aralab, a manufacturing business, that processes more than 2,000 supplier invoices a month and redirected three finance FTEs from data entry to strategic work — live in six weeks, built by one engineer. Every supplier sends a differently formatted PDF, and template-based OCR breaks on that variety daily. Twistag built a hybrid system: Anthropic Claude reads and interprets each document, while deterministic code independently recalculates every line total, unit price and tax figure against the matched purchase order. The language model proposes; the validation engine verifies.

Aralab's operations generate over 2,000 supplier invoices a month, each arriving as a PDF, and that is where the consistency ends. Every supplier uses its own layout, line-item conventions, tax formatting and reference-number scheme. Processing them meant opening each invoice, reading it as a human, and working out where each piece of data belonged in the ERP. Aralab's three-person finance team had done this for years — not for lack of skill, but because the volume left no other option. The cost was not the hours. It was that a finance team buried in transcription is a finance team not doing cash-flow forecasting, supplier negotiation or financial planning. The business was paying for judgment and getting data transcription instead.

The solution

Twistag treated Aralab's invoices as an agent problem rather than an automation problem. The architecture is hybrid. Anthropic Claude handles contextual interpretation — reading any supplier PDF format, parsing line items, resolving partial matches, identifying suppliers from inconsistent name variations. Deterministic code handles arithmetic and validation: every unit price compared against the matched purchase order, every line total recalculated independently, every tax amount verified, every grand total checked against the sum of lines.

The pipeline starts with a PDF landing in Cloud Storage on GCP, triggering a Firestore-based workflow. Claude returns a structured JSON object covering supplier identifiers including the Portuguese NIF tax number, invoice number and date, line items, tax calculations and totals. A two-layer supplier identification system links each invoice to the right ERP entity — NIF normalisation first, fuzzy matching as fallback. Line-item matching splits the same way: deterministic rules resolve exact PO references and aligned quantities at zero model cost, and Claude handles partial deliveries, multi-PO allocations, unit conversions and description mismatches, returning a decision with a confidence score and its reasoning.

The dashboard is what made delegation possible. Every invoice appears in one of three states — fully automated, partially matched and awaiting line-item review, or flagged for full review — so the team's attention goes only where the model was uncertain. LangFuse traces every Claude call across the whole AI layer: what the model was given, what it produced, how long it took, what it cost, with prompt versions tracked and cost per invoice visible in real time.

Stack: Anthropic Claude, Google Cloud Platform, Firebase, LangFuse. Services: AI agents and agentic systems, AI-native product engineering, AI-ready data platforms.

The impact

The system shipped in six weeks with one engineer. Aralab's three-person finance team now processes more than 2,000 invoices a month through the review dashboard. No human is required for the patternable 80%; the ambiguous 20% gets a fast review surface. Three FTEs that were buried in data entry moved to cash-flow forecasting, supplier negotiation and financial planning — same headcount, different output. LangFuse makes each decision auditable after the fact, which is what let a finance team delegate at all, and cost per invoice is visible in real time, so the workflow cannot become quietly more expensive than the people it replaced.

The LLM proposes; the validation engine verifies. Neither alone is sufficient.

Technologies used

  • Anthropic Claude
  • GCP
  • Firebase
  • LangFuse
Twistag built an autonomous accounts-payable agent for Aralab that processes more than 2,000 supplier invoices a month.

related case studies

Explore more case studies

next step

Have a similar challenge?

Tell us where you're stuck. We'll come back with a one-page outline of how we'd approach it.