LEVEL 04 · LESSON 31
Agent loops
A useful agent loop has feedback, a budget, and a clear way to stop.
What it is
An agent loop repeats a cycle of choosing a step, taking an allowed action, observing the result, and deciding what to do next.
Why it matters
Feedback lets a system adapt, but an uncontrolled loop can repeat mistakes, consume resources, or perform an action more than once.
A business example
An assistant searches for a contract, finds an old version, narrows the search, and retrieves the current version before drafting a summary. If it cannot establish which version is authoritative, it stops and asks for help.
How it actually works
Each iteration adds tool results and updated task state to the information available for the next decision. Define completion criteria and stopping conditions outside the model where possible. Set step, time, and cost limits; detect repeated failed actions; and make retries safe. Persist important state so an interruption does not erase what has already happened.
A common misconception
More iterations do not necessarily mean better reasoning. An agent can become more committed to a bad path or keep searching after enough evidence exists.
ONE SENTENCE TO REMEMBER
A useful agent loop has feedback, a budget, and a clear way to stop.
CHECK YOUR UNDERSTANDING
A research agent keeps searching and re-checking sources long after it has enough evidence. What would most improve this?
Show the answer
Answer: D.
A useful agent loop has feedback, a budget, and a clear way to stop. More iterations do not necessarily mean better reasoning; an agent can commit to a bad path or keep searching after enough evidence exists.
Take it into your next meeting
What objective signal tells your agent that its job is complete?
One more concept, understood.
Mark this lesson complete to keep your place.