Beginner Lesson 3 of 11

agent loop

The repeating cycle an agent runs: decide, act, look at the result, decide again.

An agent does not plan everything up front. It works in a loop. It picks one action, runs it, and reads what came back. Then it chooses the next action based on what it learned. The loop ends when the goal is met, a limit is hit, or a person steps in.

Think of it as

Like finding a fault in a car by trying one thing at a time. Check the battery, then the fuse, then the starter, each check deciding the next.

Example

An agent asked to fix a failing website test reads the error, edits one file, and reruns the test. It fails again with a new error, so the agent edits another file. On the third run the test passes and the loop stops.