An Invoice Worker That Learns From Every Exception for Every Customer
Thread AI Editorial · June 12, 2026
A document services provider processes supplier invoices for its customers’ accounts payable teams.
Using Lemma, it gives each customer its own Worker, which reads invoices as they arrive, learns from how the customer’s team resolved past exceptions, and sends nothing to the customer’s accounting system until an approver signs off.
What Lemma delivers
Fewer invoices reaching a person
As more exceptions resolve from past decisions.
Every customer’s policy
Encoded in its own Worker and adjustable in minutes.
Every decision recorded
Whether the invoice posted cleanly or was flagged, showing where it went and why.
The Challenge
Most accounts payable work begins with a document: a PDF on an email, a scanned delivery note, or a packing slip that arrives with the goods. The providers that serve these teams already capture the document. Each invoice then passes through a long chain of checks:
- Buyer and supplier identification
- Whether the two actually trade with each other
- Accounting parameters and dates
- Duplicates
- VAT and legal rules
- Purchase order (PO) matching
Each check is run once. If and when an invoice fails, it’s flagged and routed to an operator, who makes a judgment call and moves on. When the same flag shows up on another invoice, someone has to make that call all over again. There’s no self-improvement loop to learn from an error the first time. Nothing learns, so every exception costs as much the hundredth time as the first, and some errors aren’t flagged at all, meaning they go straight into the ledger as wrong output.
The Solution
The provider can build that memory into its service. Using Lemma, it deploys a Worker for each customer, assigns each one a unique identifier, and loads it directly into the customer’s own isolated tenant. The Worker also remembers how the customer’s operators have resolved past exceptions.
When an invoice fails a check, the Worker looks for a comparable case the customer’s operators have already decided. If it finds one it’s confident in, it applies that decision and moves the invoice on to the next check. If not, it sends the invoice to a person, and that person’s decision is saved for the next case like it.
Over time, more exceptions resolve from precedent and fewer invoices reach a person. Nothing posts to the ERP until the customer’s approver signs off. For customers, that means faster processing and fewer repeat decisions. For the provider, it’s a service that gets better the longer a customer uses it.
Lemma Capabilities
Sorts every document before reading it.
Turns email attachments and device scans into one structured record, and sets aside anything that isn’t an invoice before reading a single field.
Scores every field it extracts.
Each field gets a confidence score, measured against a rubric that anyone reviewing the invoice can see.
Checks precedent before escalating.
Before a failed supplier match, PO match, or business-rule check reaches an operator, the Worker looks up how the customer resolved similar cases. Each decision is saved with its reason, and if an invoice comes back for review at a later check, it carries forward what was already decided.
Keeps each customer separate.
Each customer’s Worker runs in its own isolated environment, managed by the provider, with its own Connection to that customer’s ERP.
What’s Next
As precedent builds up, operators can spend their time on exceptions no one has seen before, and each customer’s past decisions keep shaping how its invoices are handled, even as the people on its team change. For the provider, every new customer starts with its own Worker and builds its own record of decisions from the first invoice, so the service can grow without one customer’s rules carrying over to another’s.
Does this sound familiar?
Your team makes the same judgment call on the same kind of exception, again and again.
Every exception costs as much the hundredth time as the first.
Decisions live with the people who made them, not in the system.
You serve many customers, and each one does things a little differently.