Every company has a pile of documents that someone retypes: supplier invoices, delivery notes, orders arriving as PDFs, bank statements, contracts. Modern AI models read these documents well, and a demo is easy. Production is where projects fail. This is what separates the two, from the systems we have built.
1. Start from the target, not from the document
Define exactly what the downstream system needs: which fields, which types and formats, which are mandatory. Extraction is only useful if its output can be booked, matched or posted without a person reformatting it. A fixed schema, JSON with validation, is the contract between the AI and the rest of your software.
2. Validate everything the model returns
Models sound confident even when they are wrong. Every extracted document should pass checks that do not depend on the model:
- Totals: line items, VAT and the grand total must add up.
- Tax IDs: correct format and checksum. A Croatian OIB, for example, has a control digit.
- Dates: plausible, not in the future, consistent with the due date.
- Master data: the supplier exists, the IBAN matches the one on file, the order number is open.
A document that fails a check is not an error. It is a document for a person to look at.
3. Design for the person in the loop
The goal is not 100% automation on day one. The goal is that people only see the documents that need them, with the problem highlighted. A good review screen shows the original next to the extracted fields, marks what failed and why, and lets the reviewer fix it in seconds. Every correction is data you can use to improve prompts and rules.
4. Measure per field, not per document
“95% accurate” means little. Track accuracy per field and per supplier, how many documents go straight through, and how long reviews take. Some fields, like an invoice number, must be exact. Others, like a free-text description, can be approximate.
5. Mind the cost and the data
- Route simple, well-known layouts through cheaper models or plain rules, and keep larger models for the hard cases.
- Keep documents and extracted data in the EU where required, log what was sent where, and never train on client data without permission.
- Cache results so that reprocessing a document does not cost twice.
6. Integrate where the work happens
Extraction pays off when the result lands directly in the ERP, the invoicing system or the approval workflow: an incoming invoice already matched to its purchase order, waiting for one click. In Croatia, structured eRačun invoices now make part of this unnecessary for domestic B2B purchases. PDFs from foreign suppliers, delivery notes, orders and contracts remain.
Where to start
Pick one document type with real volume, collect a hundred real samples, define the schema and the checks, and measure. When it works for that one type, the rest follows.
We build AI automation like this for our clients and into our own products. If someone in your company retypes documents every day, see how we work or talk to us.