Skip to content

Orientation

Anatomy of an agent

Model, loop, tools, memory, orchestration

Every agent, from a customer-support bot to Claude Code, is built from the same five parts. Learn them once here and you get a mental scaffold you will reuse in every lesson that follows: a place to hang tokens, tool calls, retrieval, and multi-agent handoffs as we meet them.

Start from one unit: the augmented LLM

Before "agent," there is a smaller, more fundamental thing. Anthropic calls it the [1], a base model wired up with three capabilities it can drive itself:

Tap a node to see what it does.

The three capabilities that turn a base model into an augmented LLM.

The atomic building block

Everything larger - fixed workflows, single agents, whole multi-agent systems - is just orchestration over augmented LLMs. So the design imperative is: get this one unit right, with a well-documented tool interface, before you wrap a loop around it.[1]

An agent is what you get when you put an augmented LLM in a loop and hand it a goal. Below are the five parts, color-coded the way this entire course will color them.

The five parts, one diagram

ORCHESTRATION - MULTI-AGENTloopTHE LOOP - REASON, ACT, OBSERVETHE AUGMENTED LLMMEMORYknowledgeTOOLShandsMODELreasoning corerecallactobserve
Figure 1 - Agent anatomy as nested layers. The model, its memory, and its tools compose the augmented LLM. Wrap that in the loop, and you have one agent. Wrap several agents in orchestration and you have a multi-agent system.

1 - Model: the reasoning core

The LLM is the "brain" - it plans a sequence of actions and decides whether the task is done.[2] Its per-step accuracy compounds, so it sets the ceiling on how long a loop can safely run.

2 - Loop: the verb

Reason, act, observe, repeated. The model gains ground truth from the environment at every step and stops on a goal or a bound.[1] This is the part that makes it an agent and not a single call.

3 - Tools: the hands

Three functional kinds: data tools (search, DB reads), action tools (send email, write to a DB), and orchestration tools (other agents).[3] Read-only is safe; writes need guardrails.

4 - Memory: the knowledge

Short-term lives in the finite ; long-term lives in an external store queried by nearest-neighbor search over embeddings.[4]

5 - Orchestration: the team

When one agent is not enough: a manager coordinates specialists via tool calls, or peers hand off execution to each other.[3] Start single-agent; add agents only when you must.

Instructions and a goal glue these together - a system prompt, guardrails, and a stopping condition. We treat those as the agent's configuration rather than a sixth organ; they get their own lesson in Prompting for agents.

The loop, close up

The word "agent" is really a verb. A single model call that emits one tool call and stops is tool use, not an agent. An agent keeps going - it reads the tool result, reasons again from that feedback, and repeats until the goal is met.[5]

Modelreason
Toolact
Environmentground truth
Observationback to model
Figure 2 - One turn of the agent loop. The load-bearing arrow is the last one: the observation flows back into the model. Without a stopping condition, goal met or max iterations, it never ends.[2]

Why the loop is the whole game

That feedback arrow is what lets the system self-correct against reality instead of hallucinating forward blindly. It is also why coding and customer support are the flagship agent domains: their outcomes are verifiable (tests pass, ticket resolved), so the loop has real ground truth to correct against.[1]

Worked example: annotate a coding agent

Take a coding agent solving a GitHub issue, the archetype Karpathy called "a little ghost that lives on your computer."[6] Here is the same five-part anatomy, mapped onto something concrete:

PartIn a coding agent
modelThe LLM that reads the issue, plans the patch, chooses the next command, and judges when the task is done.[2]
loopedit, run tests, read the failures, edit again. The test output is the ground truth that closes each turn.[1]
toolsread_file, grep (data); apply_patch, run shell / tests, git (action) - OpenAI's data-versus-action split, live.[3]
memoryShort-term: the transcript and open files in context. Long-term: the repo itself, retrieval over the codebase, and a persisted notes file (for example CLAUDE.md).
orchestrationOn a big refactor: a lead agent spawns sub-agents per module, or hands off to a dedicated reviewer agent.[3]
The five-part anatomy mapped onto a coding agent solving a GitHub issue.

The interface is a first-class surface

Notice how much of the agent's competence is really about its tools. Anthropic's ACI principle - the - says to invest in tool docs, names, and error messages as heavily as you would a human UI. Poor tool documentation is a leading cause of agent failure.[1]

Your map of the rest of the course

This anatomy is a table of contents in disguise. Every remaining module deepens one organ - bookmark this and you always know where a new idea plugs in.

PartWhat it doesWhere you master it
modelPicks the next action; judges done.03 LLMs, 04 Reasoning, 05 Prompting
loopReason, act, observe until a stop.06 Loop and ReAct, 09 Planning, 10 Reflection
toolsData, action, and orchestration calls.07 Tool use, 08 Structured outputs, 17 MCP
memoryContext window plus external store.11 Context, 12 Embeddings, 13 RAG, 14 Memory
orchestrationMany agents: manager or handoffs.15 Patterns, 16 Handoffs, 19 A2A
Each of the five parts is deepened by a later module. Reliability, evaluation, and shipping wrap the whole organism at the end.

Check yourself

Match each part of the agent to the job it does.

drop here

decides the next action from context

drop here

repeats reason-act-observe until done

drop here

execute actions outside the model

drop here

curates what the context contains

drop here

governs budgets, stops, and routing

You attach tools and a memory store to an LLM. Which part actually makes it an agent rather than a fancy one-shot call?

What is the augmented LLM, and why build it first?

What is everything larger just made of? Try to state it, then check.

Name the five parts of an agent's anatomy and which three form the augmented LLM.

Which three are the inner unit? Try to state it, then check.

Lock it in

  • The augmented LLM is the atom: model plus tools plus retrieval plus memory. Build this unit well before wrapping anything around it.
  • Five parts: model (reasoning), loop (the verb), tools (hands), memory (knowledge), orchestration (team).
  • The loop is the discriminator: feeding each observation back is what turns an LLM using tools into an agent, and demands a stopping condition.
  • Ground truth closes the loop: verifiable environments (tests, tickets) are why coding and support are the flagship agent domains.
  • This anatomy is your map: every later module deepens exactly one of these five parts.

Primary source

Anthropic, Building Effective Agents

The piece that named the augmented LLM and drew the composition map this whole lesson is built on. Read it after this.

Sources

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