Chapter CWhat are agents?Page 1 of 8

What are agents?

Agents, workflows, and one-shot calls

An agent is a system that repeatedly chooses actions from observed state to pursue a goal within explicit limits.

~13 minHook and distinctions

1Try it yourself

Playground

Agents: think → act → observe

Step the loop. Agents need a max-steps budget so they don’t spin forever.

Budget: 1 / 3 tool-ish steps

  1. ThinkGoal: plan a picnic Saturday. Need weather + calendar.

Before you start

Why this matters

Suppose you ask an AI system to “find three suitable venues for a 40-person workshop, compare their policies, and flag anything that needs confirmation.” One implementation sends the request to a model and returns its answer. Another always runs the same sequence: search a database, filter by capacity, calculate price, then render a table. A third searches, inspects what it found, notices that cancellation terms are missing, chooses a second source, and stops when the required fields are supported or its search budget expires.

All three may produce similar-looking prose. They are not the same architecture. The difference is not whether the output sounds purposeful. The difference is who or what chooses the next operation, what state that choice uses, and how the process stops.

2Learn the idea

Read

One-shot calls transform one input

See it

Agent loop
01Plan
02Act
03Observe
04Check

Think → act with a tool → observe → repeat (with a human check)

A one-shot model call sends a prompt and available context to a model, then receives one response. The response might summarize a document, classify a support ticket, extract fields, or draft an email. The surrounding application may validate the result, but the model does not observe that validation and choose another action inside the same task.

This pattern is often the right starting point. It has one major model decision, so its latency, cost, and failure surface are easier to estimate. If the input contains everything needed and the desired output has a stable format, adding an action loop may create complexity without adding capability.

Consider invoice extraction. If every invoice arrives as text and the requirement is “return supplier, date, total, and currency as JSON,” one structured call plus schema validation can be enough. Calling that extractor an agent does not improve it. It only blurs the design.

Read

Fixed workflows follow authored paths

A workflow coordinates multiple steps whose order and branches are primarily written by a developer or process designer. It may include several model calls. For example:

  1. classify the request;
  2. retrieve matching policy documents;
  3. draft an answer;
  4. run a policy checker;
  5. route failures to a reviewer.

The workflow can contain if statements, retries, queues, and human approval. It can be highly capable without being agentic. Given the same intermediate state, its orchestration code normally chooses the same next step.

Fixed workflows are valuable because known business rules stay visible. A refund process should not improvise whether to check the transaction before issuing money. The order belongs in code. A model can interpret a customer message inside that process while deterministic logic controls the consequential path.

Read

Agents select the next bounded action

An agent adds a loop in which a model or policy chooses among allowed next actions based on current, observable state. The state can include the goal, messages, tool results, errors, remaining budget, and completed subgoals. The action might be “search the catalog,” “open result 3,” “ask the user a clarifying question,” or “finish with a cited comparison.”

That flexibility helps when the useful path depends on what is discovered. A research task may need two searches or six. A debugging task may inspect a log, revise a hypothesis, and choose a different diagnostic. The developer defines the action space and limits; the loop selects a route through it.

This definition does not claim that software has intentions, beliefs, or human-like agency. “Goal” is a specification supplied to a system. “Decision” is an observable selection among actions. You can evaluate the input state, chosen action, tool result, and stop reason without exposing private model reasoning or requesting a hidden chain of thought.

Read

A spectrum, not a badge

Real systems sit on a spectrum. A workflow may have one agentic research step. An agent may execute a deterministic checkout workflow after gathering options. A router may choose between fixed pipelines but never run a long loop.

Use architectural descriptions that reveal control:

  • “One model call extracts fields, then code validates the schema.”
  • “A fixed four-step workflow drafts and reviews the message.”
  • “A bounded agent can choose search or document-open actions for at most eight steps.”

These statements are more useful than “AI-powered agent.” They tell reviewers where variability enters and where controls belong.

Read

Choose the least variable design

Start with the simplest architecture that can meet the requirement. Prefer a one-shot call when the context is complete and one transformation is enough. Prefer a workflow when the correct sequence is known. Consider an agent when the route cannot be enumerated economically because each observation changes what should happen next.

The choice changes operations. An agent can make different numbers of calls, encounter untrusted tool content, repeat ineffective actions, and stop without satisfying the goal. It therefore needs step budgets, traces, success checks, and recovery behavior. Those are not optional decorations; they are part of the architecture.

A common failure is to use an agent for a deterministic task because the label sounds advanced. Imagine a payroll process that asks a model to decide whether to calculate tax, validate bank details, or submit payment next. Flexibility here is harmful. The required order is known, and skipping a check has consequences. A workflow should control it.

Checking tutor…

Continue learning · glossary & guides