Exim Routes AI Document Processor
Exim Routes, a logistics and trade platform, receives bookings, invoices, bills of lading, permits and compliance certificates from shippers, carriers and agents every day. Each one arrived in a different layout and had…
Key achievement
88–98% field accuracy automating shipment document extraction, from mailbox to database
88–98%
Field Accuracy
5
Document Types Automated
1 across all runs
Fabricated Values
Eliminated
Manual Re-keying
The Challenge: Shipment Documents Still Read by Hand
Exim Routes, a logistics and trade platform, receives bookings, invoices, bills of lading, permits and compliance certificates from shippers, carriers and agents every day. Each one arrived in a different layout and had to be read and keyed into the system by hand — slow, repetitive, and one typo away from a delayed shipment.
Document Variety Made Automation Fragile
- Carriers, forwarders and customs authorities each use their own document layout and field names.
- Inputs ranged from clean PDFs to scanned slips, Excel sheets and forwarded emails.
- A single misread field — a container or booking number — can hold up a shipment at customs.
- Rule-based OCR and fixed templates broke every time a carrier updated its format.
DevSecCops Solution: A Graded, Self-Correcting Document Pipeline
DevSecCops built a LangGraph multi-agent workflow on AWS Bedrock (Claude Sonnet 5 and Haiku 4.5) that classifies each incoming document, routes it to a specialist extraction agent, and grades the result before it ever reaches the database. Agents, schemas and prompts are defined entirely in YAML, so onboarding a new document type is a config change, not a code release.
How It Works
- Automatic intake from a monitored mailbox or direct upload, deduplicated by Gmail message ID and SHA-256 file hash so retries and re-sent emails never create a duplicate record.
- Converts PDFs, scanned pages, Excel and CSV to text, falling back to Bedrock vision OCR when a scanned page has too little extractable text.
- A classifier reads the document and hands it to one of five specialist extractor agents — booking confirmations, bills of lading, commercial invoices, customs declarations and compliance certificates.
- An optional human-confirmation step lets an operator correct a misclassified document before extraction runs.
- A grading model scores every extraction for groundedness and completeness on a 0–1 scale, feeding back field-level corrections and retrying up to 3 times below a 0.85 threshold.
Built for Trust: Grounding, Grading and Audit Trail
Every extracted value is returned with its source location and checked against the original document text — anything that isn't actually printed on the page is dropped rather than guessed. Final results, source files and every LLM call are stored with a full audit trail in PostgreSQL and traced in LangSmith, so any extracted field can be traced back to the document and model call that produced it.
Business Impact: From Manual Keying to Graded Automation
- 88–98% of printed fields extracted correctly across 8 real client documents, hand-graded against the source.
- Just 1 fabricated value across all evaluation runs — the grounding check catches the rest before they reach the database.
- 5 document types live today, each one a YAML file rather than a code change, so new formats onboard fast.
- Idempotent intake and bounded retries mean crashes, restarts and re-sent emails never create duplicate or stuck records.
- Per-document LLM cost and token tracing gives operations a clear view of processing cost as volume scales.
Ready to achieve similar results?
Talk to our engineers about your cloud challenge. We'll get back to you within one business day.
Trusted by forward-thinking teams

















