An agent loop plans a task, acts with tools, and records what happened. Planning, external memory, and stopping rules keep long runs correct and bounded.
Concern | Rule |
|---|---|
Plan | Split the task into verifiable steps with a done condition. |
Memory | Keep state in notes outside the model; hold only the working slice in context. |
Stopping | Bound steps, tokens, and repeats; stop with a named reason. |
Lesson | What it covers |
|---|---|
Split tasks into verifiable steps and define done first. | |
External state, context growth, and safe summarisation. | |
Step and token budgets with a runnable enforcer. | |
Repeat detection with a runnable detector and stop rules. |
Loop detection and stopping. The ABAB pattern triggers a stop, while the step and token budgets bound the cost of the run.