Case study · Docflow
AI document intake that reads freight paperwork and posts it to the ERP.
An AI-assisted pipeline that extracts data from invoices, bills of lading, and customs documents, validates it against the ERP, and sends only uncertain cases to a person for review.
- Sector
- Freight forwarding & logistics
- Services
- Scope
- Pilot to production
- Core stack
- Python, LLM APIs, PostgreSQL, AWS, Docker
This case study shows how we would approach a representative project of this kind. It is not a record of a specific client engagement: names, interfaces, and plans are examples, and outcomes are described as what would be measured rather than as results.
Scroll sideways to see the full screen
§ 01The situation
Where things stand.
The operations team at a freight forwarder processes thousands of documents a month: carrier invoices, bills of lading, packing lists, and customs declarations, arriving as PDFs, scans, and email attachments in countless layouts.
Each document is read and keyed into the ERP by hand. Peaks in volume create backlogs, errors surface weeks later as billing disputes, and experienced staff spend their time typing rather than resolving exceptions.
What makes it hard
Endless layouts
Hundreds of carriers and suppliers use their own formats, so template-based OCR breaks constantly.
Errors are expensive
A wrong container number or amount leads to disputes and delays, so accuracy matters more than speed.
Trust
The team will not accept a black box. They need to see where each value came from and correct it quickly.
ERP constraints
Data must match existing shipments, vendors, and charge codes before it can be posted.
§ 02The solution
What we would build.
Each part answers one of the problems above, and each can be delivered and tested on its own.
- Ingestion
- Documents collected from shared mailboxes and uploads, classified by type, and split when one PDF contains several documents.
- Extraction with evidence
- A language model extracts fields into a strict schema and records where on the page each value was found, so reviewers can verify it at a glance.
- Validation against the ERP
- Each result is checked: the shipment exists, the vendor matches, totals add up, and charge codes are valid.
- Confidence-based routing
- Documents that pass every check are posted automatically; anything uncertain goes to a review queue with the problem highlighted.
- Evaluation harness
- A labeled set of real documents scores every change to prompts, models, or rules before it reaches production.
- ERP posting & audit trail
- Approved data is written through the ERP's API, and every record links back to its source document.
§ 03Architecture
How the pieces fit.
A layered view of the proposed system. The highlighted component carries the logic the rest of the system depends on, so it is designed and tested first.
01 Sources
- Shared mailboxes
- Upload portal
- Scanner inbox
02 Processing
- Classification & splitting
- LLM extraction (structured)
- Validation rules
- Confidence scoring
03 People & systems
- Review queue
- ERP API connector
- Audit log
04 Platform
- Python workers
- Queues
- PostgreSQL
- AWS
- Evaluation pipeline
§ 04Delivery plan
Delivered in stages you can review.
Each stage ends with something working that you can evaluate before committing to the next.
Stage 01
3 weeks
Assessment
Sample documents, define fields and accuracy targets, and build the first evaluation set.
Stage 02
4 weeks
Prototype
Compare extraction approaches on the evaluation set and report accuracy, cost, and latency.
Stage 03
6 weeks
Pilot with review
One document type live, with every result approved by a person and quality tracked daily.
Stage 04
Ongoing
Production & expansion
Automatic posting for high-confidence documents, then further document types.
§ 05Outcomes
What you receive, and how success is measured.
Targets for each measure are agreed during discovery, using your current figures as the baseline, and reported on throughout delivery.
Deliverables
- Document pipeline and review application
- Evaluation set and automated scoring
- ERP integration with a full audit trail
- Monitoring of accuracy, cost, and processing time
- Operating guide for reviewers and administrators
Measured by
- Documents posted without manual correction
- Field-level accuracy on the evaluation set
- Time from document arrival to ERP posting
- Cost per processed document
§ 06Start a project
Planning something similar?
Describe where things stand today and what needs to change. We will reply with questions and an initial view of scope and approach.
- 01
Share the context
A short description of the project, your goals, and any constraints you already know about.
- 02
We review it
We read it carefully and reply with questions or an initial perspective on the problem.
- 03
A first conversation
A call to explore scope, approach, and whether we are the right fit for the work.