The core execution cycle of an autonomous agent: observe, reason, act, evaluate—repeated until the goal is achieved or a stopping condition is met.
The agentic loop describes the fundamental execution cycle that drives autonomous agent behavior. Unlike a single-pass LLM completion, an agent continuously cycles through a structured process until either the goal is achieved or a stopping condition is triggered.
The canonical agentic loop has four phases:
1. Observe: The agent perceives the current state—from the conversation history, the results of previous tool calls, environmental data, or user input.
2. Reason: The agent applies LLM-powered chain-of-thought reasoning to determine the next best action. This includes evaluating whether the goal has been achieved, deciding which tool to call next, or identifying when to escalate to a human.
3. Act: The agent executes the chosen action—invoking a tool, generating a response, updating state, or pausing for HITL confirmation.
4. Evaluate: The agent assesses the result of its action, checking for errors, unexpected states, or progress toward the goal, then returns to Observe.
Loop termination conditions include:
- Success: The goal state has been reached
- Failure: Maximum iterations exceeded, unrecoverable error, or tool unavailability
- HITL Pause: An action requiring human authorization has been reached
- Explicit Cancellation: The user or system has terminated the workflow
Designing reliable agentic loops requires careful attention to loop invariants—conditions that should remain true across every iteration—and break conditions that prevent infinite loops in error states.