An agent loop connects a model's decisions to feedback from its environment. After choosing and carrying out an action, the system supplies the observed result for the next decision. The loop may use tools, revise a plan or ask a person for clarification.
A useful loop needs explicit limits and a trustworthy completion check. Repetition can otherwise amplify mistakes or waste resources. Reaching a stop condition does not prove that the intended real-world outcome occurred unless the system verifies the relevant evidence.
ELI5
An agent loop is the repeated cycle an AI agent uses to make progress. It looks at the current situation, chooses a next action, uses a model or tool, checks the result, and decides whether another step is needed.
For example, an agent fixing a program might read an error, edit one file, run the test, inspect the new result, and repeat. The loop needs a clear finish condition and limits so it does not keep making the same failed change or spend resources forever.
Does an agent loop need to run forever?
No. It should have task-specific completion rules, resource limits and ways to stop or request human help.
How does a loop differ from one model response?
A loop feeds action results back into later decisions. A single response may produce an answer without interacting with changing task state.










