The problem
Delivery appointments are negotiated with receiving warehouses by phone and email. A good prediction of when a shipment can be delivered decides whether a scheduling agent can book with confidence or should hand the conversation to a person.
The early predictor worked, but there was no reliable way to tell whether a change made it better or only looked better on a convenient sample. Without that, nobody could safely let it drive automation.
From business problem to technical problem
The first job is translation. Here is how the ask changed shape before any code was written.
- Business askCan AI agents book delivery appointments without a person on every call?
- Technical questionPredict the appointment a warehouse will accept for each shipment, and know when that prediction is reliable enough to act on.
- What success looks likeError measured on a fixed replay set, plus per-shipper readiness gates that say when automation can switch on.
Paths I weighed
There was more than one reasonable way to do this. These are the options I compared and why I picked one.
Hand-tune the rules
Upside. Fast and easy to explain to operations.
Cost. Slow iteration, and no evidence that a change helps everywhere it applies.
Replace it with a new model
Upside. Could capture more signal.
Cost. Harder to explain, needs new training infrastructure, and still needs an evaluation harness to prove it is better.
Build the harness, then let an agent iterate
Upside. Many experiments, each one evidenced and reviewable, and the logic stays legible.
Cost. Upfront investment in replay data and guardrails.
What I built
- Frozen replay casesHistorical shipments prepared as fixed evaluation sets
- Research loopA coding agent edits logic, replays, keeps only gains
- Prediction serviceProduction predictions with decision logging
- Go-live gatesReadiness checks before automation turns on
- Scheduling agentsVoice and email agents act; outcomes feed evaluation
I designed an autonomous research loop: a coding agent edits the prediction logic, runs replay evaluation against the frozen cases, and keeps a change only when it beats the baseline. Most of the improvement in prediction error came from the loop’s first run.
Alongside the predictor, I built the evaluation system for the voice and email scheduling agents from scratch: transcript parsing, scenario classification, and LLM-as-judge grading across five specialized agents. It became the company’s standard for measuring AI performance.
How it got built, scaled, and fixed
- Build
I took over an early predictor and first built frozen replay cases, so any change could be scored the same way.
- Scale
Wrapped it in a production service with decision logging, and added readiness gates so automation could expand shipper by shipper.
- Fix
Logged decisions and the replay set make a bad prediction reproducible, so a fix goes through the same evidence as an improvement.
Decisions that mattered
Replay before rollout
Every candidate is scored on the same frozen historical cases, so a difference in error reflects the change, not a different sample.
Let the agent experiment, not decide
The coding agent may edit prediction logic, but the replay harness and the acceptance rule stay fixed. Only measured improvements are kept, and every change stays reviewable.
Gate go-live by shipper
Accuracy differs by shipper. Readiness gates turn automation on where the evidence is strong and keep people in the loop elsewhere.
Log decisions before acting on them
Decision logging shows what the system would do before it is allowed to do it, which makes rollout auditable.
What transfers
Autonomy is safe when the judge is fixed. A coding agent can explore far more ideas than a person, as long as it cannot touch the evaluation it answers to. I would use the same structure for any system that should keep improving after launch.
Methods
Collaborative work with product and engineering partners; this page describes my contribution. Diagrams are simplified.