The Agent Loop
What an agent is when you strip the word away: a model, a set of tools, a loop, and a stop condition. How state survives across steps, why loops run away, and how to read a trace that did.
- Lessons
- 7
- Exercises
- 40
- Minutes
- 43
- 1
What an Agent Is
After this lesson you can describe an agent as a loop with four parts, and say which part is responsible when it does something you did not want.
DebugCode orderMultiple choice - 2
State Across Steps
After this lesson you can say where an agent's memory lives, why long tasks run out of window, and how compaction and a scratchpad keep the goal and the facts alive.
DebugFill blankMultiple choice - 3
Stopping
After this lesson you can give an agent a stop condition it cannot argue with: a done test, a step budget, a cost budget, and a rule for what happens when the budget wins.
DebugMultiple choiceTrace - 4
Reading an Agent Trace
After this lesson you can read a multi-step trace and find the step where it went wrong, which is almost never the step where it failed.
Multiple choiceTrace - 5
When One Agent Becomes Several
After this lesson you can say when splitting work across agents helps, name the two ways it fails, and design the split so that workers cannot act on each other's stale state or multiply the bill.
DebugMultiple choiceTrace - 6
Checkpoint: The LoopCheckpoint
Parts, memory, stops and traces in fresh situations.
DebugFill blankMultiple choiceTrace - 7
Boss: The Runaway LoopBoss
An overnight agent was asked to fix a flaky integration test. You have its 52-step trace and a $61 bill. Read it properly: the vague goal, the lost fact, the repeated call, the claim of done, the missing budget, and the report that should have ended it.
DebugFill blankMultiple choiceTrace