Key takeaways
- Anthropic defines an agent as a system where the model directs its own process and tool use, while in a workflow predefined code paths do.
- The reasoning-and-acting loop behind agents comes from the ReAct paper, first submitted on October 6, 2022.
- Anthropic advises using the simplest solution first, because agents cost more and errors can compound across steps.
An AI agent is a program in which a language model decides, step by step, what to do next and uses tools to do it, until the task is done. Anthropic's Building effective agents puts the line in one place: in a workflow, code decides the steps. In an agent, the model does.
That is a narrower definition than the one most product pages use. It is also the more useful one, because it tells you what you are paying for and what can go wrong.
What an AI agent is
Anthropic, in a post published on December 19, 2024, separates two things that are often both called agents. Workflows are, in its words, "systems where LLMs and tools are orchestrated through predefined code paths." Agents are systems where the model "dynamically" directs its own process and tool use, and keeps control over how it gets the task done.
Google Cloud's explainer (last updated April 2, 2026) is broader. It calls AI agents "software systems that use AI to pursue goals and complete tasks on behalf of users," and lists reasoning, acting, observing, planning, collaborating and self-refining as key features.
OpenAI's agents guide gives no formal definition. It says agents "can plan and complete tasks using tools, work with other agents, and maintain context across steps."
The three agree on the core: a model, tools, and a loop. They differ on how much freedom the model has. Anthropic reserves the word for the free end of that range.
How an agent works
The loop is simple. The model reads the goal, picks an action (search, read a file, run code, call an API), sees the result, and decides what to do next. It stops when it thinks the job is finished or it hits a limit.
The idea comes from a research paper, ReAct: Synergizing Reasoning and Acting in Language Models, by Shunyu Yao and colleagues, first submitted on October 6, 2022. ReAct has the model write out its reasoning and its actions in turn, so the reasoning guides the next action and the result of the action corrects the reasoning. With only one or two examples in the prompt, the authors report it beat imitation and reinforcement learning methods by an absolute 34% success rate on the ALFWorld benchmark and 10% on WebShop. Google's page cites ReAct as the source of the reasoning-and-acting pair.
Three parts make an agent:
- A model that reasons and chooses actions.
- Tools it can call, such as search, code execution or a company's internal APIs. Standards like the Model Context Protocol connect agents to tools; our explainer on what MCP is covers how.
- Context and memory that carry across steps. Many agents also pull in outside documents with retrieval, which we explain in what RAG is.
AI agent vs workflow vs chatbot
A chatbot answers one message at a time. A workflow runs a fixed sequence in which a model fills in some steps. An agent chooses its own sequence.
Anthropic describes five workflow patterns that sit between a plain model call and a full agent:
| Pattern | What it does |
|---|---|
| Prompt chaining | Splits a task into steps, each model call using the previous output |
| Routing | Classifies an input and sends it to a specialized follow-up |
| Parallelization | Runs subtasks at the same time, or repeats one for several outputs, then combines them in code |
| Orchestrator-workers | A central model breaks the task up, hands pieces to worker models and merges the results |
| Evaluator-optimizer | One model writes, another critiques, in a loop |
Anthropic's advice is to start with "the simplest solution possible" and add complexity only when needed. Many tasks never need an agent.
When you need an agent
Anthropic says agents suit open-ended problems where you cannot predict the number of steps or hardcode the path. The cost is real: higher autonomy means higher cost and the chance of errors that compound over many steps. Anthropic recommends extensive testing in sandboxed environments and says you must be able to trust the model's decisions.
OpenAI points builders to its Agents SDK when they want custom tools and workflows inside their own application, and to its Agents API for long-running tasks that OpenAI manages. The SDK's runner handles the agent loop and handoffs between agents.
Anthropic's other point is about tools. It says to give tool design as much care as the main prompt, with clear examples, edge cases and boundaries between similar tools. In its own coding-agent work, requiring absolute file paths removed a class of errors caused by relative paths.
What we don't know
There is no single accepted definition. "Agent" in a product announcement can mean anything from a chat feature with one tool to a system that runs for hours. Ask what chooses the next step, what tools it can reach, and what stops it. Vendor pages describe capabilities; none of the three sources above publishes failure rates for agents in general.
For recent launches, see our coverage of Perplexity's always-on Teammates agents.
Frequently asked questions
What is the difference between an AI agent and a chatbot?
A chatbot replies to one message at a time. An agent pursues a goal over several steps, choosing tools and actions itself, and keeps context between steps.
What is the difference between an AI agent and a workflow?
Anthropic says workflows follow predefined code paths, while in an agent the model decides its own steps and tool use.
What is an AI agent with an example?
A coding agent that reads files, edits code, runs tests and reacts to the results until the task passes is a common example of the loop described by Anthropic and Google.
When should you use an AI agent?
Anthropic says agents fit open-ended problems where the number of steps can't be predicted, and warns of higher cost and compounding errors. For simpler tasks, a fixed workflow is usually enough.
Sources
- Building effective agentsAnthropic
- AgentsOpenAI
- What is an AI agent?Google Cloud
- ReAct: Synergizing Reasoning and Acting in Language ModelsarXiv