CargoTrust AI — Shipping Document Verifier
A shipping document verifier that checks each Shipping Instruction against its draft Bill of Lading before the BL is issued, flags discrepancies in seven critical fields and drafts the amendment request. Anything it cannot read or decide goes to a person, with the evidence.

Overview
CargoTrust reads customer emails and documents in whatever format they arrive (text, PDF, Word, Excel, scanned PDFs and phone photos), compares the seven fields that cause costly BL amendments, and drafts the reply to the customer. When it cannot decide reliably, it sends the case to a person with the reason and the evidence instead of guessing. It was built for the Averis × Monash Hackathon 2026 problem statement. A live demo runs on Vercel with a read-only demo account on the sign-in page; a Docker setup is prepared for running it on an organisation's own server.
The problem
A wrong consignee, port or weight on a Bill of Lading means amendment fees, delayed release and cargo held at the port. Documentation desks check these fields by eye, document by document, across hundreds of emails a day.
Objectives
- Compare every Shipping Instruction with its draft Bill of Lading across the seven fields that cause BL amendments
- Read documents in any format, including scanned PDFs and phone photos
- Never guess: escalate unreadable, incomplete or wrong documents to a person with the reason and the evidence
- Make every decision traceable to the source line behind each value
Intended users
Shipping documentation desks at ports, terminals and freight forwarders that check draft Bills of Lading against customers' Shipping Instructions.
Features
- Intake of SI and draft BL files (PDF, Word, Excel, text, scans and phone photos) and of customer emails saved as .eml
- Email classification into document check, SI request, invoice query, general or spam, with phishing screened first
- Field extraction that maps label variants ("Port of Loading", "Load Port", "POL") to one field and never treats placeholders such as "TBA" as values
- Comparison with the SI as reference: exact company names, ports by city and UN/LOCODE, numbers after unit conversion
- Three outcomes: Match, Discrepancy with the exact fields, or Needs review with a reason
- Step-by-step decision trace, the source line for every value and a drafted reply (amendment request, confirmation or request for the missing document)
- Review queue where operators approve, reject or correct values, with corrections re-running the comparison
- Optional AI reading of scans and photos with Claude's vision model; OCR runs as an independent cross-check
- Accounts with admin, operator and viewer roles, an activity log of every action, CSV export and a read-only demo account
Architecture & implementation
Next.js 14 and TypeScript, with a rule-based verification engine (classify, read, extract, normalise, compare, trace, reply). Readers detect the format from the bytes and rebuild every document into one canonical "Label: value" layout: PDFs from page geometry with pdf.js, Word and Excel files directly, and scans with Tesseract OCR or, when an organisation adds its own Anthropic API key, Claude's vision model. The AI only transcribes; deterministic rules make every decision, so the same input always gives the same answer. Data lives in a local data folder (JSON with atomic writes, plus files) or, on serverless hosting, in Postgres and a private Vercel Blob store through the same code path. The demo runs on Vercel with Neon Postgres in Frankfurt; a Dockerfile and Compose file target on-premise use.
My contribution
Built the project end to end in its repository: the verification engine, the document readers and the OCR and AI reading path, the operator console, sign-in with roles and the activity log, the benchmark and mutation tests, and both deployment setups (Vercel demo and Docker).
Challenges & solutions
Challenge
Scanned PDFs and phone photos have no text layer, and OCR misreads company names and weights.
Solution
Optional transcription with Claude's vision model into the same label/value layout as the other readers, instructed to copy exactly what is printed and mark anything unclear; OCR still runs as a cross-check, and unclear scans go to a person.
Challenge
The same field appears under many labels and with placeholders such as "TBA" or "____MT".
Solution
A label dictionary that maps synonyms to one field, placeholder detection, and a fallback to the container table for totals.
Challenge
Avoiding rules that only fit the benchmark data.
Solution
Every rule targets a general pattern, and a mutation benchmark rewrites each clean document pair 15 ways the engine never saw.
Challenge
Serverless hosting has no lasting local disk.
Solution
A storage layer that keeps data on local disk by default and switches to Postgres and a private Blob store when configured, without code changes.
Screenshots




Outcomes & evaluation
Scored 1.0000 on the Averis × Monash 2026 benchmark, graded by the organisers' own scorer on 520 emails against a private answer key: classification macro-F1 1.000, 46 of 46 defects caught on the exact fields and 20 of 20 escalations with no false alarms. In the mutation benchmark, all 448 harmless rewrites stayed clean and all 435 planted defects were caught on exactly the planted field. The demo is live on Vercel; the Docker image has not yet been built and verified on a Docker host.
Lessons learned
- Keep AI out of the decision path: let the model read and let deterministic rules decide
- Escalating with evidence is safer than guessing when a document is unclear
- Mutation testing shows whether rules generalise beyond the benchmark data
Continue reading
Full-Stack Application
AI-Powered Final Year Project Repository & Knowledge Management System
An AI-assisted repository for the School of Computing and Informatics with semantic search, embeddings-based project similarity comparison, summarisation and keyword extraction.
Case studyFull-Stack Application
AL-QISC Website — Al-Quran and Islamic Club, AIU
The official website of the Al-Quran and Islamic Club at Albukhary International University — a live Next.js and Firebase platform for the club's departments, programmes, classes, events, news and community activities, sharing one backend with the club's mobile app.
Case study