Foundations

What is an AI Agent?

Also called: LLM agent, autonomous agent

Updated June 24, 2026
Quick Definition

An AI agent is a software system that uses a language model not just to generate text but to decide on and take actions toward a goal. It pairs the model with tools it can call, memory of what has happened, and a loop that runs an action, observes the result, and chooses the next step — repeating until the task is done.

Why AI agents matter

A model on its own can only emit tokens. It cannot look something up, write to a database, send a message, or check whether an action succeeded. For tasks that require interacting with the world — answering a question that depends on live data, completing a multi-step request, resolving a ticket — text alone is not enough.

An agent closes that gap by giving the model the ability to act and to react. Because the agent chooses its actions based on what it observes, it can handle tasks whose exact steps are not known in advance. That flexibility is the reason agents are useful, and also the reason they are harder to operate than a single model call: an agent that takes real actions over many steps can fail midway, repeat a side effect, or pause indefinitely waiting for a person, and a production system has to account for each of those.

How it works

Most agents are assembled from four parts that interact each turn:

  1. A model receives the goal and the history so far and decides what to do next — call a tool, hand off to another agent, or produce a final answer.
  2. Tools are functions the model is allowed to invoke, such as a search call, a database query, or an external API. Tool use is what lets the model affect anything outside itself.
  3. A loop executes the chosen tool, returns the result to the model, and repeats. Each iteration is conditioned on the last, so the path is decided as the task unfolds.
  4. Memory carries relevant context — the conversation, prior results, retrieved facts — so the agent stays coherent across steps.

The loop continues until the model signals completion or a stop condition (a step limit, a guardrail, a required approval) halts it.

AI agent vs. chatbot

A chatbot and an agent can share the same conversational surface, but they differ in what they can do. A chatbot generates responses; the interaction begins and ends with text. An agent can take actions between messages — querying systems, calling APIs, running code — and use the results to decide what to do next. A chatbot can tell you the status of an order; an agent can look it up, change it, and confirm the change.

In practice

A durable, observable runtime treats an agent as a long-lived process: it persists each step so a run survives crashes and redeploys, and records every decision and tool result for inspection. This is what makes the reasoning loop safe to run unattended, lets tool calls be retried without repeating side effects, and keeps memory consistent across a run. To build a first agent, see the Agent primitive.

Frequently asked questions

What is the difference between an AI agent and a chatbot?

A chatbot exchanges messages and generates replies. An agent can also take actions — calling tools, querying systems, and reacting to results across multiple steps — so it can complete a task rather than only talk about it.

What are the core components of an AI agent?

An agent typically combines four parts: a model that reasons and decides, tools it can call to act, memory that carries context across steps, and a loop that runs actions and feeds the results back to the model.

What is the difference between an agent and a workflow?

A workflow is a defined sequence of steps. An agent decides its own next step at runtime. An agent can be one step inside a workflow, and a workflow can coordinate several agents.

See also in the docs

Related terms