Skip to content

Nairobi · East Africa

Case study · Logistics & Distribution

AI Document Processing Cuts Shipment Paperwork Time by 84% for a 3PL

OCR and LLM extraction with human review turned waybills, invoices and customs documents into clean WMS and ERP data for a regional freight firm.

Client
Regional freight forwarder and 3PL operator (name withheld under NDA)
Location
Nairobi & Mombasa, Kenya; Kampala, Uganda
Duration
18 weeks
Services
AI & Automation, Software Development, Systems Integration, Data Protection Advisory
Container trucks heading inland on a Kenyan highway

-84%

Paperwork time per shipment

-86%

Data-entry errors

71%

Documents processed without edits

-63%

Customer status calls

Challenge

Clerks keyed details from about 4,500 waybills, invoices and customs documents a week by hand, causing delays, costly errors and a flood of customer status calls.

Solution

We built an OCR and LLM extraction pipeline with confidence thresholds, a human review queue and an audit log, integrated with the client's WMS, ERP and WhatsApp.

Impact

Document handling time per shipment fell from 38 to 6 minutes, keying errors dropped 86% and customer status calls fell by nearly two thirds.

About the client

The client is a freight forwarding and third-party logistics (3PL) company headquartered in Nairobi, with a port office in Mombasa, a bonded warehouse near Jomo Kenyatta International Airport and a branch in Kampala. It handles sea and air imports, transit cargo moving along the Northern Corridor into Uganda, and contract warehousing for around 60 retail and FMCG customers. The company employs about 280 people, including licensed customs agents.

Every shipment generates paperwork: bills of lading and air waybills, commercial invoices, packing lists, delivery notes, certificates of origin and supporting documents for customs entries. Most of it arrives as scanned PDFs, phone photos or email attachments.

The challenge

A team of 16 clerks re-typed the key fields from roughly 4,500 documents a week into the warehouse management system (WMS), the Business Central ERP and the worksheets customs agents used to prepare declarations. Our time study found that each shipment file took an average of 38 minutes of keying and cross-checking.

The manual process caused problems well beyond staff time:

  • A field-level error rate of about 4.2%, typically wrong HS codes, mistyped container numbers or quantities that did not match the packing list. Errors led to customs queries, amended entries and, occasionally, demurrage charges at the port.
  • A backlog that grew to two days during peak season, delaying warehouse receiving and invoicing.
  • Around 1,900 calls and emails a month from customers asking where their shipment was, because status updates depended on someone remembering to send them.
  • Personal data (consignee names, phone numbers, ID and KRA PIN details) sitting in shared mailboxes and spreadsheets with no access control, a growing concern under the Kenya Data Protection Act 2019.

Objectives

  1. Extract structured data from the main document types automatically, with accuracy at least as good as manual keying.
  2. Keep a human in control of any field the system is unsure about, and of every customs-related decision.
  3. Push verified data straight into the WMS and ERP without re-typing.
  4. Notify customers automatically at key shipment milestones.
  5. Handle personal data lawfully, with access controls, retention rules and a full audit trail.

Our approach

Discovery & audit

We began with a three-week study of 2,000 historical documents across eight document types, sorted by source, layout and quality. Around 30% were phone photos, often skewed or poorly lit. We mapped every field the business actually used downstream and found that clerks were keying about 40% more fields than any system required. Trimming those alone saved time before any AI was involved.

We also completed a data protection impact assessment (DPIA) with the client's data protection officer, covering what personal data was processed, where it would be stored and how cross-border processing would be safeguarded.

Design

The pipeline works in four stages. First, OCR converts each document into text with layout information. Second, a large language model, accessed through an enterprise API under a data processing agreement that prohibits retention or training on client data, maps that text into a fixed schema for each document type. Third, validation rules check the output: container numbers against the ISO 6346 check digit, HS codes against the tariff list, invoice totals against line items, and quantities across invoice and packing list. Fourth, each field gets a confidence score combining the model output and the validation results.

Fields above the agreed threshold pass automatically. Anything below it, or any failed validation, goes to a review queue where a clerk sees the document image beside the extracted data, with uncertain fields highlighted. Customs-related data is never lodged automatically. The system pre-fills a declaration worksheet, and a licensed customs agent reviews it and lodges the entry through KRA's iCMS and the KenTrade single window as before.

Deployment

We launched with air waybills and commercial invoices, the two highest-volume types, running the new system in parallel with manual keying for three weeks so the team could compare outputs field by field. Thresholds were set conservatively at first and relaxed only once measured accuracy justified it. Other document types followed in two further releases, and the Kampala branch joined in the final phase.

Solution architecture

ComponentTechnologyRole
IntakeShared mailbox watcher, upload portal, WhatsApp document captureCollects documents from email, staff and drivers
OCRAzure AI Document IntelligenceText and layout extraction, including phone photos
ExtractionLLM via enterprise API with fixed JSON schemasMaps text to structured fields per document type
ValidationPython rules serviceCheck digits, HS codes, totals and cross-document matching
Review queueVue.js console with role-based accessHuman verification of low-confidence fields
IntegrationFastAPI services, PostgreSQLPosts verified data to WMS and Business Central
NotificationsWhatsApp Business PlatformMilestone updates to customers who opted in
GovernanceImmutable audit log, retention jobsWho changed what and when, automatic deletion schedules

Long warehouse aisles with high racking stocked with palletised goodsVerified shipment data now reaches the WMS before goods arrive, so receiving teams know what to expect at the bonded warehouse.

Safeguards

  • Confidence thresholds per field and document type, reviewed monthly against sampled accuracy checks.
  • Audit log recording every extraction, edit and approval with user and timestamp, kept for seven years in line with customs record requirements.
  • Data minimisation and retention: only required fields are stored, ID numbers are masked in the review console, and source images are deleted on a defined schedule.
  • Access control: reviewers see only their branch's documents, and all access uses single sign-on with MFA.
  • Customer consent: WhatsApp updates go only to contacts who have opted in, with an easy opt-out, as required under the Kenya Data Protection Act 2019.

Implementation timeline

PhaseWeeksKey deliverables
Discovery & DPIA1–3Document study, field mapping, data protection impact assessment
Build release 14–8OCR and LLM pipeline, validation rules, review console
Parallel run9–11Air waybills and invoices, side-by-side accuracy measurement
Release 212–14Bills of lading, packing lists, WMS and ERP integration
Release 3 & Kampala15–17Customs worksheets, WhatsApp notifications, Uganda branch
Handover18Threshold governance process, runbooks, staff training

Results

MetricBeforeAfterChange
Document handling time per shipment38 min6 min-84%
Field-level data-entry error rate4.2%0.6%-86%
Documents processed without manual edits0%71%+71 pts
Customer status calls per month~1,900~700-63%

Results are measured over the three months after the final release. Peak-season backlogs have not recurred, and warehouse receiving now starts with verified data instead of a pile of paper. Customs queries linked to data-entry mistakes have fallen noticeably, which the client's customs team attributes mostly to the cross-document checks rather than the AI extraction itself. Of the 16 clerks, nine now run the review queue and seven have moved into exceptions handling and customer service roles.

What made the difference

  • Validation rules alongside the model. Simple deterministic checks caught most of the errors that matter, and gave reviewers a clear reason for every flag.
  • Parallel running. Three weeks of side-by-side comparison gave the operations team hard evidence, not promises, before they trusted the system.
  • Clear lines for human decisions. Keeping customs lodgement with licensed agents made the project easier to approve and kept compliance responsibility where it belongs.
  • Data protection from the start. Doing the DPIA in week one shaped the design and avoided rework later.

What's next

TechBytes provides ongoing managed support, including monitoring of extraction accuracy, monthly threshold reviews and updates when suppliers change document layouts. The next phase will extend the pipeline to proof-of-delivery photos captured by drivers and add a Swahili option to the WhatsApp notifications, followed by a pilot at a planned Dar es Salaam office.

Talk to an engineer

Ready to make IT the predictable part of your business?

Tell us what you're planning. A solutions engineer will scope it and send a fixed-price proposal in USD.

Chat on WhatsApp

Prefer a call? +254 711 974 716

WhatsApp