Your AI Agents Are a Distributed Systems Problem Now
A stuck agent can burn $681 an hour. Here’s the math, and why framework choice, identity, and token budgets matter more than your model.

Most teams still evaluate agents the way they evaluated chatbots: by how smart the model is. That made sense when an agent was a notebook experiment. It stops making sense once you run a fleet of them in production, because at that point you are doing distributed systems engineering, and the old rules apply. Overhead, memory, state, credentials, and cost.
I just published a long technical deep dive on this on my Substack, with full benchmark harnesses, recovery patterns, and a working token budget gateway. This piece covers the core ideas so you can decide whether it’s worth your time.
You Don’t Choose How Many Agents You Run
Start with Little’s Law from queueing theory:
L = λ × W
The number of agents alive at once (L) equals the rate tasks arrive (λ) times how long each agent lives (W). If you get 40 tasks per second and each agent lives 12 seconds waiting on model responses, you have 480 agents running concurrently. Your traffic and your provider’s latency set that number, not you.
When your provider has a slow afternoon and latency doubles, your agent count doubles too, along with every per-agent cost you carry. Framework overhead that looks trivial in a demo becomes the thing that takes down your cluster.
Abstraction Has a Price Tag
First-generation frameworks like LangGraph and CrewAI optimized for developer experience. That’s a fair trade for prototypes. In production, especially in fan-out architectures where a master agent spawns dozens of short-lived workers, the construction cost of all that machinery adds up fast.
Picture a master agent spawning 50 workers at 200 milliseconds each. That’s 10 seconds of dead time before a single model call. Wrapping the constructors in asyncio doesn’t help, because object construction is CPU-bound and holds the GIL. The 50 calls still run one after another.
Lighter runtimes like Agno report instantiation in the low microseconds, which drops that same spawn phase to about 100 microseconds. Memory follows a similar pattern:
- At roughly 137 KB per agent, 10,000 concurrent agents need about 1.37 GB of pure scaffolding.
- At roughly 2.5 KB per agent, the same fleet needs about 25 MB.
I wouldn’t trust those numbers without testing them, and you shouldn’t either. The full article includes a benchmark harness you can run on your own hardware. It measures timing and memory in separate passes, controls garbage collection, excludes warmup, and uses a local stub server so you’re measuring framework overhead instead of provider noise. It also covers the cases where framework overhead barely matters, which vendor benchmarks tend to skip.
Your Hourly Job Is Failing More Than You Think
Scheduled agents are where a lot of teams get burned quietly. If an hourly run processes 2,000 items and each has a 0.1 percent chance of a transient failure, the chance of a clean run is:
0.999^2000 ≈ 13.5%
About 86 percent of your runs will hit at least one failure. Without checkpointing, each of those either restarts from scratch or silently drops work.
The deep dive walks through auditing the scheduled Routines in Microsoft’s Foundry Toolkit for VS Code. It covers keyless authentication with managed identities (including how to measure your real revocation window) and a reference pattern built on leases, cursors, and idempotency keys that you can test any platform against. It also explains the one gap in that pattern that only your downstream system can close.
The Runaway Loop Math
Agent loops usually accumulate context, so each call is bigger than the last. Total tokens grow with the square of the iteration count until the context window fills.
With a 200,000-token window, a call every 3 seconds, and a hypothetical $3 per million input tokens, one stuck agent burns through roughly 227 million tokens in an hour. That’s about $681 an hour, or over $16,000 a day, from a single agent.
The fix is to move financial limits out of the code that might be buggy and into the API gateway, where a token bucket caps spend regardless of what the agent does. A properly sized bucket brings that same worst case down to around $27 an hour. The full piece includes a working gateway implementation that reserves tokens up front like a credit card pre-authorization, then settles to actual usage once the response comes back. Most homegrown versions skip that step and undercount output tokens.
What’s in the Full Article
- An instantiation and memory benchmark harness, ready to run against your own stack
- A latency curve script and stub server for measuring p99 decay under load
- Azure managed identity setup with a four-point credential audit
- A run ledger for crash-safe, duplicate-free scheduled jobs
- A multi-tier token budget gateway and a loop guard for agents stuck on repeat
If you’re moving agents from prototype to production, this is the infrastructure layer that decides whether they stay up and stay affordable.
Read the full deep dive on Substack → https://brianjamescurry.substack.com/p/the-agentic-inflection-point-engineering
If you want more pieces like this, with real code and real math, subscribe on Substack. That’s where the full technical work lives.
About the Author

Brian Curry is a Kansas City-based machine learning and AI strategist, marketing economist, and applied researcher. He leads Vector1, an independent research studio working on cognitive AI, causal inference, marketing economics, and knowledge engineering, with a focus on simulation-driven intelligence systems.
Over more than twenty years, Brian has led data science and analytics initiatives at enterprises ranging from $4B to $125B in revenue, including Koch Industries, Tractor Supply, Vail Resorts, Hallmark, Garmin, and AT&T. His work applies economics and causal inference to connect marketing investment to structural outcomes, operational decisions to economic value, and AI adoption to durable competitive advantage.
He is also the founder of KC AI Lab, a 1,500-member AI and ML education community in the Midwest. He lives in Kansas City and is an active part of the Kansas City community.
Research and Open-Source Projects
The modeling approach in this paper draws on PyCausalSim and Papilon.
Causal Inference and Economics
- PyCausalSim: Simulation-driven causal discovery and evaluation, using counterfactual scenarios to isolate structural drivers.
- Papilon: Complex-system simulation and optimization, with applications in media mix modeling and adaptive architectures.
- Daedalus: Causal analytics for money-flow mapping and macroeconomic tracking.
- The Autonomy Economy: A macroeconomic framework for the combined effects of rapid productivity growth and structural price deflation in an AI-automated economy.
Forecasting and Applied Modeling
- Regimecast: Time-series regime detection, structural breaks, and economic forecasting.
- CarryNet: Financial modeling for commodity carry trade analysis.
- Foodmesh-ml: Machine learning, optimization, and simulation for distributed food systems.
Cognitive AI and Semantic Architecture
- Memory-Node Encapsulation (MNE): A cognitive AI architecture and data structure for artificial episodic memory (NeoCortex-M).
- MeaningFlow: Semantic content modeling, embeddings, clustering, and coverage gap analysis.
Contact: brian@vector1.ai | GitHub @Bodhi8 | Substack
The text of this article may be shared with attribution under Creative Commons Attribution 4.0 International (CC BY 4.0). Code and models referenced here are available separately to paid subscribers.


