← Lab
Field note·Agentic Systems & Orchestration·5 min read

Why 90% of Demo Agents Fail in Production

Agents rarely fail in production because the model is weak. They fail because nobody can see what happened.

Why 90% of Demo Agents Fail in Production

The AI is the easy part. Observability, error handling and evaluation are where these systems live or die — and all three are unglamorous infrastructure work that is easy to defer until the first incident makes it urgent.

Observability before anything else

If you cannot see what the agent did, you cannot fix it when it breaks. Every tool call needs a span — not just input and output, but the whole decision: what it planned, which tool it chose, what happened when the tool ran.

01PlanningWhat did the agent decide to do, and on what basis?
02Tool selectionWhich tool did it pick, and what were the alternatives?
03ExecutionWhat did the tool return, including failures and retries?

Assign a unique run id to every execution and correlate on it. With that in place, a failure at 2am is a replay of the exact run. Without it, you are reading raw logs and guessing.

Error handling is not optional

Treat a failed tool call as a value, not an exception. Return a structured error, let the agent retry with backoff, and escalate to a human when retries are exhausted. The difference between a run that recovers and a run that dies is usually just this.

Evaluation, or you are shipping on vibes

Without a fixed question set scored on every change, nobody can say whether this week's prompt edit helped or quietly broke three intents. A golden set of representative questions, run on every deploy, turns prompt engineering from taste into engineering.

What to take away
  • Trace planning, tool selection and execution — not just inputs and outputs.
  • Correlate everything on a single run id so failures can be replayed.
  • Return structured errors and escalate after retries are exhausted.
  • Score a fixed question set on every change to catch regressions.

Field notes on building production AI systems — collected, verified and written up so they are useful to anyone working on the same problems.

smoke
“Innovation distinguishes between a leader and a follower.”

Need an AI system that holds up in production? Tell me what breaks today and I'll tell you what I'd build.

Call Me now !

mail

abdelmajidzaddi088@gmail.com

address

Mohammedia, Morocco

phone

+212 695 557 631