Design & Patterns
Planning, reflection, task decomposition, which pattern fits.
29 posts · showing 1–10
-
The Travel Agent Reviewed Its Itinerary Three Times and Approved the Wrong Date Every Time. Reflection Needs Something to Check Against.
A self-review loop that reads only its own draft can polish the wrong answer forever. The fix is to give the critic something the generator never had: the original request, a fresh context, or a tool that can say no.
-
The Tool Call Failed on Step 3. Retry, Skip, or Replan? Decide by What the Failure Told You About the Plan.
A failed tool call carries two facts: the action didn't happen, and something you believed may be false. Agents act on the first and throw away the second — here's the one question that sorts retry from skip from replan, and how to put the answer in the error contract instead of the prompt.
-
An Agent That Cannot Fail Will Retry Forever. Budget Tokens and Wall-Clock, Not Retry Counts.
Your max_retries=3 never fires, because every search call succeeds. The agent just keeps finding new ways to look for an answer that doesn't exist. Here is the budget that actually stops it, and the exit that lets it stop politely.
-
Forty Tools in One Prompt: What It Actually Costs, and the Three Signals That Say Split the Agent
Forty registered tools do not fail loudly — the agent just gets vague, picking near-synonyms and asking questions it had the answer to. Here are the three costs you're paying, and the signals in your traces that tell you to merge, gate, or finally split.
-
Retry, Repair, or Replan? A Recovery Ladder for When an Agent's Step Fails
Blind retry burns money on a call that will never succeed; premature replanning throws away correct work and produces a worse plan. The deciding signal isn't how bad the error looks — it's what the error proves false.
-
Map-Reduce or Sequential Refine? How an Agent Should Read 400 Pages
Chunking 400 pages of contracts forces a choice most teams make by accident. One shape quietly drops evidence as it goes; the other can never spot a conflict between two documents — and the fix is not the pattern, it's what the map step returns.
-
Let the Model Pick the Transition, Not the Tool
A returns agent that can issue a refund before it has checked eligibility will eventually do exactly that, and no amount of prompt wording reliably stops it. Making the call unavailable is a design decision, not a prompt one.
-
Designing an Agent You Can Redirect Mid-Run
Twelve files into forty, you realize the approach is wrong. Let it finish or kill it — both bad, and the third option had to be designed in before the run started.
-
The Second-System Effect in Agent Deployments
The first agent works because it was scoped well. The second aims at exactly the cases the first one escalated — which is the residual that resisted automation for structural reasons.
-
What Distributed-Systems Experience Transfers to Agent Loops
An agent run is a distributed system with unreliable participants, so most of the discipline transfers. Four things twist — and one microservice instinct actively hurts, because agent boundaries are lossy.