← All case studies + AI/ML · 2025 – present · t-tms.com
TTMS Mailer logo Client project · Red Dog Logistics · Freight brokerage
Case · 44 · AI/ML · Agentic AI

An autonomous freight agent on top of T-TMS

An autonomous freight agent that never books a load it can’t verify.

Built for Red Dog Logistics. Lives in the dispatcher’s own Outlook. Scores carriers on a hundred-point scale, negotiates within margin guardrails, and stops the moment it isn’t sure. It runs while you sleep. It never overrides your judgment.

Vercel cron jobs
9
Daily 9 PM UTC cycle processes every enabled inbox
Point carrier score
100
Lane · rating · approval · insurance · active · response modifier
Per agent cycle
$0.01
~$7/month per active user · economical enough to run 24/7
Rows in production
455,057
Hostinger-hosted Supabase VPS
Client
Red Dog Logistics · US-national freight brokerage
Industry
Truckload freight · shipper-to-carrier matching · rate negotiation
Role
Product, design, and engineering — end-to-end build
Stage
In production · 455,057 rows on Hostinger-hosted Supabase VPS
TTMS Mailer product hero — an autonomous freight agent inside Outlook.
Scope

What we were hired to build.

TTMS Mailer is an autonomous AI agent built on top of T-TMS for freight brokers. It runs the end-to-end brokerage workflow without human intervention — syncs emails via Microsoft Graph, classifies inbound freight communications into six categories, extracts load details from emails and attachments, matches carrier replies to loads, scores carriers on a 100-point scale, generates personalised rate offers, negotiates within guardrails, and books loads in T-TMS when carriers accept. Two parallel pipelines serve outward-facing email and internal teammate requests; three operating modes (Off, Test drafts, Live autonomous) give dispatchers full control.

How we planned

Guardrails before autonomy.

Architecture uses Microsoft Graph webhooks (35+ mailboxes at Red Dog Logistics) for real-time email ingestion, Google Gemini 3 Flash for email classification, and Claude Sonnet 4.6 with prompt caching and tool-use for the orchestrator. A specialised carrier-scoring engine (lane history 35pts, rating 25pts, approval 15pts, insurance 15pts, active status 10pts, response-history modifier ±15pts) ranks outreach order. The rate engine synthesises DAT market data, TTMS historical orders, lane boundaries and learned carrier patterns, enforcing a 14% target margin plus a $125 hard floor. Load matching uses three ordered strategies — explicit order ID, PO/reference lookup, address+rate fuzzy match — with a “wrong-order guard” that hard-stops if an explicit order ID fails.

How we delivered

Off · Test · Live. Three modes, one loop.

A Vercel serverless Next.js app with Supabase PostgreSQL backend and a daily 9 PM UTC cron cycle that processes all enabled users’ inboxes. Test mode routes replies to drafts for manual review (byte-identical to Live mode — not a preview). Live mode sends autonomously if confidence thresholds and margin floors are met. Mid-confidence emails route to a human review queue. Escalation gates catch low-confidence decisions, margin violations, legal language and keyword triggers. Every AI action is logged; cost is tracked per request (approximately $0.01 per cycle).

Identify documents step — TTMS Mailer document extraction.
Identify documents — extract load details from emails and attachments.
Assign loads step of the TTMS Mailer flow.
Assign loads — three-strategy matcher with wrong-order guard.
Confirm and submit step.
Confirm & submit — sends only if confidence and margin thresholds pass.
Create exception step for low-confidence decisions.
Create exception — escalation gates route to a human review queue.
What we learnt

The wrong-order guard is the whole trust story.

The wrong-order guard is the single most important safety rail — the difference between an agent you trust and an agent that books the wrong load once and gets switched off. The learning loop works at two levels — carrier-level (blast history, response patterns) and lane-level (acceptance rates, closing times) — with nightly pattern distillation injecting learnings into the next day’s prompts. Model selection matters: Gemini 2.5 Pro as default and Sonnet 4.6 only for high-stakes orchestration keeps the loop economical enough to run 24/7 (approximately $7/month per active user).

How the client improved

From email triage to autonomous load booking.

Red Dog Logistics moved from manual email triage to autonomous load booking. Dispatchers who spent 6 hours a day on tender responses and carrier negotiations now receive pre-scored carrier offers and negotiation outcomes; load velocity increased measurably (3–10× faster offer delivery on internal metrics). The AR coordinator triaging 200+ daily emails now reviews only the ~15–20% escalations. Full audit trail on every decision.

01 / 02 · TTMS Mailer product principle
An autonomous agent that a dispatcher cannot interrogate is a support ticket. So we built the agent that answers to the dispatcher — that shows its math, keeps its receipts, and stops the moment it isn’t sure.
TTMS Mailer
Product principle #1
02 / 02 · TTMS Mailer product principle
One wrong-book is worth a thousand right-books that never happened.
TTMS Mailer
Product principle #2 · Red Dog Logistics
Stack · in receipts

The engineering, in one page.

Runtime
Vercel Next.js
Supabase PostgreSQL · Microsoft Graph webhooks (35+ mailboxes)
Classifier model
Gemini 3 Flash
Fast, cheap email classification into six categories
Orchestrator model
Claude Sonnet 4.6
Prompt caching + tool-use for high-stakes decisions
Margin engine
14% + $125 floor
Target margin plus hard floor per load

Nine Vercel cron jobs, one daily 9 PM UTC cycle. Three operating modes: Off, Test drafts (byte-identical to Live but routed to drafts), Live autonomous. Two pipelines — outward-facing email and internal teammate requests. Three load-match strategies — explicit order ID, PO/reference lookup, address+rate fuzzy — guarded by a wrong-order hard-stop. Every AI action logged. Approximately $7/month per active user.

Next case

DentalAuto — the AI operator for a dental practice. Both halves.

Thirty-five mailboxes on one side. A fine-tuned caries model on the other. Every decision routed to a clinician for the final call. Krest One Dental’s paperwork and imaging, on one operator, with a human between the model and the money.

Have something worth building?

You THINK, We BUILD.

Send a paragraph about what you’re building to hello@creative-mantra.com. We reply within 24 hours with next steps and, for qualified scopes, a fee letter within four working days.