AI Agents vs Traditional Chatbots
Independent educational resource, not an official Anthropic course. Facts about the API, prices and limits were checked against Anthropic's documentation on 15 November 2026 and the code was run against a local mock of the API, not the live service. Check the linked official pages before relying on a number, and test with your own key.
People often say "we're adding an AI agent" when they mean "we're adding a chatbot", and the two lead to very different projects. A chatbot answers. An agent does things. That one change brings new costs, new risks and new ways to fail, and it's easier to plan for them if you can see exactly where the line sits. This lesson draws it, using a small test you can run on your own ideas.
What you'll learn
- The practical differences between a chatbot, a workflow and an agent.
- A three-question test for which one your task needs.
- How the failure modes change as you move along that range.
- Why "just add tools" is a bigger step than it looks.
Before you start
Three things on a range
| Chatbot | Workflow | Agent |
| Who picks the next step | Nobody. One reply per message | Your code | The model |
| Can it change anything | No | Only what you coded | Anything its tools allow |
| Model calls per request | One | A known number | Unknown in advance |
| Cost and time | Low and steady | Predictable | Varies a lot |
| Typical failure | A wrong or made-up answer | One step goes wrong, the rest build on it | Wrong actions, loops, runaway cost |
| How you test it | Check answers | Test each step | Test behaviour across many situations |
A chatbot can still be a good product. A support bot that answers from your help centre and links to the right page is useful, cheap and hard to break in a harmful way. Don't treat "agent" as a promotion.
The three-question test
Before building, answer these about the task:
- Does it need to look things up or do things? If it only needs to answer from text you already have, a chatbot with good context is enough.
- Can you write down the steps in advance? If yes, build a workflow. It's more predictable and easier to test.
- Is the work valuable enough to justify the extra cost and the extra care? If a mistake is cheap and rare, fine. If it's expensive, you'll need approvals, and that changes the design.
You only need an agent when the answers are yes, no and yes: it must act, the steps vary per case, and it's worth it.
Seeing the difference in code
The same customer question handled three ways. The chatbot is one call:
reply = client.messages.create(
model="claude-sonnet-5-5", max_tokens=300,
system="You answer from the help centre text below. If it isn't covered, say so.\n\n" + HELP_CENTRE,
messages=[{"role": "user", "content": question}],
)
The workflow fixes the steps (this is the routing pattern from the next lesson):
label, answer = route(llm, question, {"order_status": answer_order_question, "other": hand_to_person}, default="other")
The agent gets tools and decides. It's the Agent from lesson 6.1, with a budget on it:
run = agent.run(question) # the model decides whether to look up an order, propose a refund, or just reply
Each step to the right gives you more flexibility and takes away some predictability.
How failures change
This is the part that surprises teams. A chatbot's worst case is a bad answer, which a person reads and can ignore. A workflow's worst case is a wrong step, which you can find by testing that step. An agent's worst case is a sequence of decisions, each reasonable on its own, that ends somewhere you didn't intend: it calls the right tool with the wrong id, then trusts the result, then writes a confident reply. Anthropic's guidance warns about this directly: agents can compound errors, which is why they suggest extensive testing in a sandbox and appropriate guardrails.
Real-world use case (illustrative scenario)
This scenario is an invented example to show how the ideas fit together. It is not a case study and its details are not measured results.
A shop first launches a help-centre chatbot. It answers shipping-policy questions well, and costs little. Customers keep asking "where is my order?", which a chatbot can't know. The team adds a single fixed lookup, a workflow: classify the message, and if it's an order question, fetch the order and write a reply. Only later, when refunds and exchanges show up in the same emails, do they move to an agent with tools and a human approving any money movement. Each step was added because the previous one stopped being enough, not because "agents" were fashionable.
Mistakes to avoid
- Jumping straight to an agent for a task a chatbot or workflow handles.
- Assuming an agent is "a smarter chatbot". It's a different kind of system with its own testing needs.
- Giving a chatbot tools "just in case" and not changing how you test or limit it.
- Skipping the cost estimate. Agent cost varies per request, so estimate a range.
Security notes
The moment a bot can act, prompt injection stops being an embarrassment and becomes a risk to your systems. A chatbot tricked into rude text is a PR problem. An agent tricked into calling a refund tool is a financial one. Add tools gradually, read-only first, and put people in front of anything irreversible.
Cost and speed
A chatbot reply is one request. A workflow is a fixed handful. An agent is however many the model decides, and each re-sends the growing conversation. Set a token and time budget per run and watch the distribution, not only the average, because a few long runs drive the bill.
Key takeaways
- Chatbot answers, workflow follows your steps, agent chooses its steps.
- Use an agent only when the task must act, the steps vary and the value justifies the care.
- Failure shifts from "bad answer" to "bad sequence of actions".
- Add capability in stages, and test each stage.
Lesson recap: chatbot answers, workflow follows your steps, agent chooses its steps.
Quick quiz
- What can a chatbot not do that an agent can?
- Which of the three needs the least testing effort, and why?
- When should you build a workflow instead of an agent?
- Why is an agent's cost harder to predict?
- Why does adding tools change the security picture?
Answers and explanations
- Take actions or look things up on its own. A chatbot only replies.
- The chatbot. It has one call and no side effects, so checking answers is mostly enough.
- When you can write down the steps in advance. Fixed paths are more predictable and easier to test.
- The number of model calls, and so tokens, depends on what the model decides to do for each request.
- Injected text can now lead to real actions, such as changing data or spending money, not just odd wording.
Official references and further reading
Related tutorials