AI Agent
An AI agent is a system built around a model that decides its own next action, step by step, until a task is finished. At each step, the model looks at where things stand and picks what to do next — call a tool (a specific outside action it can trigger, like running a search or reading a file), look something up, ask for more information, or stop because the task is done. Nobody wrote that exact sequence of steps in advance. The model works it out each time the program actually runs.
That's the one thing that makes something an agent instead of a plain script: who decides the next step. In a normal program, a person wrote every step ahead of time. In an agent, the model decides while the program is running, based on what just happened.
One loop, start to finish
A support agent gets the message "my order never arrived." Nobody wrote the steps below. The model picked each one after seeing what the last returned.
- Look up the order. It shipped nine days ago.
- Check the carrier's tracking. The last scan was six days ago at a sorting facility, and nothing since.
- A stall rather than a delivery. Is it this parcel or that facility? Check whether other recent orders routed through the same place are also stuck.
- Three of them are. So it's the facility, and a carrier trace on one parcel won't tell anyone anything new.
- Reship now instead of opening a trace, and say so.
Step 3 is the one worth looking at. Checking other customers' orders is not an obvious move, and no one would have written it into a missing-parcel script — it only makes sense once step 2 came back with a stalled scan rather than a delivery or a loss. Had tracking shown "delivered," the next step would have been a photo-of-delivery lookup and a conversation about the address instead, and the task would have ended in a different place entirely.
The number of lookups isn't knowable up front either. This one took four; a cleanly lost parcel takes two.
Debugging an unfamiliar error has the same shape. Read the error, check the logs, form a guess, look at the code, try a fix, run the tests — and how many times you go round depends entirely on what each attempt turns up. There's no branch count to write down ahead of time, because the number of steps isn't known until the work is done.
Agent or workflow?
A single call to a model takes one input and produces one output — it can't look something up partway through and change its answer based on what it finds. A fixed workflow can call tools and look things up too, but a person has to write out every possible path in code ahead of time. That works well when the steps are known and don't change. When the choice is genuinely close, Agent vs Workflow works through how to decide on a real task.
An agent is for the case in between: you know the goal, but not the exact steps to reach it, or the right steps depend on what happens along the way.
If you can already write out the exact sequence of steps — even a long one — a fixed workflow beats an agent every time: it's more predictable, cheaper to run, and easier to debug, because nothing is left for the model to get wrong. That's also the field's own working advice, not just this site's: Anthropic's engineering team recommends starting with the simplest approach that works — often a fixed workflow, or even one plain model call — and reaching for an agent's open-ended decision-making only once you genuinely need it. Every decision an agent makes is a place it can go wrong; a workflow with ten fixed steps has zero such places, while an agent making ten decisions has ten.
Related but different terms
"Agentic" is a spectrum, not a yes-or-no label — a system can use a model to make a few decisions inside an otherwise fixed process without being a full agent. "Agentic workflow" usually means exactly that: a mostly-fixed process with some model-made decisions mixed in, short of full autonomy. The term closest to it in everyday use is "chatbot" — see Agent vs Chatbot for where that line actually falls.
A subagent is a full agent in its own right — the difference is only who calls it: another agent, instead of a person.