All lessons in AI Engineering: From Foundation Models to Evaluated Applications
Agent Loops, Planning, and Stopping
Choose a workflow or agent loop and bound its actions, steps, and cost.
75 minutes · Members lesson · preview
What you will learn
- Choose a fixed workflow or bounded agent loop for a concrete task.
- Specify state transitions, allowed actions, and stopping conditions before execution.
- Calculate loop budgets and diagnose repeated or ineffective actions from a trace.
Your assistant can retrieve policies and call tools. The remaining question is who decides what to do next. For a damaged order, the application could always look up the order, retrieve the damage policy, ask for approval, and create a review ticket. For a broader research request, the next useful search may depend on what the previous search found. These tasks need different control structures.
This core knowledge lesson follows T25's MCP interface. You will choose between known workflows and bounded model-directed loops, then specify how either one stops. T16 introduces durable state, and T17 adds orchestration and human-review recovery. Required practice P07 implements the bounded tool workflow; the design work here makes its behavior testable.
The examples use fictional support tasks and hypothetical costs. An agent's ability to choose a tool does not expand the tools' permissions or turn an uncertain result into a successful action.