Types of AI Agents
"Agent" covers very different machines. Four questions tell you which one you are building.
Classify an agent by four independent choices. How does it decide? Reactive or deliberative. Does the same input give the same output? Deterministic or probabilistic. Does it remember? Stateless or stateful. How long does a task live? Seconds or days. Each choice changes how you test, deploy and secure the system.
What you will learn: the classic agent types, the four design dimensions, what each costs and how to combine them.
Prerequisites: What Is Agentic AI? and The Agent Loop: Observe, Reason, Plan, Act, Reflect. Basic Python for the code.
Four questions, not one list
The classic textbook types
Long before language models, artificial intelligence textbooks described agents by how much they know and consider. Russell and Norvig's well-known scheme is still a helpful vocabulary.
| Type | Decides using | Everyday example | Language-model equivalent |
|---|---|---|---|
| Simple reflex | The current input and fixed rules | A thermostat | One classification call that routes a message |
| Model-based reflex | Input plus a record of what it cannot see now | A robot vacuum remembering walls | Rules plus conversation state |
| Goal-based | Which actions lead to a goal | Route planner | An agent choosing tools until a task is done |
| Utility-based | Which outcome is best across trade-offs | Choosing cheapest acceptable delivery | An agent ranking options by cost, time and risk |
| Learning | Feedback that changes future behavior | A recommender that adapts | An agent that stores lessons, or a model that is retrained |
Reactive and deliberative agents
A reactive agent maps what it sees directly to an action. It is fast, cheap and predictable, and it cannot look ahead. A deliberative agent builds or consults a picture of the situation, considers options and then acts. It handles harder problems and costs more time, and its picture can be wrong or out of date.
| Aspect | Reactive | Deliberative |
|---|---|---|
| Looks ahead | No | Yes |
| Response time | Short and steady | Longer and variable |
| Needs a model of the world | No | Yes, even a rough one |
| Typical failure | Stuck or short-sighted | Confident plan based on wrong facts |
| Test with | Input and expected action | Scenarios, including changes mid-plan |
See the difference
Both agents below cross the same warehouse floor from S to G. The reactive agent always steps toward the goal. The deliberative one searches the map before moving.
"""A reactive agent and a deliberative agent in the same warehouse."""
from collections import deque
FLOOR = [
"S....#....",
"####.#.##.",
"...#.#.#..",
".#.#...#..",
".#.####.#.",
".#......#G",
]
MOVES = {"east": (0, 1), "south": (1, 0), "west": (0, -1), "north": (-1, 0)}
def find(mark):
return next((r, row.index(mark)) for r, row in enumerate(FLOOR) if mark in row)
def neighbors(cell):
for name, (dr, dc) in MOVES.items():
r, c = cell[0] + dr, cell[1] + dc
if 0 <= r < len(FLOOR) and 0 <= c < len(FLOOR[0]) and FLOOR[r][c] != "#":
yield (r, c)
def reactive(start, goal, limit=60):
"""Rule: step to the open neighbor that looks closest to the goal."""
here, path = start, [start]
distance = lambda cell: abs(cell[0] - goal[0]) + abs(cell[1] - goal[1])
while here != goal and len(path) <= limit:
here = min(neighbors(here), key=distance)
path.append(here)
return here == goal, path
def deliberative(start, goal):
"""Search a model of the floor first, then follow the plan."""
queue, came_from = deque([start]), {start: None}
while queue:
cell = queue.popleft()
if cell == goal:
path = []
while cell is not None:
path.append(cell)
cell = came_from[cell]
return True, path[::-1], len(came_from)
for nxt in neighbors(cell):
if nxt not in came_from:
came_from[nxt] = cell
queue.append(nxt)
return False, [], len(came_from)
if __name__ == "__main__":
start, goal = find("S"), find("G")
ok, path = reactive(start, goal)
print(f"reactive: reached={ok} moves={len(path) - 1} "
f"distinct cells={len(set(path))}")
print(f" last four positions: {path[-4:]}")
ok, path, looked = deliberative(start, goal)
print(f"deliberative: reached={ok} moves={len(path) - 1} "
f"cells examined before moving={looked}")
Output:
reactive: reached=False moves=60 distinct cells=10
last four positions: [(3, 6), (3, 5), (3, 6), (3, 5)]
deliberative: reached=True moves=20 cells examined before moving=23
The reactive agent oscillates between two cells, because every step away from them looks worse. The deliberative agent examines the floor first and finds a path. The lesson is not that planning always wins. It needed a correct map, which real environments often lack. If a pallet blocked the route, it would have to notice and plan again.
One task, four designs
Take a delayed delivery. The goal is the same each time; the design changes what the system can cope with.
| Design | Behavior | Copes with | Misses |
|---|---|---|---|
| Simple reflex | If the message mentions "late", send the tracking link | The most common question | A parcel already marked delivered but not received |
| Model-based | Also remembers that a link was sent yesterday | Avoids repeating itself | Still cannot work out what to do next |
| Goal-based | Aims to get the item to the customer; checks carrier, stock and options | Unusual causes | May pick an expensive remedy |
| Utility-based | Weighs arrival date, cost and policy before proposing | Competing priorities | Only as good as the weights it is given |
Notice that "goal-based" introduces a new risk along with new ability. A system told to get the item delivered may find ways that nobody intended unless limits are stated. Goals say what to achieve; rules say what must not happen on the way. Both are needed, and the rules belong in code where possible.
When reactive is the better engineering
Reactive designs are sometimes treated as primitive. In production they are often preferred, because they are quick, inexpensive, easy to explain and easy to test exhaustively. If most requests fall into a few well-understood groups, handle those reactively and measure how many remain. Only that remainder needs deliberation. This also keeps the expensive and variable part of the system small, which makes problems easier to find.
Watch for signs that a reactive design is being stretched: rules that contradict each other, a growing list of special cases, users rephrasing to get through, or a handover rate that keeps climbing. Those are evidence for adding reasoning to a specific area, not necessarily to the whole system.
Deterministic and probabilistic behavior
A deterministic component gives the same output for the same input and state. A probabilistic one may not. Language models produce a probability for each possible next token, and sampling settings control how the choice is made. Lower randomness settings reduce variation, but a hosted service may still return different text, because of implementation details or model updates. Do not build correctness on identical output.
Agents add other sources of variation: tool results change, searches return different documents, parallel steps finish in a different order and time passes. How LLMs Power Agents: Transformers, Tokens and Sampling explains sampling.
| Put in deterministic code | Leave to the model |
|---|---|
| Identity and permissions | Interpreting a free-text request |
| Amounts, limits and arithmetic | Choosing which source to read next |
| Preventing duplicate actions | Drafting an explanation |
| Stopping conditions | Suggesting a likely cause |
| Audit records | Summarizing findings |
Assert properties instead of exact wording: the right tool was chosen, the amount matches the record, no forbidden action occurred. Repeat each model-backed case several times and report the pass rate.
Stateless and stateful agents
A stateless agent handles each request using only what arrives with it. A stateful one keeps information between steps or requests: conversation history, task progress, preferences or notes. Model APIs are often used in a stateless way, with the application resending the history. Some providers can hold conversation state for you. Either way, your design owns the question of what is kept.
| Aspect | Stateless | Stateful |
|---|---|---|
| Scaling | Any server can take any request | State must be shared or routed |
| Failure | Retry the request | Restore state without repeating actions |
| Privacy | Less to protect | Retention, access and deletion duties |
| Debugging | Input explains behavior | History must be inspected too |
| Suits | Classification, single lookups | Multi-step tasks, continuing relationships |
Prefer to keep the processing stateless and put state in a store that you control. Then a crashed process loses nothing and memory is something you can inspect. See Agent Memory Types and Persistence.
Short-lived and long-running agents
A short-lived agent finishes while the user waits. A long-running agent works for minutes, hours or days, often pausing for an approval or an external event. The change in lifetime brings a change in engineering.
This small program saves progress after each invoice. It is stopped part way and started again.
"""A long-running agent that survives a restart because state is saved."""
import json
import tempfile
from pathlib import Path
INVOICES = ["INV-1", "INV-2", "INV-3", "INV-4", "INV-5"]
def load(path):
if path.exists():
return json.loads(path.read_text())
return {"done": [], "status": "running"}
def save(path, state):
tmp = path.with_suffix(".tmp")
tmp.write_text(json.dumps(state))
tmp.replace(path) # atomic swap: never half a file
def work(path, crash_after=None):
state = load(path)
handled = 0
for invoice in INVOICES:
if invoice in state["done"]:
continue # already finished in an earlier run
if handled == crash_after:
raise RuntimeError("process killed")
print(f" processing {invoice}")
state["done"].append(invoice)
save(path, state)
handled += 1
state["status"] = "complete"
save(path, state)
return state
if __name__ == "__main__":
with tempfile.TemporaryDirectory() as folder:
checkpoint = Path(folder) / "job-42.json"
print("first run")
try:
work(checkpoint, crash_after=3)
except RuntimeError as error:
print(" !", error)
print("second run")
final = work(checkpoint)
print(f"status={final['status']} handled={len(final['done'])}")
Output:
first run
processing INV-1
processing INV-2
processing INV-3
! process killed
second run
processing INV-4
processing INV-5
status=complete handled=5
One gap remains. If the process died after processing an invoice but before saving, that invoice would be processed twice. For actions with effects, the receiving system should recognize a repeated request, usually by an idempotency key. Durable Execution, Checkpoints and Approvals covers the full approach.
Hybrid architectures
Mature systems combine styles in layers. A fast reactive layer handles urgent or routine cases. A deliberative layer handles the rest. A rule layer above both can veto actions.
A password reset request is recognized and routed to a fixed procedure. An unusual login problem goes to an agent that investigates logs and proposes steps. Any change to account permissions requires a person, whatever either layer suggests.
How requests move between layers
The router is a component to be tested like any other. Decide what happens when it is unsure: sending uncertain cases to the more careful path is usually safer than guessing. Log the chosen route so that misrouting can be found, and let the reactive path hand over when its assumptions fail, for instance when a required field is missing.
What each style costs to run
A reactive handler may need one small model call, or none. A deliberative loop may call a model many times and resend a growing history on each call, so both time and token use climb with the number of steps. Stateful designs add storage and the work of protecting it. Long-running designs add queues, schedulers and people who watch for stuck tasks. None of these costs is a reason to avoid a design that the task requires, but each should be visible before the choice is made. Measure the share of requests that truly need the expensive path, and review it as usage changes. Agent Cost Model and Token Economics gives a way to estimate it.
A product described as "autonomous" or "reasoning" may be reactive in the places that matter to you. Ask to see what it does when the first attempt fails, what it stores and which actions it takes without asking.
Choosing a combination
| Task | Decision | State | Lifetime |
|---|---|---|---|
| Tag incoming mail | Reactive | Stateless | Seconds |
| Chat support with order lookups | Mostly reactive, some planning | Conversation state | Minutes |
| Fix a failing test | Deliberative loop | Task state and files | Minutes to hours |
| Month-end reconciliation | Workflow with planning inside steps | Durable checkpoints | Days |
| Monitor systems and respond | Reactive triggers, deliberative diagnosis | Incident history | Continuous service, short tasks |
Start with the simplest column that meets the need. Each step toward deliberation, state and duration adds cost and failure modes. Add it when a test case fails without it.
Testing each dimension
A classification is useful because it tells you which tests are missing.
| Property | A test worth writing |
|---|---|
| Reactive routing | Messages near the boundary between two routes, and ones that fit none |
| Deliberative planning | A fact changes after the plan is made; the agent should notice |
| Probabilistic output | The same case run many times; report how often each rule holds |
| Statefulness | Two users in turn; nothing from the first appears for the second |
| Memory deletion | Delete a fact, then ask for it in several ways |
| Long-running work | Stop the process after each step in turn, restart and compare effects |
The final test is worth automating. Crash points are numerous and bugs hide at particular ones, often between performing an action and recording it. Agent Testing: Unit to End-to-End shows how to test an agent offline with a scripted model.
What each choice changes
| If you choose | Budget time for |
|---|---|
| Deliberative | Plan review, step limits, stale-fact handling |
| Probabilistic | Repeated evaluation, output validation |
| Stateful | Storage, isolation between users, deletion, migration of old state |
| Long-running | Checkpoints, timeouts, cancellation, version changes during a task |
The last item is easily forgotten. A task started under one version of a prompt or tool may resume under another. Store versions with the task, and decide whether old tasks finish on the old version or are migrated.
Classification checklist
- I can say which decisions are rules and which are model choices.
- Tests assert properties and report rates for variable behavior.
- Every stored item has an owner, a retention period and a way to delete it.
- Long tasks resume without repeating effects, and can be canceled.
- Autonomy was chosen separately. See Autonomy Levels and Human Oversight.
Frequently asked questions
Is a language-model agent reactive or deliberative?
It can be either. A single call that picks a route behaves reactively. A loop that plans, checks results and revises is deliberative.
Does temperature zero make an agent deterministic?
It reduces variation but does not guarantee identical output on hosted services, and tool results can still differ.
Is multi-agent a separate type?
It is a way of composing agents. Each member can be classified by the same four questions. See Single-Agent vs Multi-Agent Systems.
Which type is most advanced?
The question is misleading. The right design is the simplest one that does the task reliably.
References and further reading
- Russell and Norvig: Artificial Intelligence, A Modern Approach
- Anthropic: Building effective agents
- Yao and others: ReAct
Next steps
Autonomy Levels and Human Oversight
Decide how much each type may do alone.
Stateful and Long-Running Agent Architecture
Engineer tasks that last.
Planning and Search Algorithms
Go further with deliberation.