Applied AI·topic 7 of 12
Agents
An agent is the tool loop from section 5 given autonomy, memory and boundaries. The vocabulary here is young and marketing-polluted; the definitions below are the load-bearing ones.
Read in order · tick what you already know
- 01
you stop scripting the steps and let the model choose which tool to call next, in a loop, until it decides it is finished.
Agent
- 02
the strongest agent architectures are mostly workflow, with agency confined to the steps that need it.
Workflow vs agent
- 03
thought, tool call, result, repeat, which is what your loop is already doing whether or not you call it by the paper's name.
ReAct pattern
- 04
the agent wrote out the steps first, then the third result contradicted the plan and it had to re-plan instead of carrying on.
Planning and decomposition
- 05
the sequencing, tool execution, retries, budgets and human checkpoints around the model calls are a few hundred lines of ordinary code you own.
Orchestration
- 06
the model remembers nothing, so everything the run has established lives in your application and gets re-presented every turn.
State management
- 07
the memory feature you shipped is a database plus a retrieval step, re-pasted into the window every turn.
Memory (short-term vs long-term)
- 08
you spend the afternoon deciding what to keep, summarise and throw out of the window each step, not rewording the prompt.
Context engineering
- 09
the agent was sharp for the first twenty steps and was making bad calls by step sixty, with the window full of dead ends.
Context rot
- 10
you replay the whole recorded run, thought by tool call by result, to find the step where it went wrong.
Trajectory
- 11
you cap the run at twenty iterations and a dollar, because a confused agent will otherwise loop until the invoice notices.
Stop conditions
- 12
the long run died forty minutes in and picked up from the last saved step instead of starting the whole thing again.
Checkpointing and resumability
- 13
you hand the sub-task to a child with a fresh context and get back only its conclusion, keeping the parent's window small.
Subagent
- 14
you split the work across five agents, spent five times the tokens, and one well-briefed agent did it better.
Multi-agent system
- 15
the second agent picked up the task without half of what the first one had learned, and redid the work or got it wrong.
Handoff
- 16
there is no API, so the agent takes a screenshot, clicks the button and types into the field, and breaks the day the layout changes.
Computer use / browser agents
- 17
the agent runs its shell commands inside a container against a scratch copy, so a bad step cannot touch production.
Sandboxing
- 18
you give the agent read-only tools by default and a scoped credential, because whatever its tools can reach is the blast radius.
Least privilege for tools
- 19
you put deterministic checks around the model, allowlists and schema validation and refusal filters, because you cannot rely on it policing itself.
Guardrails
- 20
you make the run stop and wait for someone to approve before it sends the email, writes to the database, or spends the money.
Human in the loop