AI Agents for Logistics

Autonomous AI agents that handle specific logistics workflows end-to-end, carrier booking, customs documentation, delivery exception handling, and more.

Built for freight brokers, 3PLs, and logistics operators that need agents taking actions in operational workflows, not just reporting status.

  • Carrier selection and booking agents that compare rates, apply routing rules, and confirm bookings

  • Customs document agents that generate commercial invoices, packing lists, and certificates of origin from shipment data

  • Delivery exception agents that classify exceptions, apply resolution logic, and escalate only genuine outliers

  • Shipment status agents that pull live tracking data and push structured updates to customers and internal systems

RaftLabs builds autonomous AI agents for logistics workflows, carrier selection and booking, customs document generation, delivery exception handling, shipment status updates, invoice reconciliation, and demand forecasting. Unlike rule-based automation, these agents reason across shipment data, carrier APIs, and customs requirements to take multi-step actions within defined guardrails. Most logistics AI agent projects deliver in 10-14 weeks at a fixed cost.

Recognition

Sound familiar?

  • Your dispatchers spending hours comparing carrier rates and booking shipments manually for every order?

  • Customs documentation requiring staff to re-enter the same shipment data across multiple portals and systems?

  • Delivery exception notifications consuming dispatcher time on routine updates that follow predictable resolution paths?

Companies we've built for

Vodafone
Nike
Microsoft
Cisco
T-Mobile
Aldi
Heineken
GE
Products shipped
100+
Integration ready
TMS
Cost delivery
Fixed
Week delivery
10-14

AI agents that act, not just report

A tracking dashboard shows you what happened. An AI agent decides what to do about it. When a shipment misses a checkpoint, an agent can classify the exception, check carrier ETAs, draft the customer update, and route the case to a dispatcher only when the situation falls outside its resolution logic.

We build logistics AI agents with defined scope, explicit escalation rules, and integration into the carrier APIs, TMS platforms, and customs systems your operations already depend on. Each agent handles one workflow well. Integration is scoped during discovery because that is where most logistics projects carry the most hidden complexity.

What we build

  1. Carrier selection and booking agent

    The agent queries connected carrier APIs and rate engines, FedEx, UPS, DHL, regional LTL carriers, and freight brokers exposing REST or EDI interfaces, using the shipment parameters (origin, destination, weight, dimensions, service level, and any shipper-specific routing rules) as the structured input. Rate comparison applies your routing guide logic: preferred carriers per lane, rate cap thresholds, service level requirements, and any carrier scorecards configured in the TMS.

    When a carrier meets all selection criteria, the agent generates the booking request, submits it via the carrier's booking API or EDI 204 transaction, and writes the confirmation back to the TMS record, including PRO number, estimated pickup window, and carrier contact. Confirmation is sent to the warehouse team via the configured notification channel (email, Slack, or TMS task) with the full booking summary.

    The agent handles the matching and booking; business logic for lane exceptions, spot-market decisions, and new carrier relationships remains with your team. Bookings outside the routing guide, loads requiring manual negotiation, oversized freight, or hazmat shipments with carrier-specific requirements, are flagged with the specific gap and routed to the appropriate person. The audit trail captures every rate query, carrier ranked, and booking submitted, so lane performance data accumulates automatically without dispatcher data entry.

    Stateful workflow management using LangGraph models the multi-step booking process, rate query, carrier ranking, routing guide match, booking submission, confirmation write-back, as a directed graph with explicit state transitions. Human-in-the-loop checkpoints are configurable per shipment type, so high-value or sensitive lanes can require approval before the agent submits a booking.

  2. Customs document automation agent

    The agent generates the customs document set from structured shipment data already in your TMS or order management system: commercial invoice, packing list, certificate of origin, shipper's export declaration, and HS code classification. It reads product master data (description, country of manufacture, HS code if available, value per unit) and shipment details (consignee, incoterms, declared value, quantity) to populate each document template.

    HS code classification uses a combination of a trained classification model and a customs knowledge base. For products with existing HS codes in the product master, the agent validates the classification against the current tariff schedule and flags any codes that have changed. For new products without an existing code, the agent proposes a classification with a confidence score and routes low-confidence classifications to a trade compliance reviewer before the document is finalised. The reviewer sees the proposed code, the classification rationale, and any similar products already classified, enough context to confirm or override in seconds rather than researching from scratch.

    Document generation produces structured outputs formatted for the destination country's requirements. For shipments to the United States, the agent generates the CBP Form 7501 electronic equivalent via ACE filing. For EU destinations, it produces the SAD (Single Administrative Document) fields required for customs entry. Country-specific requirements (licences, certificates, phytosanitary documents) are flagged by the agent when the product category and destination combination triggers them.

    The agent does not submit to customs authorities without a human review step for new trade lanes. For established lanes with validated document templates and stable product catalogs, the review step can be set to exception-only: the agent submits automatically and a compliance reviewer sees only documents that triggered a validation warning. Every document generated, validated, and submitted is captured in the audit trail with the input data, the generated output, and the reviewer action.

  3. Delivery exception handling agent

    The agent monitors live tracking feeds from carrier APIs and parcel data aggregators (project44, Fourkites, or direct carrier polling) and classifies each exception event against a defined taxonomy: weather delay, missed pickup, address correction required, customs hold, damage reported, refused delivery, and lost in transit. Classification uses the carrier exception code, the shipment's current location, historical carrier performance on that lane, and any open exceptions already logged for the same consignee.

    Resolution logic applies automatically for exception classes with defined playbooks. A weather delay on a carrier with a 98% on-time recovery rate on that lane triggers a customer notification with the revised ETA and no dispatcher action. An address correction exception triggers a structured request to the consignee via email or SMS for the corrected address, submits the address update to the carrier, and updates the TMS record. A damage report triggers a carrier claim initiation workflow, the agent generates the claim form with the shipment details, photos from the carrier report where available, and the declared value, and routes it to the claims team with the case already documented.

    Escalation to a dispatcher happens when the exception falls outside the resolution taxonomy: a shipment has been in exception status for longer than the lane's typical resolution window, a high-value order is affected, the consignee has a flagged service level agreement, or the resolution action requires commercial judgment the agent is not configured to make. The dispatcher receives the exception with the agent's classification, the resolution actions already attempted, and the recommended next step, not a raw tracking event requiring interpretation.

    The agent processes exception events across the entire active shipment base continuously, not in batches. Dispatchers handle the outliers; the agent handles the volume of routine exceptions that represent the majority of exception events for any carrier mix.

  4. Shipment status update agent

    The agent pulls structured tracking data from carrier APIs, parcel aggregators, and ocean carrier platforms on the configured polling interval, normalises the event data to a unified status taxonomy (picked up, in transit, out for delivery, delivered, exception), and pushes structured updates to the configured downstream systems: customer-facing portals, ERP shipment records, e-commerce platform order status, and internal Slack or Teams channels for high-priority shipments.

    Customer-facing update messages are generated from the tracking event data using a message template system with personalisation tokens: consignee name, order reference, carrier, estimated delivery date, and any exception context. Message tone and content are configurable per customer segment, retail B2C consignees receive consumer-formatted messages, B2B recipients receive structured operational updates. Delivery confirmation messages include the delivery timestamp and, where the carrier API provides it, the delivery location description (front door, reception, neighbour, etc.).

    The agent maintains a status history for each shipment, enabling on-demand status retrieval without polling the carrier API for every customer query. A customer service agent asking "where is order 98765?" gets the answer from the agent's status cache in seconds rather than waiting for a live carrier API call. The cache is updated on each polling cycle and invalidated when a delivery or exception event is received.

    High-priority shipments, defined by order value, customer tier, or manual flag in the TMS, receive more frequent polling and immediate push notifications on any status change. Standard shipments are polled on the default interval. The frequency tiers are configurable without code changes.

  5. Invoice reconciliation agent

    The agent matches carrier invoices against rate confirmations, BOLs, and TMS shipment records to identify billing discrepancies before payment. The matching logic checks billed weight against shipment weight, billed accessorials against the accessorials recorded in the TMS (fuel surcharge, residential delivery, liftgate, inside delivery), billed rate against the contracted rate for the lane, and billed shipment count against the BOL count for multi-piece shipments.

    Discrepancies are classified by type and amount: weight disputes, accessorial disputes, rate disputes, and duplicate invoices. For discrepancies below a configurable threshold, the agent generates a dispute notice to the carrier with the shipment reference, the billed amount, the expected amount, and the supporting documentation, the matched rate confirmation and TMS record, and routes it through the AP workflow with a hold flag until the dispute is resolved. Discrepancies above the threshold are escalated to a freight auditor with the full matched record for review before any dispute is filed.

    The agent processes invoices in the format the carrier delivers them: EDI 210 (carrier freight invoice), PDF invoices parsed via document intelligence, or structured CSV from carrier billing portals. Invoice ingestion handles all three formats and normalises them to the same matching schema before the reconciliation logic runs. This means the agent handles the full carrier mix without requiring each carrier to change their billing format.

    Recovery data accumulates automatically: every dispute filed, every carrier response, and every resolution is captured in the audit trail. Monthly reconciliation reports are generated showing total billed, total disputed, total recovered, and dispute resolution rate by carrier, giving the freight finance team the data they need to evaluate carrier billing accuracy without manual aggregation.

  6. Demand forecasting agent

    The agent analyses historical shipment volume, seasonal patterns, customer order history, and any external demand signals (confirmed customer purchase orders, promotional calendars, industry index data) to generate lane-level and carrier-capacity forecasts across the configurable planning horizon. Forecasts are produced at the granularity your procurement and carrier relations teams work at: volume by lane per week, volume by carrier per month, and total network capacity requirement per quarter.

    The forecasting model is built on time-series methods (SARIMA for seasonal patterns with stable history, Prophet for lanes with irregular seasonality or external regressor data) with a fallback to exponential smoothing for lanes with insufficient history. The model selection and parameter tuning runs automatically when the forecast is retrained on the updated shipment history. Forecast accuracy metrics (MAPE by lane, bias by carrier) are published alongside each forecast run so the procurement team can see which lanes the model handles well and which require manual adjustment.

    The agent surfaces capacity risk signals: lanes where the forecast volume exceeds the contracted carrier capacity, lanes where carrier performance has degraded below the threshold that would make the current volume commitment problematic, and lanes where historical variance is high enough that the point forecast understates the likely capacity requirement. Each signal includes the supporting data, the forecast volume, the contracted capacity, the carrier's recent on-time performance, and the historical variance, so the carrier relations team can act on specific evidence rather than a generic alert.

    Procurement actions (requesting spot capacity, adjusting contracted volumes at renewal, shifting volume between carriers) remain with the carrier relations team. The agent provides the forecast and the risk signals; the commercial decisions stay with the people who manage the carrier relationships.

Frequently asked questions

A TMS workflow automation executes a predefined rule: if shipment weight exceeds 150 lbs and destination is residential, apply liftgate accessorial. The rule runs the same way every time. An AI agent reasons over variable inputs: it can read a carrier invoice in PDF format, match it against the rate confirmation in the TMS, identify that the billed liftgate was not in the original booking, and generate a dispute notice, all without a human mapping every field.

The architectural difference is that agents operate as stateful, multi-step processes that can interpret unstructured inputs (PDFs, email text, carrier exception codes), call external systems (carrier APIs, customs portals, rate engines), and apply judgment logic that would require a rule for every combination in a traditional automation setup. A TMS workflow automation is fast and reliable for structured, high-frequency, low-variance processes. An AI agent is the right tool when the inputs are variable, the exception surface is large, or the workflow spans multiple systems with different data formats.

In logistics, the workflows that benefit most from agents are the ones where the current "automation" is actually a person doing the same interpretive work every day: reading carrier invoices against rate confirmations, classifying delivery exceptions by type and resolution path, or pulling HS codes for new products from a tariff schedule. These are not low-variance processes, they require interpretation on every instance, which is why they have not been automated by rules.

We integrate with TMS platforms that expose REST APIs or support EDI transaction sets. Transplace, MercuryGate, Oracle Transportation Management, Manhattan TMS, and BluJay (now E2open) all expose REST APIs for shipment data, booking confirmation, and status updates. For platforms without a REST API, EDI integration using the standard freight transaction set (EDI 204 for load tender, EDI 214 for shipment status, EDI 210 for carrier invoice) is the integration path.

Carrier API integration covers the major parcel and LTL carriers: FedEx Ship Manager API, UPS Developer Kit, DHL Express API, USPS Web Tools. For LTL carriers, the NMFTA standard EDI transaction set (204/214/210) is the baseline, with direct REST API integration available for carriers that have published one (XPO, Old Dominion, Saia, Estes).

For visibility and tracking aggregation, we integrate with project44 and Fourkites where those platforms are already in the tech stack. For customs, the US ACE Automated Export System API and CBP Document Image System are the integration targets for US export filing. EU customs integration targets the national AES systems via the CC departure message format.

Integration scope is confirmed during discovery. The variance in what different TMS configurations expose via API, and what carrier EDI relationships are already in place, is large enough to change the project scope materially. We scope integration explicitly so the estimate reflects your actual stack, not a generic logistics architecture.

A focused logistics AI agent, one workflow (for example, a carrier booking agent for one carrier set and one TMS, or a delivery exception handler for one carrier mix), defined escalation logic, and standard integration, typically runs $25,000--$60,000 and delivers in 10--14 weeks. This includes the LangGraph workflow implementation, TMS and carrier API integration, human-in-the-loop checkpoint UI, and the audit trail.

A multi-agent system covering carrier booking, customs document generation, and delivery exception handling with TMS write-back and carrier API integration typically runs $60,000--$130,000. The higher end applies when customs integration requires country-specific filing logic for multiple destination markets, or when the carrier mix includes non-standard EDI configurations that require custom mapping.

Cost is driven by the number of carrier integrations, TMS API complexity, and customs destination coverage. We scope and price every project before starting. The scoping document defines the workflow state machine, the integration points, the escalation logic, and the acceptance criteria.

Carrier data normalisation is built into the agent architecture. The integration layer translates each carrier's native format, REST JSON response, EDI transaction, PDF invoice, into a unified internal schema before the agent's reasoning logic runs. This means the agent applies the same business logic regardless of whether the carrier delivers data via REST API, EDI 214, or a structured tracking email.

For carrier invoices specifically, the document intelligence layer handles PDF parsing. Carrier invoices vary in layout, but the core fields (shipment reference, service type, billed weight, accessorials, total charge) are consistent enough that a trained extraction model handles the majority of carriers in the first pass. Carriers with unusual invoice formats are handled by configuring extraction rules specific to that carrier's template. Extraction confidence scores flag low-confidence parses for human review rather than passing uncertain data into the reconciliation logic.

EDI mapping is done per trading partner during the integration setup phase. The mapping configuration is maintained in the integration layer, so adding a new carrier requires configuring the EDI map for that carrier, not modifying the agent's core logic. For carriers that switch from EDI to REST API (or vice versa), updating the integration layer does not require changes to the agent workflow.

What clients say

What our clients say

Three-year average engagement. Founders and operators describing the work in their own words. No marketing varnish.

Charles E.
Charles E.
USA flagUSA
Entrepreneur at Aggie Technologies

All of the sprints were completed on schedule and on budget. We highly recommend RaftLabs!

Related services

Talk to us about your logistics AI agent project.

Tell us the workflow you want to automate, your TMS platform, and your carrier mix. We will scope what an agent can handle and give you a fixed cost.

  • Scope and cost agreed before work starts. No surprises. No obligation.
  • Working prototype within 3 weeks of kickoff.
  • Pay by milestone. You see progress before each invoice.
  • 60-day post-launch warranty. Bug fixes, UI tweaks, and deployment support. No retainer.
  • All conversations are NDA-protected.