AI dispatch for trucking: the AI helpers suggest, you decide
Each AI helper? watches one thing that goes wrong. When it fires, the helper reads the fleet's data through typed tools, works the numbers with fixed-rule calculators (deterministic engines), and writes suggestions? to a queue for you. Nothing changes the customer's prices?, a route or a job until a person accepts it, or the policy for low-risk notes does. This page is the engineer's view; the rest of the site keeps to plain words.
Architecture
Next.js 16 · SQLite · pinned model · HEREReads are read-only. A state change only ever happens through the executor.
The three AI helpers
Reads every customer contract, calls the fuel surcharge (levy) engine per customer, and proposes a price (rate-card) update with the notice drafted only when the implied surcharge moves at least 0.5 points. Fixed and uncontracted surcharges are flagged, not changed.
Finds delivery jobs (loads) whose route crosses the event, plans a truck-legal detour around it with the routing service (HERE), then decides per job: proceed, new route, wait at the depot, or ask the dispatcher. Urgent and spoilable freight is never silently held.
Lists jobs with no driver and idle trucks, checks the driving-hours (HVNL fatigue) rules per candidate, and proposes the nearest legal reassignment or asks the dispatcher. Designed in full; this POC runs the rules without a model.
Governance rules
- Read or propose, never execute. Every tool is rated read or propose. The executor is the only code path that changes data, and it runs fixed logic per action kind.
- Pinned model, exact cost. One pinned model id per deployment. Tokens are priced per call from the usage report, so the cost meter is measured, not estimated.
- Hard caps in the runtime. A step cap, a per-run cost cap and a rolling 24-hour spend cap, all enforced in code and logged as safety-stop (guardrail) steps when they trip.
- Schema-checked arguments. Tool arguments are validated against the tool's JSON schema before the handler runs. A bad call is refused and the model is told why.
- Auto-execute only low risk. Customer notices and review flags execute at proposal time. Rate-card changes, re-routes, holds and reassignments wait for a dispatcher.
- Full trace, every run. Every system message, thought, tool call, result, guardrail and final summary is written to the database as it happens, and shown unedited behind "Details for engineers".
- Evals on the decision rules. The road-problem rules and the fuel surcharge engine have fixed test cases; the accuracy-tests (evals) page shows the latest pass rate, latency and cost per suite.
- Scripted fallback. With no API key, each agent runs a scripted plan over the same tools and data, so the UI, trace and approval flow behave identically.
Data sources, honestly
| Source | Used for | Status in this POC |
|---|---|---|
| Brisbane fleet, customers, loads | Trucks, contracts, in-flight loads | Seeded Fictional operator with realistic Queensland lanes and contract terms. |
| Diesel prices | Fuel agent trigger and levy engine | Referenced Seeded from ACCC-referenced 2026 Queensland retail levels; scenario shocks are simulated. |
| Road closures | Disruption agent trigger | Seeded / simulated 2026 Bruce and Stuart highway closures seeded from public reports; the QLDTraffic adapter exists but scenarios inject events directly. |
| HERE truck routing | Planned routes, detours, truck restrictions, map tiles | Live Real truck profiles (height, mass, axles) with avoid-areas for active events. |
| Open-Meteo | Weather samples along a route | Live Rain and wind gusts sampled at points along the polyline. |
| BoM warnings | Weather-event trigger | Designed Adapter stubbed; no live feed wired in this POC. |
| Language model | Fuel and disruption agent reasoning | Live, pinned Falls back to the scripted plan when no key is configured. |
Limitations
- Single operator, single SQLite file. No multi-tenant isolation beyond the account id on every row.
- Truck positions are seeded and nudged by scenarios; there is no truck-tracking (telematics) or EWD feed, so driving hours are derived from truck status.
- Customer notices are logged, not sent. Approving a rate-card change updates the contract row; it does not touch an invoicing system.
- The capacity agent runs rules only. Trade-offs the rules cannot rank (customer priority, backhaul value, subcontractor cost) are the Phase 2 model's job.
- Evals cover decision rules and the levy engine with fixed cases; they do not yet score the quality of the model's prose summaries.
- Rate limits and caps are per process; a restart resets the in-memory limiter.