When not to build an agent
Agents are powerful but slow, costly and less predictable. Often a single prompt or a fixed workflow does the job better. Here is how to choose.
In 60 seconds
When not to build an agent
Agents are powerful but slow, costly and less predictable. Often a single prompt or a fixed workflow does the job better. Here is how to choose.
The ladder of options
| Option | What it is | Best when |
|---|---|---|
| Normal code | No model at all. | The rules are clear: calculating GST, sorting by date, checking a format. |
| Single prompt | One model call, maybe with examples. | Summarise, classify, translate, extract fields from one document. |
| Fixed workflow | Several model calls in an order your code decides: step A, then B, then C. | The steps are known in advance, like: extract, then check, then draft a reply. |
| Single agent | The model decides which tools to call and when to stop. | The steps depend on what it finds, and you cannot list them in advance. |
| Multiple agents | Several agents, coordinated. | Large tasks that split into independent parts. |
Workflow or agent?
- Your code decides the order of steps
- Predictable cost and time
- Easy to test each step
- Fails in known places
- The model decides the next step
- Cost and time vary from run to run
- Harder to test: many possible paths
- Can handle surprises a workflow cannot
Cost and reliability add up
Decision checklist
- Can normal code do it with clear rules? Then do that.
- Can one well-written prompt do it, with validation? Try that first and measure.
- Are the steps known in advance? Build a fixed workflow.
- Do the steps really depend on what is found along the way? Then consider an agent.
- Can you limit its tools, budget and risk, and test it with real scenarios? If not, don't ship it yet.
- Is a mistake cheap and easy to undo? If not, keep a person in the loop, or choose a simpler design.
Watch and read more
Lab
A decision table placing five real tasks on the ladder, with reasons and a test plan.
The problem
Use the decision checklist on five tasks. Use these or your own:
- Reply to customer WhatsApp messages about shop timings.
- Sort 500 scanned forms into 6 categories.
- Find and fix a failing test in a code repository.
- Draft weekly social media posts from a product list.
- Book the cheapest train ticket that fits a family's plans.
For each, fill in: the rung you choose (code, prompt, workflow, agent, multi-agent), why not the rung below, the biggest risk, and one metric you would measure.
You are done when
Hard questions
Try to answer before you reveal. If you can answer these, you understood the lesson.
Q1The train booking task seems to need an agent. Which parts could still be fixed workflow steps or normal code?Reveal
Normal code can filter trains by date, time and budget once the data is fetched, and can compare prices exactly. Fetching train data can be a fixed tool call to an allowed source. Only the fuzzy parts, like understanding the family's preferences from a message, need the model. Payment should stay with the person. The "agent" part may shrink to understanding the request and suggesting options.
Q2An agent prototype impresses everyone in a demo. Why might it still be the wrong choice for production?Reveal
A demo shows one good run on a chosen example. Production needs good results across many real cases, at a cost and speed people accept, with safe failures. Without an evaluation set and cost measurements, you don't know the success rate or the cost per task. A simpler design may do almost as well for a fraction of the cost and risk.
Questions people ask
Isn't an agent always more flexible and therefore better?
More flexible, yes. Better, not always. Flexibility costs money, speed and predictability. If your task doesn't need that flexibility, you pay for nothing and gain new failure modes.
How do I show my manager that a simpler solution is enough?
Build a small test set of real examples and measure. Compare the simple approach and the agent on success rate, cost per task and time per task. Numbers from your own data are more convincing than opinions.
What if the task changes later?
Then revisit the choice. A good design keeps the pieces, such as validated extraction and tools, reusable, so moving from a workflow to an agent later is not a rewrite.
Are there tasks where agents are clearly a good fit?
Tasks where the path depends on what is discovered: debugging, open-ended research, some coding tasks, and investigations across several systems. Even then, the agent should have limits, good tools and evaluation.
Lesson test
5 questions. Get 3 right (60%) to pass and complete this lesson.