Skip to content

AI agent

Also called: AI agents, LLM agent, LLM agents

Published:

How does an AI agent work?

Anthropic draws a line between two kinds of systems. In workflows, a language model and its tools are orchestrated through predefined code paths. In agents, the model dynamically directs its own process and tool use [1]. An agent usually runs as a loop: the model calls a tool, reads what comes back from the environment and picks the next step accordingly. That is why it needs ground truth from the environment, such as tool output or the result of running code, at each step to judge its progress [1].

An early example of the idea is ReAct, published in 2022. Its authors had a language model interleave reasoning traces with actions and showed it solving question answering and fact verification tasks by interacting with a simple Wikipedia API [2]. On the ALFWorld and WebShop benchmarks, ReAct beat imitation and reinforcement learning methods by an absolute success rate of 34 and 10 percentage points [2].

When does an agent make sense?

Anthropic recommends agents for open-ended problems where the number of steps is hard or impossible to predict [1]. Its own coding agent is the concrete example: it resolves SWE-bench tasks that require edits across several files from a single task description [1]. For well-defined tasks, workflows offer more predictability and consistency, and Anthropic advises starting with the simplest solution that works and adding complexity only when needed [1].

What are the risks?

Autonomy has a price. Costs go up, and a mistake in one step can compound in the steps that follow [1]. Agentic systems trade latency and cost for better task performance [1].

Frequently asked questions

Is a chatbot the same as an AI agent?

No. A chatbot usually gives one reply per message. An agent plans several steps toward a goal on its own, calling tools and checking their results.

Why can agents compound errors?

Each step builds on the one before, so an early mistake can grow. Checking results from the environment at every step helps contain it.

Sources

  1. Building effective AI agents — Anthropic
  2. ReAct: Synergizing Reasoning and Acting in Language Models — arXiv