All articles

Building Reliable AI Agents: What Production Actually Demands

Most AI agent demos work. Most AI agents in production don’t — at least not on the first try. The gap between a convincing demo and a system real users depend on is where almost all the engineering actually lives, and it’s rarely about the prompt.

After shipping multi-agent and LLM features into production, I’ve come to treat agent reliability as a systems problem first and a prompting problem second. Here’s how I think about it.

The model is the orchestration layer, not a feature

The most common architectural mistake is bolting an LLM onto the side of an existing app: a button that calls a model, gets a blob of text back, and hopes for the best. That works for a demo and falls apart under real traffic.

In an AI-native system, the model is the orchestration layer. It decides what happens next, calls tools, delegates to other agents, and recovers when something goes wrong. That reframing changes everything downstream — how you handle errors, how you observe the system, and how you reason about correctness.

Design for failure, because the model will fail

LLMs are probabilistic. They hallucinate tool arguments, return malformed JSON, loop, and occasionally just stop making sense. A production agent has to assume all of this will happen and stay correct anyway.

Concretely, that means:

  • Validate every tool call. Treat the model’s output like untrusted user input. Schema-validate arguments before executing anything. If validation fails, feed the error back to the model and let it retry — don’t crash.
  • Bound the loop. Every agent loop needs a hard ceiling on steps and tokens. An unbounded agent is a runaway cost and latency bug waiting to happen.
  • Make actions idempotent or reversible. If an agent retries a step, the second execution must not double-charge a customer or send two emails.
  • Fail loudly, recover quietly. Surface failures in your telemetry, but give the agent a graceful degraded path for the user.

Observability is non-negotiable

You cannot debug what you cannot see. With deterministic code, a stack trace tells you what happened. With an agent, you need the full trace of why: every prompt, every tool call, every intermediate decision, with timing and token counts attached.

I instrument agents so that any single run can be replayed and inspected end to end. When something goes wrong in production — and it will — the difference between a five-minute fix and a five-hour one is whether you captured that trace.

Evals over vibes

“It seems better” is not a release criterion. Before changing a prompt, a model, or a tool, I want an eval set that measures whether the change actually helps. It doesn’t need to be elaborate — a few dozen representative cases with clear pass/fail criteria will catch most regressions and free you from re-testing by hand on every change.

This is the part teams skip because it feels slow. It’s the part that lets you move fast without breaking the things that already work.

Multi-agent: power and cost

Splitting work across specialized agents — a planner, workers, a verifier — is genuinely powerful. It lets each agent stay focused, and an adversarial verifier can catch mistakes a single agent would confidently ship.

But every agent is latency, tokens, and a new failure surface. I reach for multi-agent designs when the problem is genuinely decomposable or when independent verification matters — not because the architecture diagram looks impressive. The simplest design that meets the reliability bar wins.

Where this is going

The frontier is moving fast: cheaper models, longer context, better tool use, and increasingly capable open-weight models you can fine-tune for your own domain. The engineers who win the next few years won’t be the ones with the cleverest prompts — they’ll be the ones who treat agents as production systems, with the same rigor we already apply to distributed systems.

That’s the work I care about: building agents that don’t just demo well, but hold up when the world leans on them.


Building something in this space, or hiring for it? I’m reachable at [email protected].