A case study in fail-loud document extraction

Freight paperwork in. Clean data out. Never a guessed dollar.

A production-minded rate-confirmation pipeline that adapts to broker layouts and stops uncertain dollar amounts before they contaminate operations. Open source; every number below is generated by the test suite.

Read the code

The problem

Skilled operators are still hand-typing rate-cons.

$1,299/moroughly, in VA spend
Every loadrekeyed into the TMS
One typocan distort a settlement

Broker PDFs drift: headers move, labels change, scans add noise, and multi-stop loads break assumptions. A generic copy-and-paste workflow turns that drift into manual review or, worse, quiet bad data.

Before / after

Before

  1. Open attachment
  2. Find load and stop data
  3. Retype every charge
  4. Spot-check the total

Queue grows with document volume.

After

  1. Detect broker layout
  2. Normalize fields
  3. Validate charges
  4. Send exceptions to review

Clean records flow; uncertainty stops.

The approach

Adapters absorb layout drift. Confidence gates protect the ledger.

Each broker layout has a small, testable adapter. The output is one stable JSON schema for load IDs, parties, stops, dates, equipment, references, and rates.

Every numeric field must match an unambiguous money token, and the stated total must equal its components. A weak result raises an explicit failure; the pipeline never guesses a dollar amount.

Measured, not claimed

Accuracy generated from the golden evaluation.

SampleAdapterFields matchedAccuracy
01_cindercone_classiccindercone-classic25/25100.00%
02_bluekestrel_modernblue-kestrel-modern24/24100.00%
03_moonridge_compactmoonridge-compact25/25100.00%
04_cindercone_scanned_noisecindercone-classic24/24100.00%
05_bluekestrel_missing_fieldsblue-kestrel-modern23/23100.00%
06_moonridge_multistopmoonridge-compact36/36100.00%
Six-sample total157/157100.00%

All six PDFs and every entity shown in this case study are synthetic. This fixture score is a regression baseline, not a claim about untested client documents.

About this project

Try it yourself — the whole pipeline is public.

Clone the repository and run make demo to reproduce every number on this page from the six synthetic PDFs. An interactive in-browser version — drop a PDF, watch the extraction, nothing uploaded anywhere — is the next milestone; the build spec lives in the repo's AGENTS.md. Built by Mark Ortega.