Skip to content

Orientation

What is an AI agent?

Agent vs workflow, the autonomy spectrum

By the end of this lesson you can look at any LLM-powered feature and say precisely whether it is a single call, a workflow, or a true agent - and, more importantly, know which one the job actually needs.

The definition that finally stuck

For years "agent" meant nothing and everything. Simon Willison collected 211 crowdsourced definitions and could barely cluster them into thirteen buckets - everyone held a different mental model.[1] In 2025 the industry finally converged on one crisp, implementable definition.

The working definition

An AI agent is an LLM using tools in a loop to achieve a goal. Three load-bearing parts: tools the model can call, a loop that feeds each result back in for the next decision, and a goal with a stopping condition.[2]

The phrase doing all the work is "in a loop." A single model call that emits one tool call and stops is tool use, not an agent. An agent keeps going: it observes the tool result, decides the next action from that feedback, and repeats until the goal is met or a fires. That loop is what lets the system self-correct against ground truth from the environment at every step.[3]

Tap a node to see what it does.

The agent loop. The last arrow, carrying the observation back into the model, is the whole idea. Remove it and you have a single call.

Chip Huyen arrives at the same place from classical AI: an agent is anything that can perceive its environment and act upon that environment, defined by two things - its environment and its set of tools - with the model as the "brain" that plans actions and judges when the task is done.[4]

Uses an LLM is not the same as is an agent

OpenAI draws the line at control of execution: an app that calls an LLM but does not let the model decide what happens next is not an agent.[5] A sentiment classifier, a one-shot summarizer, a single-turn chatbot - these use the model as a component. An agent uses the model as the controller.

The atom: an augmented LLM

Before agents or workflows, there is one building block everything is composed from: the , a base model extended with retrieval (it writes its own search queries), tools (it selects and invokes actions), and memory (it decides what to keep across turns).[3] Get this layer right first; workflows and agents are just orchestration patterns over augmented LLMs.

Tap a node to see what it does.

The augmented LLM: a base model wired to retrieval, tools, and memory that it drives itself.

Agent is a point on a spectrum, not a yes/no

The useful mental model is not agent-versus-not-agent. It is a slider - Karpathy calls it the autonomy slider - that you dial from tight human control toward long AI leashes, moving it rightward over time, a decade-long transition rather than one launch.[6] The key variable at each stop is . Anthropic frames the same idea as a vocabulary distinction inside one umbrella term, agentic systems:[3]

PatternWho owns the control flow?Character
Single callNeither - one shot, then stopCheapest; often enough
WorkflowYou - LLMs orchestrated through predefined code pathsPredictable, testable, cheap
AgentThe model - it dynamically directs its own process and tool useFlexible, costly, harder to test
Anthropic's agentic-systems vocabulary. Control of the flow passes from you to the model as you move down.

Most "workflows" in the wild are one of five reusable shapes: prompt chaining, routing, parallelization, orchestrator-workers, and evaluator-optimizer.[3] The canonical academic anatomy - an LLM "brain" wrapped in planning, memory, and tool use - is the subject of the next lesson.[7]

Same task, two altitudes: plan a weekend trip

Nothing makes the distinction click like running one task at two altitudes. Give "plan a weekend trip" to a workflow and to an agent and watch what differs: not the tools, but who decides the order of steps.

Workflow: rigid pipeline

You wrote every branch. Predictable, cheap, unit-testable - but if it rains, or the city has no airport, it still runs the same script.

Agent: model-directed loop

The model picks the next call from what it just learned. Rain? It pivots to indoor plans, with no branch written for that. Flexible, but costlier, slower, harder to test.
plan_trip(city, dates):
  1  get_weather(city, dates)
  2  search_flights(home, city)
  3  search_hotels(city, dates)
  4  render_itinerary(template)
     # same 4 steps, every trip
Workflow: the same four steps run on every trip, because you wrote every branch.
goal: "fun weekend, budget $600"
tools: flights, hotels, events, weather, web_search

-> weather(city)       rain all weekend
-> events(city,indoor) jazz + museum
-> hotels(near_venue)  $180, under budget
-> book + summarize    goal met, stop
Agent: each next call is chosen from the last observation. No branch was written for rain.

When not to build an agent

"Is an agent" is not the same as "should be an agent." The single most-repeated principle across every primary source is use the simplest thing that works: find the simplest solution possible, and only increase complexity when needed.[3] For many tasks a single well-prompted call with retrieval and good examples is enough; start there and climb only when forced to.[5]

Autonomy is expensive for three reasons. The first is arithmetic, and it is brutal:

Autonomy compounds errors

A 95%-reliable step sounds great until you chain 100 of them and land near zero.[4] Long autonomous chains need a stronger model, fewer steps, or verification checkpoints that catch mistakes before they propagate.
per-step accuracy = 95%
   1 step   -> 95%
  10 steps  -> 0.95^10  ~ 60%
 100 steps  -> 0.95^100 ~ 0.6%
Per-step accuracy compounds across a long autonomous chain.

Cost and latency creep

Every autonomous turn is another model call - more tokens, more seconds, and one more chance for an early mistake to snowball.[3]

Unpredictability

When the model owns the control flow you cannot enumerate every path, so you cannot unit-test it the way you test a workflow. You trade predictability for reach.

So climb the ladder in order, and stop at the first rung that clears the bar:

  1. Can one good prompt (plus retrieval) do it? Ship the single call. Cheapest, fastest, most reliable.
  2. Are the steps fixed and predictable? Build a workflow, a chain or a router. You keep control and testability.[3]
  3. Are the steps impossible to predict and un-hardcodable? Only now reach for an agent, and only in a trusted environment where you accept some autonomous decision-making.

Where agents genuinely earn their cost

Domains with verifiable outcomes: coding (tests pass or fail) and customer support (issue resolved or not). The loop can self-correct against ground truth, so autonomy pays off.[3] Coding agents are the flagship example, covered later in the course.

Check yourself

Match each system to where it sits on the autonomy spectrum.

drop here

no tools, no control flow, zero autonomy

drop here

workflow: path drawn by a human in advance

drop here

agent: model chooses each next action at runtime

drop here

multi-agent: autonomy over the plan itself

What single property separates an agent from an ordinary LLM tool call?

You must automate a task whose exact steps are the same every single time. Best first choice?

What are the three load-bearing parts of the definition, an LLM using tools in a loop toward a goal?

Which part upgrades tool use into agency? Try to state it, then check.

Lock it in

  • An agent is an LLM using tools in a loop to achieve a goal. The loop is what makes it an agent, not a single tool call.
  • The discriminator is who owns the control flow: workflows run your predefined path; agents let the model direct its own steps.
  • Everything is built on the augmented LLM, a model plus retrieval, tools, and memory. Get that atom right first.
  • Uses an LLM is not is an agent is not should be an agent. Autonomy compounds errors (0.95^100 is about 0.6%) and adds cost and latency.
  • Climb the ladder: single call, then workflow, then agent. Stop at the first rung that works.

Primary source

Anthropic, Building Effective Agents

The single best read for this lesson: it defines the workflow-versus-agent distinction, the augmented LLM, and the use-the-simplest-thing-that-works principle in about 15 minutes.

Sources

  1. 1.Simon Willison, I think agent may finally have a meaning (2025)
  2. 2.Simon Willison, Tools in a loop (2025)
  3. 3.Anthropic, Building Effective Agents
  4. 4.Chip Huyen, Agents (2025)
  5. 5.OpenAI, A Practical Guide to Building AI Agents
  6. 6.Andrej Karpathy, 2025 LLM year in review
  7. 7.Lilian Weng, LLM Powered Autonomous Agents (2023)