01
How is an agent different from a chatbot?
A customer types into an online store's support chat: "The sneakers I bought yesterday don't fit. I'd like a refund." In the scene below, switch between the chatbot and the agent.
- 1
- I need to find the order first
- 2
- Look up orders (yesterday)
- 3
- #1042: 1 pair of sneakers
- 4
- Check it's within the return window
- 5
- Look up return policy (#1042)
- 6
- Free returns within 7 days
- 7
- It's within the window, so file the refund
- 8
- File refund (#1042)
- 9
- Filed, refund within 3 days
- 10
- I've filed your refund. You'll get it within 3 days.
Request: "The sneakers I bought yesterday don't fit. I'd like a refund."
It went round the loop three times: it found the order, checked the return window and actually filed the refund before answering. At each step, the model decided what to do next by looking at the result of the step before.
A chatbot takes a question and writes one answer. An agent takes a goal and keeps working until it reaches it. It thinks about what to do, uses a tool to actually do it, looks at the result, and thinks again — round and round. The key point is that nobody decides ahead of time which tools to use or in what order. The model decides as it goes.
What an agent is made of
A model (LLM) that makes the decisions, instructions that say what the job is and which rules to follow, tools to take action, memory to hold what happened before, and an execution loop that keeps going until the goal is met.
How much does it do on its own?
Agents range in how autonomous they are: some just answer questions, some take on a set task, and some get only a goal and handle everything from planning to execution themselves.
| Type | What it does | Example |
|---|---|---|
| Question-answering | Looks up information and answers when asked | Answering questions about company policy |
| Task | Takes on a set job and handles it with tools | Changing a delivery address, booking a meeting room |
| Autonomous | Gets a goal and plans, acts and checks on its own | Preparing a whole business trip, responding to an alert by itself |
If a question says… → pick this
- “Plans on its own and uses tools to finish a task end to end”AI agent
- “Only answers questions and doesn't change any systems”Question-answering (chatbot)
- “Takes on a set job and handles it with tools”Task agent
- “Given just a goal, handles everything from planning to execution”Autonomous agent
An agent's power comes from its tools. But an LLM can only write text. So how can it call an order system?
02
How agents use tools (function calling)
An LLM only writes text. It can't connect to other systems by itself. So the app sends the LLM a list of the tools it can use, along with a description of each: the tool's name, what it does and what values it takes.
Tool: order_lookup Description: Returns the status and delivery location of a customer's order Parameters: order_id (string, required)
When the LLM decides it needs a tool to answer, it doesn't answer yet. Instead it sends back a request in a set format, like "please call order_lookup with order_id 1042." The app does the actual running, sends the result back to the LLM, and the LLM writes its answer from that result. This is called function calling, or tool calling. Step through the messages in the scene below.
- 1. User→App (runs tools)
- Where's my order?
- 2. App (runs tools)→LLM
- Question + list of available tools
- 3. LLM→App (runs tools)
- Request: call order lookup (1042)
Purple = the LLM's tool-call request · Green = the app actually runs the tool
The LLM doesn't run the tool itself. It just sends back a request, in a set format, that says "please call this tool with these values."
The tool description is the only clue the model has for choosing a tool, so say clearly what each tool is for. And the app shouldn't blindly trust whatever tool and values the LLM asks for. It checks that the tool is allowed and the values make sense before running anything.
If a question says… → pick this
- “Defines a name, description and parameters so an LLM can use an external API”Function calling (tool definition)
- “The LLM runs the tool directly”Wrong — the app runs it
- “Takes the tool result and writes the final answer”The LLM's job
- “The model keeps picking the wrong tool”Write clearer tool descriptions
Calling one tool once is just the start. What does an agent do when, like the refund in chapter 1, it has to use several tools in turn and change course depending on the results?
Advertisement
03
Think, act, look at the result (ReAct and planning)
The agent in chapter 1 went round think → act → observe again and again. Writing out its thinking (reasoning), using a tool based on it (acting), and feeding the result into the next thought is called ReAct, short for reason + act. Writing the thought first helps it choose a better next step, and looking at the result before thinking again lets it get back on track if it heads the wrong way.
For a big job, the agent first breaks it into smaller tasks. This is called planning. The scene below shows an agent getting ready for a business trip. Run it through once, then make the hotel booking tool fail and run it again.
- Check schedule
- Pending
- Book train
- Pending
- Book hotel
- Pending
- Send itinerary
- Pending
An agent given a big goal breaks it into tasks and works through them
As soon as it got the goal, the agent split it into four tasks. This is called planning.
Automation that just follows fixed steps stops when something unexpected comes back. The agent saw the result "fully booked," changed its plan and went looking for another hotel. Being able to change the next step based on what just happened is the whole reason to use an agent.
The flip side is that an agent can get stuck repeating the same action forever. That's why you set limits, like a maximum number of steps or a cost cap where it stops.
If a question says… → pick this
- “Alternates reasoning and acting, feeding results back in”ReAct
- “Breaks a big goal into smaller tasks”Planning (task decomposition)
- “Changes the next step after seeing a tool result”Replanning based on observations
- “Keeps repeating the same action endlessly”Set a maximum number of steps and a cost limit
When an agent works on something for a long time, or talks to the same user again and again, it sometimes needs to remember what it learned last time.
Pro only
That’s the free part of this guide
The other 5 chapters are open to Pro subscribers. Each one continues with 3D visuals and “if a question says…” tips, and the last chapter lets you check yourself with a short quiz.
- 04Memory
- 05Multi-agent systems
- 06MCP and A2A
- 07Safeguards
- 08When to use an agent
PasslyExam
You have read the concept. Now test it on exam questions
PasslyExam offers original practice questions, explanations and full mock exams built around each certification’s exam guide. The explanations cover why the right option is right and why the look-alike options are wrong. Sign up to practice for free every day.