Types of AI agents

An AI agent is a model that takes actions in a loop: it observes, decides, uses a tool, and observes the result. This guide explains the main agent types, what each one is for, how to control it, and how to tell when an agent is the wrong tool.

AI agents in 60 seconds

  • What an agent is: a model inside a loop with tools and state. The loop is the difference from a single prompt.
  • The types differ by how they decide: reactive agents respond to each input; planning agents plan first; reflective agents check their own output; learning agents improve from feedback.
  • Most production agents are simple: a tool-using loop with a step limit. Heavier designs are justified only when the task needs them.
  • The main risks are cost and wrong actions: loops that never end, and tools that change data when they should only read it.
  • Rule of thumb: if a fixed pipeline can solve the task, use the pipeline. Use an agent when the next step depends on what was just learned.

The agent loop

Every agent, whatever its type, runs some version of the same cycle. The application keeps a state: the goal, the conversation so far, and the results of previous actions. On each turn, the model sees the state and the list of tools, then chooses either a final answer or a tool call. The application runs the tool, appends the result to the state, and loops. The types below differ in how much thinking happens before each action, how the state is kept, and what stops the loop.

The loop every agent type shares. The types differ in how the think step works.

A guide to each type

Every type on this page has its own in-depth guide with a diagram, a worked example, code, design decisions, metrics, and notes for your role.

The minimal agent loop with a step budget (illustrative) (python)
# Illustrative: the smallest useful agent loop.
# llm_decide() and the tools are placeholders for a model call and real functions.

MAX_STEPS = 8

TOOLS = {
    'search_orders': search_orders,   # read-only
    'refund_order': refund_order,     # changes data: needs confirmation
}

def run_agent(goal, user):
    state = [{'role': 'user', 'content': goal}]
    for step in range(MAX_STEPS):
        decision = llm_decide(state, tools=list(TOOLS))
        if decision.type == 'final':
            return decision.answer
        if decision.tool == 'refund_order' and not user.confirmed(decision.args):
            state.append({'role': 'tool', 'content': 'Needs user confirmation first.'})
            continue
        result = TOOLS[decision.tool](**decision.args)
        state.append({'role': 'tool', 'content': str(result)})
    return 'I could not finish within the step limit. Here is what I found so far.'

Part 1: how the agent decides

The first family of types is about the decision step: how much the agent thinks before it acts, and whether it looks back at its own work.

1. Reactive agent

A reactive agent maps each situation directly to an action. It does not keep a plan or a model of the world beyond the current input. The classic example is a thermostat or a rule-based chatbot that answers a message from a fixed set of triggers. Modern reactive agents use a model for the mapping, but they still act on the immediate input. They are fast, predictable, and easy to test, and they fail when a task needs several steps that depend on each other.

  • Good for: routing requests, simple lookups, and triggers such as 'when a ticket arrives, tag it'.
  • Strengths: low latency, low cost, easy to audit.
  • Weaknesses: cannot recover from a step that goes wrong unless the next input happens to fix it.

Read the full guide to the reactive agent: how it works, a worked example, code, design decisions, and how to measure it.

2. Deliberative (planning) agent

A deliberative agent builds an explicit plan before acting. Given a goal, it lists the sub-goals, the order, and the tools each step needs. It then checks the plan against what is known and executes it, revising when a step fails. Planning helps when steps depend on each other, such as 'find the customer, then their latest invoice, then draft a reminder that matches the amount'. The plan is also a useful artefact: a reviewer can read it before anything runs.

  • Good for: multi-step tasks with clear dependencies, such as data preparation or report generation.
  • Strengths: the plan can be reviewed and tested before execution.
  • Weaknesses: a plan made from incomplete information is confidently wrong, and replanning costs more calls.

Read the full guide to the planning agent: how it works, a worked example, code, design decisions, and how to measure it.

3. ReAct agent

ReAct, short for reasoning and acting, interleaves a short thought with each action. The model writes what it knows, what it needs, and which tool it will use, runs the tool, reads the result, and continues. The thought is visible in the trace, so a developer can see why each step happened. ReAct is the most common pattern in practice because it needs no separate planner. Its weakness is that a long trace can drift from the original goal, so the goal is usually repeated in every turn.

  • Good for: open-ended questions that need a few lookups, such as research or troubleshooting.
  • Strengths: simple to build, and the trace makes behaviour inspectable.
  • Weaknesses: can wander on long tasks, and traces get expensive as they grow.

Read the full guide to the react agent: how it works, a worked example, code, design decisions, and how to measure it.

4. Plan-and-execute agent

Plan-and-execute separates the two roles. A planner model writes the full plan once. An executor works through the steps, usually with a smaller or cheaper model, and only calls the planner again if a step fails. This keeps the expensive reasoning to one call and makes the costs predictable. The trade-off is rigidity: when the world changes mid-run, the plan may be out of date until the next replan.

  • Good for: well-defined tasks where most steps are routine and a few need judgement.
  • Strengths: lower cost than thinking at every step, and a clear point to add review.
  • Weaknesses: a stale plan keeps running, so replanning rules must be explicit.

Read the full guide to the plan-and-execute agent: how it works, a worked example, code, design decisions, and how to measure it.

5. Reflexive (self-critique) agent

A reflexive agent checks its own work before it stops. After drafting an answer or a change, it runs a critique step: does the output meet the goal, is each claim supported, does the code pass the tests. If not, it revises and tries again, up to a limit. Reflection catches many errors that a single pass misses, especially in writing and code. The cost is one or more extra calls per task, and a critic can be too strict or repeat the same mistake, so pair reflection with an objective check whenever one exists, such as a test suite.

  • Good for: writing, coding, and any output that can be checked against a rule.
  • Strengths: catches errors a single pass misses.
  • Weaknesses: extra cost per task, and a critic that shares the generator's blind spots adds little.

Read the full guide to the reflexive agent: how it works, a worked example, code, design decisions, and how to measure it.

6. Learning agent

A learning agent improves over time. It records outcomes, such as whether a user accepted an answer, whether a tool call succeeded, or how many steps a task took. Those records shape later behaviour: better tool choices, better examples in the prompt, or updated routing. Learning can be as simple as storing successful traces as examples, or as complex as fine-tuning. The safety rule is that learning should change only what is measured and reviewed, because an agent that learns from its own mistakes can repeat them.

  • Good for: repetitive work with clear success signals, such as ticket triage.
  • Strengths: gets better with use, without rewriting code.
  • Weaknesses: learns the biases of its feedback, and needs review before changes go live.

Read the full guide to the learning agent: how it works, a worked example, code, design decisions, and how to measure it.

Part 2: what the agent is built around

The second family describes the agent by its goal and by the environment it acts in. These labels come from the classic taxonomy of intelligent agents, and they remain useful when designing a system.

7. Goal-based and utility-based agents

A goal-based agent acts to reach a stated condition, such as 'the invoice is paid'. It chooses any action that moves toward the goal. A utility-based agent goes a step further: it scores outcomes, so that 'paid within three days and the customer is happy' beats 'paid in ten days'. In AI products, the utility is usually written as rules or a scoring function, such as cost, time, and risk. Utility makes trade-offs explicit, which is valuable when two good outcomes compete.

  • Good for: tasks with a clear end state and several acceptable routes.
  • Strengths: trade-offs are explicit and can be tuned.
  • Weaknesses: the scoring function must be right, or the agent optimises the wrong thing.

Read the full guide to the goal and utility agents: how it works, a worked example, code, design decisions, and how to measure it.

Part 3: the kinds of agent you will build

The third family is named by the job the agent does. Each one combines the decision styles above with a particular set of tools and constraints.

8. Tool-using agent

A tool-using agent is the most common type in products. It has a set of functions, each described in a machine-readable schema: a name, a purpose, and typed arguments. The model chooses a function and fills in the arguments. The application validates the arguments, runs the function, and returns the result. The schema is part of the design. A clear description makes the model pick the right tool, and a narrow argument type prevents many errors.

A tool definition with typed arguments (illustrative) (json)
{
  "name": "search_orders",
  "description": "Find a customer's orders by email, newest first. Read-only.",
  "parameters": {
    "type": "object",
    "properties": {
      "email": { "type": "string", "format": "email" },
      "limit": { "type": "integer", "minimum": 1, "maximum": 20, "default": 5 }
    },
    "required": ["email"]
  }
}
  • Good for: almost any product that connects a model to data or actions.
  • Strengths: clear boundaries; each tool can be tested and permissioned on its own.
  • Weaknesses: tool descriptions drift from behaviour over time, and wrong arguments are common without validation.

Read the full guide to the tool-using agent: how it works, a worked example, code, design decisions, and how to measure it.

9. Coding agent

A coding agent reads a repository, edits files, runs the tests, and reads the failures. Its tools are a file reader, an editor, a shell with restrictions, and a test runner. Tests are its strongest feedback: a passing suite is an objective signal the agent can loop on. Its main risk is destructive commands, so production designs run it in a sandbox with a limited shell and require review before changes merge.

  • Good for: bug fixes, refactors with tests, and boilerplate.
  • Strengths: tests give a clear, automatic stopping signal.
  • Weaknesses: can make a test pass by weakening the test, so reviews must check the tests too.

Read the full guide to the coding agent: how it works, a worked example, code, design decisions, and how to measure it.

10. Browser and computer-use agent

A browser or computer-use agent operates a graphical interface. It sees a screenshot or the page structure, chooses a click, a keystroke, or a form field, and observes the result. It can complete tasks that have no API, but every step is slower and less reliable than a function call. Prefer an API whenever one exists, and use the interface only for the steps that have no alternative. Restrict which sites and actions it may take, and require confirmation before payments or account changes.

  • Good for: legacy systems and websites with no API.
  • Strengths: works on any interface a person can use.
  • Weaknesses: slow, brittle when layouts change, and a high-risk surface for unintended actions.

Read the full guide to the browser agent: how it works, a worked example, code, design decisions, and how to measure it.

11. Voice agent

A voice agent handles spoken conversation in real time. Speech is converted to text, the agent reasons and calls tools, and the reply is converted back to speech. Latency is the defining constraint: a pause of more than a second feels broken. Designs stream partial results, allow the user to interrupt, and keep each turn short. Tools that take time, such as a database query, should announce progress rather than leave silence.

  • Good for: support lines, scheduling, and hands-free assistants.
  • Strengths: natural interaction for people who cannot type.
  • Weaknesses: tight latency budgets, and mistakes in speech recognition become mistakes in action.

Read the full guide to the voice agent: how it works, a worked example, code, design decisions, and how to measure it.

12. Long-running autonomous agent

Some tasks take hours or days: monitoring a system, processing a backlog, or running a research project. A long-running agent is not one loop but a sequence of runs with saved state, scheduled wake-ups, and checkpoints. Each run starts from the saved state, not from memory. Budgets for time, tokens, and tool calls are set for the whole task, and a human checkpoint sits at each irreversible step.

  • Good for: background work with clear milestones.
  • Strengths: can span days and survive restarts.
  • Weaknesses: state can become stale, and errors compound quietly if no one checks in.

Read the full guide to the long-running agent: how it works, a worked example, code, design decisions, and how to measure it.

How agents are coordinated

A single agent is often enough. When a task has several roles, or when parts can run in parallel, the system needs an orchestration pattern. Orchestration is a design decision, not a product feature, so it is worth naming the patterns explicitly.

  • Single agent: one loop with all the tools. Simplest, and the right default.
  • Pipeline: agents run in a fixed order, each passing its output to the next. Predictable and easy to test.
  • Supervisor (orchestrator and workers): one agent assigns sub-tasks to specialist agents and combines their results. Clear control, but the supervisor is a bottleneck and a single point of failure.
  • Router: a small step chooses which specialist handles a request. Cheap and effective for mixed traffic.
  • Peer handoff: agents pass control to each other directly. Flexible, but harder to trace.

Controls every agent needs

The type of agent matters less than the controls around it. Every production agent, whatever its design, needs the same protections, because the failure modes are shared.

  • A step budget and a cost budget. Stop the loop after a maximum number of steps and a maximum spend, and return a useful partial result.
  • Least privilege for tools. Give each tool only the access it needs. Separate read tools from write tools.
  • Confirmation before irreversible actions. Payments, deletions, and external messages need a human or an explicit approval step.
  • Validation of arguments. Check types, ranges, and permissions before running any tool, whatever the model asked for.
  • Full traces. Log each decision, tool call, argument, and result. Without traces, an agent failure cannot be reproduced.
  • Evaluation on realistic tasks. Test the whole loop on a set of tasks with known good outcomes, and measure success, steps, and cost.
Validate and permission every tool call before it runs (illustrative) (python)
# Illustrative: the model proposes a call; the application decides whether it runs.

READ_ONLY = {'search_orders'}

def execute_tool_call(call, user):
    tool = TOOLS.get(call.name)
    if tool is None:
        return 'Unknown tool.'
    if not validate_against_schema(call.args, tool.schema):
        return 'Invalid arguments.'
    if call.name not in READ_ONLY and not user.has_scope(call.name):
        return 'You are not allowed to do that.'
    if call.name not in READ_ONLY and not user.confirmed(call):
        return 'Please confirm this action first.'
    trace.log(call, user)
    return tool.run(**call.args)

The types compared

Agent typeHow it decidesBest forMain risk
ReactiveMaps each input to an actionRouting and simple triggersCannot recover from a failed step
Deliberative (planning)Writes a plan, then executes itMulti-step tasks with dependenciesStale or wrong plan
ReActShort thought before each actionOpen-ended lookups and troubleshootingDrift and growing traces
Plan-and-executeOne plan, cheaper executorRoutine tasks with few judgement pointsPlan goes stale mid-run
ReflexiveChecks and revises its own outputWriting, code, checkable outputsCritic shares the same blind spots
LearningImproves from recorded outcomesRepetitive work with clear signalsLearns the wrong lessons
Goal-based and utility-basedWorks toward a goal, scored by utilityClear end states with trade-offsWrong scoring function
Tool-usingChooses a function and argumentsMost product integrationsWrong or invalid arguments
CodingEdits code, runs tests, reads failuresFixes and refactors with testsWeakens tests to pass
Browser and computer-useActs on screenshots or page structureSystems with no APIBrittle and slow
VoiceReal-time turns with toolsHands-free and phone supportLatency and recognition errors
Long-runningRepeated runs with saved stateBackground work over hours or daysStale state, compounding errors

How to choose

  • Ask whether you need an agent at all. If the steps are known in advance, a pipeline with model calls is cheaper and easier to test.
  • Start with a tool-using agent in a ReAct-style loop with a step budget and full traces.
  • Add reflection when outputs can be checked and a single pass is not reliable enough.
  • Add planning when the task has dependencies that a single loop keeps losing track of.
  • Add orchestration only when roles are distinct or parallel work saves real time.
  • Add learning only after you can measure success and review the changes.

What this means for your role

Common mistakes

Further reading

Agent design improves with traces. Start with a small tool set, read every failed run, and change one thing at a time.

Search topics

↑↓ to move · Enter to open · Esc to close