Extraction pipelines, the 90 vs 99 accuracy math, and human review queues: how intelligent document processing works in production, with invoice and claims examples.
Codestreaks Team

It's Tuesday morning and someone on your team is running the ritual. Forty invoices landed in the shared inbox overnight, each one a PDF in a different format, and each one gets opened, read, and retyped into the ERP field by field. The claims team next door runs the same ritual with intake packets. The documents change. The ritual doesn't.
Intelligent document processing is the unglamorous name for making that ritual disappear: software that reads documents, pulls out the fields you care about, checks them against your business rules, and pushes clean data into the systems where work actually happens. The models got good enough that a demo now takes a day. The hard part, and the actual subject of this guide, is the distance between that demo and a pipeline you would trust with accounts payable.
We've shipped 30+ projects to production since 2024, several of them document-heavy, and the same three lessons show up every time. Extraction is a pipeline problem. Accuracy is a math problem. And the human review queue is the product, not an apology for the AI.
The naive build is one prompt: here's a PDF, return JSON. It works in the demo and dies in week one, because real documents are hostile. Scans arrive rotated. One PDF contains eleven invoices. A W-9 sits stapled into the middle of a claim packet. Handwriting in a margin overrides the printed terms.
A production pipeline has five stages, and each earns its keep:
Notice how little of that list is "the AI part". In the build effort, that ratio holds.

Vendors quote accuracy as one flattering number. Do the field-level math before you believe it.
An invoice carries about a dozen fields you actually need: vendor, invoice number, issue and due dates, PO number, subtotal, tax, total, currency, terms, and the line items. At 99% per-field accuracy, the chance that all twelve come out right is 0.99 raised to the twelfth power, roughly 89 documents in 100. At 90% per field, it collapses to about 28 in 100. A system honestly described as "90% accurate" gets barely one document in four fully correct.
Now add volume. At 2,000 invoices a month, the 99% system sends a couple hundred documents to a human. The 90% system sends more than 1,400. The first is automation. The second is a data-entry job with extra steps and a subscription fee.
And the sharpest edge of the math: errors you catch are cheap, errors you miss are expensive. A miskeyed total that slips through becomes a duplicate payment, an underpaid claim, a finding in next year's audit. Prototypes lie. A demo that works on five hand-picked documents tells you nothing about the five thousand real ones, and moving from 90% to 99% reliability is where the engineering actually lives.
Teams that succeed with document automation AI stop asking "how accurate is the model" and start asking "what is our straight-through rate". Straight-through rate is the share of documents that flow from inbox to ERP with zero human touches. It converts directly into hours and payroll, and it's the number to hold any vendor or builder accountable to.
The review queue is what makes a high straight-through rate safe. Four rules make it work:

Accounts payable. The pipeline extracts header fields and line items, matches each invoice against the purchase order and the goods receipt, flags mismatches, and checks for duplicates before anything posts. Line items are the honest test of any IDP system; make a vendor demo on a three-page invoice with 40 lines and quantity breaks, not their sample file. The clean majority posts automatically, and humans handle the mismatches, which is the part of AP that actually needs judgment.
Claims intake. A first notice of loss arrives as a packet: a form, photos, a police report, sometimes a handwritten statement. The pipeline classifies each attachment, extracts the structured facts, checks completeness against the policy, assembles a summary, and routes by severity. One honest line here: the AI assembles and drafts, a licensed human decides. In a regulated line of business, anything else is an audit finding waiting to happen.
The most common way a team arrives at our door: they built or bought something that impressed everyone in a meeting, and it fell apart on real mail. Five clean invoices in, perfect JSON out. Then week one of production delivered a scanned fax at an angle, a 40-page PDF holding eleven invoices from one vendor, and a credit note that got booked as an invoice, so the ledger went out by twice the amount. Most of what we do from that point is reliability engineering, not rebuilding the demo.
Paper is beatable, though. Rope Access Logbook came to us with the paper problem in its purest form: safety-critical logbooks that industrial technicians filled out by hand. We shipped the digital replacement in 8 weeks. Chad Dubuisson, the founder: "Codestreaks took our rough idea and turned it into a real product in just 8 weeks. The way they built it saved us months of headaches down the road."
Numbers up front, because most firms make you book a call to hear them.
A single-purpose pipeline (one document type, one destination system, validation rules, a working review queue) runs $8,000 to $20,000 fixed price and ships in 3 to 4 weeks. A multi-step workflow (classification across several document types, review queue, integrations into your ERP or claims system, an evaluation suite built from your historical documents) runs $20,000 to $45,000 over 5 to 7 weeks.
Running costs are lower than teams expect. Production inference typically lands between $50 and $2,000 a month, and good engineering cuts that 3 to 10x: a small model classifies every page for pennies, the expensive model only reads the documents that need it, and repeated vendor layouts get cached instead of re-processed.
Set that against the manual baseline. A clerk keying 2,000 invoices a month at five minutes each spends about 166 hours, a full-time job. At a $28 per hour loaded cost, that's roughly $56,000 a year against a build you pay for once.
Whoever you hire, hold two lines: you get the repo, and you get support after launch. We hand over 100% code ownership and 30 days of post-launch support on every engagement, and we take on two engagements per quarter so each one actually ships. If a firm won't give you the repo, walk away.
If you process a few hundred standard US invoices a month straight into QuickBooks, an off-the-shelf IDP subscription is the right answer, and we'll tell you so. Buy before you build when your documents are standard and the workflow ends at "data lands in the accounting tool".
Build custom when the documents are yours alone (industry forms, multi-document packets, handwriting), when the workflow after extraction is the real value (matching, approvals, routing), or when an off-the-shelf tool's error rate quietly costs more than its subscription saves. Either way, buy the outcome, not the model. Model names change quarterly; owned software compounds.
OCR turns pixels into text and stops. Intelligent document processing is the full pipeline: classify the document, extract fields with confidence scores, validate against business rules, route exceptions to humans, and post clean data into your systems. OCR is one stage out of five.
Well-engineered pipelines reach 95 to 99%+ per field on printed documents. Whole-document accuracy depends on how many fields you need, which is why the exponent math above matters more than any headline number. The practical goal is a high straight-through rate with a review queue, not a perfect model.
Mostly, yes. Modern vision models read legible handwriting and imperfect scans, but with lower confidence, which is exactly what the pipeline is built for: low-confidence fields route to a human, so a bad scan costs a minute of review instead of a wrong payment.
3 to 4 weeks for a single document type with a review queue; 5 to 7 weeks for multi-type classification with system integrations. Our typical engagement runs 4 to 8 weeks from kickoff to live deployment.
Not in the old sense; you're not training a model from scratch. You do need a few hundred real historical documents with known-correct values to build the evaluation suite, and if you can export last quarter's processed invoices, you already have that.
Skip the vendor demo on sample files. Pull 100 recent documents from your real queue, rotated scans and 40-line invoices included, and count what each one costs you in minutes today. That number is your business case.
If you want a second pair of eyes on it, book a free 30-minute scoping call. We respond within two business days, and if an off-the-shelf tool covers your case, that's exactly what we'll tell you.
Book a scoping call or see how we build extraction pipelines on our AI agent development page.