AI Agent

Also called LLM agent, language model agent

Quick answer

An AI agent is a system in which a language model chooses its next steps to reach a goal. It reads the task, picks an action such as a search or a code run, sees the result, and repeats until it judges the job done or a limit stops it. The model, not a fixed script, controls the process.

~20 sec read

011 min

The problem an AI agent solves

Before agents, a program that used a language model followed steps a developer wrote in advance. A support tool might classify an email, look up the order, and draft a reply, always in that order. That design works when every case needs the same steps. It fails when the right steps depend on what turns up along the way.

Take a customer who writes that a parcel is late and asks for a refund. One case needs a carrier lookup. Another needs a check of the refund policy first. A third needs a question back to the customer, because the order number is missing. A fixed script needs a branch for each case, and any case the developer did not predict goes unhandled.

An AI agent solves this by letting the model pick the next step after each result. The price is that the developer gives up some control over what happens. Anthropic's engineering team wrote in December 2024 that agentic systems often trade latency and cost for better task performance, and you should consider when this tradeoff makes sense.

So the question this concept answers is not "can a model do this task?" It is "does this task need the model to decide the steps, or can a person write the steps down?"

022 min

How an AI agent works

An AI agent has four parts:

  • A language model. This is a model trained on large amounts of text to predict what comes next. It reads the current state of the task and produces the next action.
  • Tools. These are functions the surrounding program offers, such as an order lookup, a web search, a code runner, or an email sender.
  • A context. This is everything the model has seen so far in this task: the goal, the instructions, and every earlier result.
  • A stop rule. This is the condition that ends the run.

The model does not run a tool itself. It writes a structured request, for example "look up order 4417". The program runs the request and returns the result. This exchange is called tool use.

The step where the interesting thing happens is the decision. After every result, the model chooses between calling another tool and giving a final answer. No developer wrote that choice in advance. The cycle of decide, act, observe and decide again is the agent loop. Anthropic describes agents as typically just LLMs using tools based on environmental feedback in a loop.

Follow the refund request from the start.

  1. The context holds the customer's message, the refund policy, and three tools: order lookup, carrier tracking, and refund.
  2. The model calls order lookup. The result says the order shipped nine days ago.
  3. The model calls carrier tracking. The result says the last scan was at a depot six days ago.
  4. The model compares this with the policy in its instructions. The policy allows a refund when there has been no scan for seven days or more. The gap is six days, so the model decides it does not yet qualify. It writes to the customer that the parcel is still moving and says when the case will be checked again.
  5. The model has no further action to take, so it ends the run.

Each result is added to the context, so every later decision uses everything seen so far. That is why the same agent can take two steps for one customer and seven for another.

The stop rule matters as much as the model. Anthropic notes that a task often ends on completion, but it is also common to include stopping conditions, such as a maximum number of iterations, to maintain control. Without a cap, an agent that misreads a result can repeat the same action until the budget is gone.

032 min

AI agent vs. a workflow

Anthropic's 2024 article draws the line that most teams now use. Workflows are systems where LLMs and tools are orchestrated through predefined code paths. Agents are systems where LLMs dynamically direct their own processes and tool usage, maintaining control over how they accomplish tasks.

WorkflowAI agent
Who picks the next stepThe developer's codeThe model
Number of stepsKnown before the runKnown only after the run
Cost and delayLower and predictableHigher and variable
TestingTest each step aloneTest whole runs, many times
FitsTasks with a writable pathOpen-ended tasks

The fact that decides between them is whether you can write the steps down before the task starts. If you can, use a workflow. A fixed chain of model calls is closer to an agentic workflow than to an agent, even when a product page calls it an agent.

The answer is sometimes both. A workflow can run most of a task and hand one open-ended step, such as researching an unfamiliar customer question, to an agent.

The broader entry agent covers systems that are not built on a language model at all. A thermostat fits that older definition. This entry covers only the language-model kind. When several of these systems work together on one task, the result is a multi-agent system.

041 min

A named test: WebArena

Claims about agents are easy to make and hard to check, so it helps to look at one test that checks them. WebArena was published in July 2023 by Shuyan Zhou and colleagues. It builds working copies of four kinds of website: online shopping, a discussion forum, collaborative software development, and content management. Each task is a long goal written the way a person would phrase it, and a task counts as done only if the final state of the site is correct.

That last rule is the useful part. The test does not ask whether the agent's steps looked sensible. It asks whether the order was placed, the post was made, or the repository was changed.

The authors reported that their best GPT-4-based agent only achieves an end-to-end task success rate of 14.41%, significantly lower than the human performance of 78.24%.

Two details keep this figure honest. It is a 2023 snapshot of one GPT-4 agent, so it is not a statement about any later system. And the tasks are long, so one wrong click early in a run can ruin the whole result. The number is a measurement of reliability across many steps, not of how well the model writes.

052 min

A second case: parallel agents for research

WebArena tests one agent acting inside a website. A different kind of case is the Research feature that Anthropic described in June 2025. A lead agent plans a research process from the user's question and then creates several agents that search for information at the same time. Each one reports back, and the lead agent combines what they found.

The one variable that differs from WebArena is the number of agents. WebArena measures one agent at a time. The Research system splits a task across many.

Anthropic reported that a multi-agent system with Claude Opus 4 as the lead agent and Claude Sonnet 4 subagents outperformed single-agent Claude Opus 4 by 90.2% on its internal research eval.

Read this number with its source in mind. It comes from the vendor's own test of its own product, so it shows what the team measured, not an independent result. It also does not say that more agents always help.

What the two cases teach together is that where an agent works well depends on the shape of the task. Research can be split into searches that do not depend on each other, so parallel agents fit. A checkout flow on a website is one chain of dependent steps, so splitting it adds coordination without adding speed. Anthropic's article makes a related point about code: agents work well there because code solutions are verifiable through automated tests.

061 min

What an AI agent means for your work

An AI agent changes decisions for each role that ships one.

  • A PM decides whether the task needs an agent at all. Write the steps down. If you can, a workflow is cheaper and easier to test. If you cannot, define what "done" means in terms of an outcome you can check, such as a refund issued or a ticket closed.
  • A designer decides where the agent pauses. Show each action the agent takes, show what it is about to send before it sends it, and give the user a way to undo. An agent that acts without showing its steps leaves the user unable to tell a good run from a bad one.
  • An engineer decides what each tool is allowed to do. A "refund up to a set amount" tool is safer than direct access to the payments database. Log every tool call with its input and result, and set a cap on steps and on spend.
  • A founder decides how to price and promise. The cost of a run varies with the number of steps, so pricing per message can lose money on a hard task. Promising a success rate needs a measured one, taken over repeated runs.

In every role, the work moves from "what should the system do?" to "what is the system allowed to decide, and how will we know when it decided badly?"

071 min

What an AI agent costs

Every step is another model call, so cost and delay grow with the number of steps. A chat answer is one call. An agent run is as many calls as the loop takes, and the count is not known in advance.

Anthropic measured the difference in June 2025. In Anthropic's data, agents typically used about 4× more tokens than chat interactions, and multi-agent systems used about 15× more. A token is the small piece of text a model reads or writes, and providers charge by the token.

Two costs sit outside the token bill. The first is testing, because you must test whole runs many times, not single answers. The second is monitoring, because a run that goes wrong costs money while it is going wrong. Anthropic states that the autonomous nature of agents means higher costs, and the potential for compounding errors.

082 min

What an AI agent does not solve

Reliability across repeated runs

The τ-bench test, published by Shunyu Yao and colleagues in June 2024, puts an agent in a conversation with a simulated customer. The agent has tools and company rules to follow. The authors reported that even state-of-the-art function calling agents (like gpt-4o) succeed on fewer than half the tasks, and are inconsistent: pass^8 was under 25% in the retail domain. The pass^k metric asks whether the agent solved the same task correctly in all k attempts. A system that succeeds on one run in two is not one a support team can leave unattended.

Wrong tool for a known path

A nightly export of invoices to the accounting system has the same steps every night. An agent adds cost and a chance of error to a task that a plain script does the same way every time. The right tool is a script or a workflow.

Text that acts as instructions

An agent reads web pages, emails and documents, and the model cannot reliably tell that text apart from its own instructions. In 2023, Kai Greshake and colleagues argued that LLM-integrated applications blur the line between data and instructions. They showed that a web page written by an attacker could steer a real product. This is prompt injection, and an agent raises the stakes because it can act on what it reads.

The usual defences are guardrails: narrow tools, a person's approval before an action that cannot be undone, and sandboxed testing before release. None of them removes the risk.

091 min

Where the meaning of AI agent is contested

There is no agreed definition, and the same word covers different things. Anthropic says so directly: some customers define agents as fully autonomous systems that operate independently over extended periods, using various tools to accomplish complex tasks. Others use the term to describe more prescriptive implementations that follow predefined workflows.

A second disagreement is about age. The classical definition from Russell and Norvig, summarised on Wikipedia, calls an agent anything that perceives its environment through sensors and acts upon that environment through actuators. By that definition an agent does not need a language model, and a thermostat counts. The language-model sense is a recent narrowing of an older idea.

The practical result is that a product page saying "AI agent" tells you little. Three questions give you the real answer:

  • Who picks the next step, the code or the model?
  • Which tools can it call, and which of them change something that cannot be undone?
  • What ends the run?

Until the word settles, judge a system by those answers and not by its label.

?6 questions

Questions people ask

What is an AI agent in simple terms?

An AI agent is a language model that decides its own steps. It uses tools such as search or code, reads each result, and chooses what to do next until the goal is met or a limit stops it.

Is an AI agent the same as a chatbot?

No. A chatbot answers each message with one reply. An AI agent can take many actions between your request and its answer, such as looking up records or changing data, and it chooses those actions itself.

When should I use an AI agent instead of a workflow?

Use an agent when you cannot write the steps down before the task starts. If the steps are known, a workflow is cheaper, faster and easier to test. Many systems use a workflow with one agent step inside it.

Does an AI agent need a vector database or fine-tuning?

No. The required parts are a language model, tools, a context and a stop rule. A vector database or a fine-tuned model can be added for particular tasks, but neither defines an agent.

How much does an AI agent cost to run?

It costs more than a chat. Anthropic reported in June 2025 that agents typically used about 4 times the tokens of a chat, and multi-agent systems about 15 times. Your cost depends on how many steps each task takes.

What are the main risks of an AI agent?

The main risks are compounding errors, inconsistent results across runs, and prompt injection, where text on a page or in an email steers the agent. Limit what its tools can change and require approval for irreversible actions.

§6 sources

Sources

Show all 6 sources
  1. Anthropic (Dec 19, 2024). Building effective agents.

  2. Anthropic (Jun 13, 2025). How we built our multi-agent research system.

  3. Zhou, S. et al. (2023). WebArena: A Realistic Web Environment for Building Autonomous Agents. arXiv:2307.13854.

  4. Yao, S., Shinn, N., Razavi, P., Narasimhan, K. (2024). tau-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains. arXiv:2406.12045.

  5. Greshake, K. et al. (2023). Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection. arXiv:2302.12173.

  6. Wikipedia. Intelligent agent.

Keep reading

More from AI & Engineering

All of AI & Engineering
All of AI & Engineering

Missing a concept?

Tell us what to write next. We’ll email you when it’s live.

Several? Separate them with commas.

Only to tell you when it’s live.

How we use your email: privacy.