AI Agents
In this article
- Say what makes a system an AI agent by asking who picks its next action.
- Tell an agent apart from a single model call and from a fixed sequence written in code.
- Explain why calling tools, or picking one of a few listed branches, does not make a system an agent.
- Terms defined here: observation, AI agent, control-flow ownership.
Overview
When a colleague calls a product an agent, the word alone does not tell you how it works. In a design review you need a sharper question: when this system has just learned something new, who decides what happens next, your code or the AI model that writes the replies?
Take one customer message and build the reply three ways: one model call, a fixed sequence written in code, and an assistant that picks its own next step. The three use the same model and can use the same order system. What separates them is who picks the step after the order lookup.
By the end you can say what an AI agent is in one sentence, sort a real system into one of the three shapes, and explain why tools on their own do not make a system an agent.
Brightline's assistant
In an invented example, Brightline, a home-internet provider, runs a support assistant on its website that answers customers and can look up an order, issue a refund of at most $50 and hand a conversation to a person on the support team. With asking the customer a question, that gives the assistant four actions: look up the order, ask the customer a question, issue a refund, hand off to a person.
The case: a customer writes that the router stopped working and that this month's $35 plan fee was charged twice. Suppose the order record, once someone looks it up, shows the $35 fee appears twice on this month's bill.
One model call
The simplest version sends the message to a large language model, the AI model that writes the replies, and posts what comes back. That one request, text in and text out, is a model call. A model with no tools can only answer with text. [3] So this version cannot see the order, cannot issue anything and cannot pass the case to a person. Its reply can only be general: sorry about the router, please contact billing about the charge.
Nothing follows the call. No one chooses a next step, because there is none.
A fixed sequence
The second version is a short program. Code checks that the customer is signed in, looks up the order, gives the model the message and the order record, and sends the draft the model writes. The order lookup here is a tool, a piece of code the program can run for one task, such as reading a record, whose output is handed back. [1]
After the lookup, the record says the fee was charged twice. That changes the words of the draft, which can now mention the double charge. It does not change the next step: the draft step was always next, because the programmer wrote it there before this customer ever wrote in. If the charge was a duplicate, nobody issues the refund unless a programmer added a branch for it in advance.
In LangGraph's terms this shape is a workflow: it follows code paths set ahead of time and runs its steps in a set order. [2] The model works inside the sequence; it does not steer it.
The assistant chooses
In the third version code offers the model the four actions and asks it what to do. Each action is offered as a tool, and the model asks for one with a tool call: its reply names one tool and fills in the arguments, application code runs that tool, and the result goes back to the model as the next message of the conversation. [1,2]
Here is how the case could run, in a made-up trace:
- The model reads the message and picks look up the order. Code runs the lookup.
- What comes back: $35 charged twice this month.
- The model reads that and picks issue a refund of $35 for the second charge. Code runs it.
- The model picks hand off to a person for the router, with a note of what it found. None of the four actions can fix a router, so the one left that helps the customer is a person.
At step 3, no line of code said "after a lookup that shows a duplicate charge, refund it". The model chose that from what it read. Change what the lookup returns, say the fee appears only once, and the same model on the same message could pick ask the customer a question instead, perhaps whether the second charge sits on a different card. The next step depends on what came back. That is also the weak point: a model that chooses can choose wrong, so an agent needs error logging and retries. [1]
What came back from the lookup has a name. An observation is the result of an action, a tool's output for example, which the model reads before it decides what to do next. [1,3]
Whether Brightline should let a model issue refunds without a person is a separate question from who picks the step, and a fixed sequence can issue refunds too.
Who picks the next step
That gives the test. A system is an AI agent when the model chooses the next action from what it observed, and code does not fix what follows that choice. The smolagents documentation puts it as programs in which the model's output steers the workflow, [1] and LangGraph's says agents set their own process and choice of tools. [2]
The property being tested is control-flow ownership: which part of the system, the application code or the model, decides which step runs next. [1,2]
An agent often takes many steps, choosing again after every observation, but the number of steps is not the test. Claude Code, Anthropic's assistant for the terminal, may need only one phase of work to answer a question about your code, and it is still the model that decided that was enough. [3] What counts is that the model, not the code, decides whether to go on and with what.
The three versions of the Brightline case side by side:
| Version | Who chooses the next step | What code fixes | What the model decides |
|---|---|---|---|
| One model call | No one: there is no next step | The single request | The words of the reply |
| Fixed sequence | Code | Every step and its order | The words of the draft |
| Assistant chooses | The model | Which actions exist and how each runs | Which action comes next, and when to stop |
Tools do not make an agent
The fixed sequence called a tool and a model, and it is still code-owned. Tools give a system things it can do; they say nothing about who decides when to do them. A workflow can call a tool or a model at every one of its steps. LangGraph's guide builds its workflows and its agents on the same kind of chat model, one that supports tool calling. [2]
The same goes for a model that picks between branches. Suppose Brightline adds a step where the model reads the message and answers "billing" or "technical", and code then runs the fixed path written for that label. The model made a choice, but only among branches code listed in advance, and code decides everything after it. Brightline's four actions are listed in advance too, but there the model picks again after each result and no code decides what follows its pick; the router picks once and hands control back to a path code wrote. LangGraph files this kind of sorting step under workflows. [2] smolagents treats agency as a spectrum and puts such a router on its second rung, one step above a model whose output does not change the flow at all; [1] by the yes-or-no test used here, it is not an agent.
:::note In practice (Nov 2026) Claude Code works through three phases, gathering context, taking action and verifying results, and it decides what each step needs from what the previous step taught it. [3] Asked to fix failing tests, it might run the tests, read the errors, open the source files, edit them and run the tests again, each tool use feeding the next choice. [3] The Claude Agent SDK puts the same tools and loop that run Claude Code in a library for Python and TypeScript, and defines an agent as an application that plans its own steps and calls tools. [4] :::
:::note In an interview Ask one question of any system: after a tool returns, does code or the model pick the next step? [1,2] Then add the trade-off: when every path can be written down ahead of time, plain code is more reliable, and an agent is often overkill. [1] :::
Common mistakes
- "It calls tools, so it is an agent." Check who picks the next tool. If code wrote the sequence, it is a workflow with tools.
- "It only takes one step, so it cannot be an agent." The length of the run is not the test. If the model decided that one step was enough, the model owned the control flow. [3]
Sources
- Introduction to agents (smolagents docs). Hugging Face. Checked 25 Oct 2026.
- Workflows and agents (LangGraph docs). LangChain. Checked 25 Oct 2026.
- How Claude Code works. Anthropic. Checked 24 Oct 2026.
- Agent SDK overview. Anthropic. Checked 24 Oct 2026.
Check yourself
Check yourself
Question 1 of 13
Which question best tests whether a system is an AI agent?
Your first check counts towards your result.