惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
A
About on SuperTechFans
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog RSS Feed
U
Unit 42
Stack Overflow Blog
Stack Overflow Blog
Recent Announcements
Recent Announcements
雷峰网
雷峰网
罗磊的独立博客
Microsoft Security Blog
Microsoft Security Blog
Hugging Face - Blog
Hugging Face - Blog
L
LangChain Blog
人人都是产品经理
人人都是产品经理
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Help Net Security
P
Proofpoint News Feed
The Cloudflare Blog
D
Docker
大猫的无限游戏
大猫的无限游戏

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Your agent demo works. That's the trap.
sagar jain · 2026-06-23 · via DEV Community

I build AI agents for other companies for a living. The pattern I see most often isn't "the model can't do it." It's "the demo worked, we shipped it, and now it fails one out of every three times and nobody can say why."

That gap between demo and production is mostly arithmetic, and once you internalize the math it changes how you build.

The math nobody puts on the slide

Say each step in your agent is 95% reliable. Sounds great. Now chain ten steps together, which is a modest agent by 2026 standards:

0.95 ^ 10 ≈ 0.60

Sixty percent end-to-end. Stretch it to twenty steps and you're at 36%. And 95% per step is generous. For agents doing real work over messy inputs, per-step error rates land closer to 10–20%. Run the numbers on an 85% step over eight steps:

0.85 ^ 8 ≈ 0.27

About three in four runs fail somewhere. That's not a bad model. That's compounding probability doing exactly what it does.

A demo hides this completely. A demo is one happy path: clean input, short chain, no rate limits, no ambiguous data, you running it five times until it looks good for the recording. Production is a hundred users feeding it garbage you never imagined, on chains that are longer than you think because every "call this tool and parse the result" is really three or four steps under the hood.

Failures are invisible at the step level

Here's the part that actually burns teams. Compounding failure doesn't show up as a crash. Every individual step looks reasonable in isolation.

Step 3 slightly misreads a field. The output is still well-formed JSON. It gets fed to step 4, which reasons confidently from corrupted context, and steps 5 through 8 build on top of that. The final answer is wrong, plausible-looking, and there's no stack trace pointing at step 3. You only find it by tracing the whole causal chain by hand, usually after a customer screenshots something embarrassing.

This is why "the model hallucinated" is the wrong diagnosis most of the time. The model did what it always does — propagate whatever it was handed. The system had no checkpoint, no validation gate, no way to catch the drift at step 3 before it poisoned everything downstream.

The other quiet killer is context. People hear "200K token window" and assume they have 200K tokens of working memory. In practice agents start losing the plot well before that as older instructions get buried under tool output and intermediate junk. Context quality, not context size, is the real limit. A tighter 8K of relevant context beats 80K of noise every time.

What actually moves the needle

None of the fixes are exotic. They're the boring distributed-systems discipline we already know, applied to a non-deterministic worker. The mental shift that matters: stop treating the agent as a prompt, start treating it as a system.

Checkpoint state outside the agent. State lives in a store, not in the conversation. If the process dies at step 6, you resume at step 6, you don't restart the whole chain and pay for it twice. This one change turns "the run failed, start over" into "the run failed, here's exactly where, retry from there."

Validate at the boundaries. Every tool's input and output gets checked against a contract. A schema, a sanity check, an assertion that the number is in range. The goal is to catch the corrupt step-3 output at step 3, where it's a clean recoverable error, instead of at step 8 where it's a mystery. Pydantic-style validation on tool I/O is the cheapest reliability you can buy.

Make side effects idempotent. Retries are non-negotiable with a non-deterministic worker, which means a step can run twice. If a step charges a card or sends an email, an idempotency key is the difference between a retry and an incident. Worth saying out loud: retrying an LLM step is not a cache lookup — the same prompt can return a different answer — so idempotency has to live in the side effect, not the model call.

Put evals in CI. Treat agent behavior like code that can regress, because it does. A prompt tweak that helps one case quietly breaks five others, and without a test set you ship it blind. A modest suite of real cases that runs on every change catches the silent regressions that manual spot-checking never will.

The uncomfortable truth is that going from a slick demo to something you'd put in front of paying users is mostly unglamorous engineering — error handling, state management, observability — not better prompts. At Shanti Infosoft most of our actual work on an agent build is exactly that scaffolding, not the model wrangling people expect. If you're earlier on this path, here's a practical starting point for AI agents in business.

If you're staring at an agent that demos beautifully and flakes in prod, don't reach for a bigger model first. Open a trace, find the step where the chain quietly goes sideways, and ask why nothing caught it there. Nine times out of ten the answer isn't intelligence. It's that you built a happy path and called it a system.