I spent six months breaking agents in production. Here's what actually works.Everyone wants to tell you about the patterns. I'm going to tell you about the ones that look good in demos and make you cry at 3 AM in production.The agentic AI space has a documentation problem. There's plenty of content showing you how to build agents. Almost none showing you where they fail. This is my attempt to fix that.The six patterns are real. The gotchas are realer.
1. Tool Use — The Pattern That Makes Everything Else Possible
Give an agent access to external capabilities. Web search. API calls. Code execution. File systems.This is the foundational pattern. Without it, your agent is a really expensive search engine.Fujitsu cut their sales proposal time by 67% using specialized agents calling specific APIs. That's real. But here's what they don't tell you:Where it breaks: Your agent's reliability is now bounded by your worst tool. Rate limits, timeouts, schema drift, network failures — all of it lands in your agent's lap. I've seen teams spend two weeks building a sophisticated agent, then watch it fail daily because a single API endpoint had inconsistent response times.The fix: Wrap every tool with retry logic, circuit breakers, and explicit error schemas. Assume every tool call will fail. Because it will.
2. Reflection — The Pattern With a Dangerous False Sense of Security
Agent produces output. Agent critiques its own output. Agent revises.Sounds like quality assurance. It is. But there's a subtle trap: the agent is using the same model to generate and evaluate. Which means it will often miss its own blind spots.The classic failure mode: A code generator reflects on its own output and concludes it's correct. It's not. The reflection just confirms what the generator wanted to believe.When it actually works: When the evaluation criteria are specific and verifiable. "Does this JSON match this schema?" "Does this code compile?" "Are these numbers mathematically consistent?" These are testable. When reflection stays in verifiable territory, it works.When it fails: When it strays into subjective quality ("is this writing voice good?") or complex logical reasoning ("is this financial analysis correct?"). The model will tell you what you want to hear.In production: Use different models for generation and critique. Yes, it's expensive. The cost of shipping wrong output is usually higher.
3. ReAct — The Most Misunderstood Pattern
Reason. Act. Observe. Repeat.Everyone calls this "reasoning + acting" like it's one thing. It isn't. ReAct is two separate jobs happening in a loop. The agent switches between them on every iteration.The promise: Visible reasoning. You can see why the agent made each decision.The reality: ReAct agents are slow and expensive. Every step requires a model inference. A 10-step ReAct loop costs 10× a single call. And since the agent is reasoning aloud at every step, it burns tokens like nobody's business.When to use it: Complex diagnostic tasks where each action provides critical new information. IT support, debugging, investigation. Tasks where you need to see the reasoning path and where a wrong turn costs more than the time saved.When to avoid it: Fast, simple tasks. If a single LLM call can do the job, ReAct is overkill that multiplies your latency and cost.
4. Planning — The Pattern That Reveals Hidden Complexity
Before doing anything, plan. Break the goal into explicit steps. Execute the plan.Here's what nobody warns you about: planning works until it doesn't. Tasks that look like they have five steps actually have seven once you start executing. Dependencies you thought were parallel turn out to be sequential. Edge cases you didn't plan for ambush you mid-execution.I watched a team spend three weeks building a planning agent for data migration. The plan looked beautiful. The execution revealed 14 decision points nobody had anticipated.The pattern that actually works: Plan loosely, execute adaptively. Use planning to surface dependencies and catch obvious mistakes early. Don't treat the plan as a fixed script — treat it as a map that you'll update as you explore the territory.
5. Multi-Agent Collaboration — The Pattern That Scales Complexity
Multiple specialized agents. A coordinator routes work. Each agent owns a piece.The promise: Divide and conquer. Specialists go deep. The system handles complexity.The reality: Coordination overhead grows faster than you think. Every handoff is a potential failure point. Every agent-to-agent communication is an opportunity for miscommunication. I've seen three-agent systems outperform single agents. I've also seen three-agent systems that accomplished less than one agent would have, while costing 5× more.The honest rule: Only go multi-agent when the coordination cost is less than the complexity you're handling. If a single agent with good tools can do the job, one agent with good tools is the answer.Multi-agent shines for: Genuinely parallel sub-problems, tasks requiring diverse expertise, workflows where independent validation matters.Multi-agent fails for: Simple linear tasks, anything that doesn't have clear specialization, anything you'd have to over-explain to a human to make them understand the handoff order.
6. Evaluator-Optimizer — The Pattern That Costs More Than You Think
Generator produces. Critic evaluates against specific criteria. Loop until quality threshold.This is the pattern behind "LLM outputs verified by another LLM." Works great in theory. Expensive in practice.Every iteration is two model calls minimum. High-stakes outputs often need three to five iterations. At roughly $0.01–$0.05 per call, you're paying $0.10–$0.25 per output before you factor in token costs. For high-volume systems, this adds up fast.Where it actually earns its cost: Legal documents, compliance text, financial reports, generated code that could cause harm. Places where the cost of an error exceeds the iteration cost.Where it's wasted: Marketing copy, first drafts, anything you'll be editing anyway. Don't pay for precision you don't need.The critical implementation detail: The Critic must be independent. Different system prompt, different model, ideally different perspective. A Critic that shares the Generator's training data shares its blind spots.
The Topology You Actually Need
Sequential — For pipelines where each step feeds the next. Simple, predictable, low overhead. But sequential means sequential — you can't parallelize what isn't ready.Parallel — Agents working simultaneously on independent subtasks. Cuts wall-clock time if, and only if, the subtasks are genuinely independent. If they're not, you're paying for coordination that cancels the parallelism benefit.Router / Coordinator — One agent analyzing requests, routing to specialists. Good for multi-domain systems. The router becomes a single point of failure and a performance bottleneck. Instrument it.Hierarchical — High-level agents directing low-level ones. Mirrors how organizations work, which is exactly why it's overused. Most problems don't actually need this structure. Don't build an org chart for a problem that fits in a flat team.
What Nobody Writes About: Where Agents Actually Break
Context death mid-loop. Agents lose track of earlier decisions in long workflows. A 20-step loop doesn't remember why step 3 was done a certain way by step 18. The fix is architectural (state management, explicit memory), not pattern-level.Non-deterministic outputs. Same input, same agent, different output. You can't regression test agents the way you test code. Build evaluation suites, accept probabilistic failure modes, and instrument what "good enough" looks like for your specific use case.The observability gap. You can't debug what you can't see. Every agent action should produce a trace: what was the reasoning, what tool was called, what was the input, what was the output, what happened next. Without this, you're flying blind.Tool failures cascade. One failed tool call can poison the entire agent loop. Build explicit error recovery: try an alternative, graceful degradation, escalate to human. Assume every tool will fail at the worst possible moment.
The Bottom Line
The patterns are real. The frameworks are mature enough to use. The question isn't whether to build agents — it's which pattern solves your actual problem.Start with the simplest pattern that fits. Tool use for data retrieval. ReAct for diagnostics. Multi-agent only when you have genuine specialization.Measure everything. Token cost per task. Error rates by tool. Context usage over time. If you're not measuring, you're not engineering — you're hoping.Instrument for failure. You'll need it. Not every failure is a bug — some are just agents doing reasonable things in unreasonable situations. You need to be able to tell the difference.The teams making real progress aren't running the most sophisticated agents. They're running the simplest agents that actually solve their problem — and they know exactly why those agents succeed and fail.
On this page
Python
# Tool reliability isn't optional
@tool(retry_on_failure=3, timeout=10)
def risky_api_call(query):
# This will fail. The question is when.
pass
Python
# Plan, but keep an escape hatch
plan = planner.break_into_steps(goal)
executor.run_with_fallback(plan, on_unexpected=replan)