Agent Loop

The recurring sense-think-act cycle that drives an AI agent: the agent perceives its environment (or reads tool output), decides on the next action, executes it, and observes the result before repeating. This cycle continues until a goal is reached or a stopping condition fires. Most agent frameworks implement this loop explicitly, letting developers hook into each phase.