Building with AI

AI agents

4 min readintermediateUpdated 28 Sept 2026
1 · In one line

An AI agent is a language model that chooses its own next steps and tools while it works through a task.

1 · What it is

People use the word agent for more than one design. Anthropic calls the whole family agentic systems, then splits workflows from agents. A workflow runs language models and tools along paths that code has already chosen. An agent lets the model direct its own process and its own tool use.

The usual implementation is a model in a loop, calling tools and reading environmental feedback. A person begins with a command or an interactive discussion. Once the task is clear, the agent plans and can return to the person for more information or judgement. During the run it needs ground truth from the environment at each step. Stopping conditions such as a maximum number of iterations are a common way to keep control.

The recommendation is to start with the simplest design, which may mean not building an agent at all. Agentic systems often trade latency and cost for better task performance. Autonomous runs mean higher costs and the potential for compounding errors. Anthropic recommends extensive testing in sandboxed environments, with guardrails. For many applications, one model call with retrieval and in-context examples is enough. Agents are the better fit when the task needs flexibility and the model must decide at scale. On coding work, tests make a solution checkable and give the agent feedback for another try. Human review remains necessary so a code change still fits the wider system.

The basic block is a model augmented with retrieval, tools and memory. Prompt chaining is one fixed workflow. Each model call handles the output of the call before it. Routing classifies an input and sends it to a specialised follow-up. Those workflows are still paths a developer wrote down.

ReAct has the model produce a reasoning trace and an action, interleaved. A reasoning trace does not affect the external environment. An action can gather information from a knowledge base or an environment. OpenAI describes an agent as something that can plan, use tools, work with other agents and keep context across steps. You choose the runtime by where that orchestration should run. Agents are only as effective as the tools they are given. The same starting conditions can still produce different responses. The model may call a tool, answer from general knowledge, or ask a clarifying question. In current tool use, the model returns a structured call that your application or Anthropic then executes.

2 · Why it exists

Some tasks do not have a step count you can write down before the model starts.

No fixed routeWhen the number of steps cannot be predicted, the path cannot be hardcoded in advance.
Needs evidenceAfter each action the agent needs ground truth from the environment, such as a tool result or code that actually ran.
Errors can stackLonger runs cost more, and one bad step can bend the steps that follow it.
3 · How it works

Watch one task go around the loop.

The model keeps control of which tool it calls next.
  1. 1 · askThe work starts from a person's command, or from a conversation that makes the task clear.
  2. 2 · decideThe model chooses the next action and which tool to call, keeping control of how the task proceeds.
  3. 3 · observeThe tool result, or the result of running code, comes back as ground truth for that step.
  4. 4 · stopThe loop ends when the task is finished, or when a maximum number of iterations is reached.

In this design an agent is a model using tools, then reading environmental feedback.

A reasoning trace does not affect the external environment.
4 · Where it's used
WhoWhat they askWhat it works with
Support lead“Can you refund this order and tell the customer?”Order record, refund action, reply
Engineer“Fix the failing test described in this issue.”Repository, test results, file edits
Researcher“Gather the sources that answer this question.”Search steps the model chooses as it goes
Operations“Keep checking until the job finishes or you hit the limit.”Tool results and a maximum iteration count
5 · What it solves, and what it doesn't
solves
  • Open-ended work where the number of steps is hard to predict and the path cannot be hardcoded.
  • Coding agents can iterate on solutions using test results as feedback.
  • Support actions such as issuing refunds or updating tickets can be handled programmatically.
  • A stopping rule, such as a maximum number of iterations, bounds a run that would otherwise stay open.
doesn't solve
  • It is a poor fit when one model call, with retrieval and examples, already does the job.
  • A workflow with the path fixed in code is the more predictable design for a well-defined task.
  • Autonomous runs mean higher costs and the potential for compounding errors.
  • Sandbox tests and human review still matter. A passing automated test does not show that a change fits the wider system.
6 · Go deeper

Sources used

This explainer is written in original language. The links below support its factual claims.

  1. officialBuilding effective agents, Anthropic · read 28 Sept 2026
  2. paperReAct: Synergizing Reasoning and Acting in Language Models, Yao et al. · read 28 Sept 2026
  3. docsAgents, OpenAI · read 28 Sept 2026
  4. officialWriting effective tools for agents — with agents, Anthropic · read 28 Sept 2026
  5. docsTool use, Anthropic · read 28 Sept 2026