Agent Loop & ReAct Pattern
5 exercises — master the execution model of every autonomous AI agent: the think → act → observe loop, the ReAct pattern, trajectories, and stopping conditions.
0 / 5 completed
Agent loop vocabulary quick reference
- Agent loop — the repeating cycle: Think → Act → Observe
- Agent step — one iteration of the loop (one think+act+observe)
- ReAct pattern — Reason + Act: agent writes a Thought before each Action
- Scratchpad — the visible Thought step in a ReAct agent (chain-of-thought)
- Trajectory — the complete record of all steps in a single agent run
- Run — one complete execution from start to final output
- Stopping condition — the rule that terminates the loop (max_steps, token_budget, task_complete)
- Stuck loop — when an agent iterates without making progress toward its goal
1 / 5
In AI systems engineering, what is the "agent loop" (also called the agentic loop or run loop)?
The agent loop is the fundamental execution model of every autonomous agent.
Each iteration of the loop consists of three phases:
① Think (Reason) — the LLM processes available context and produces a plan or decision. In the ReAct pattern, this appears as a visible "Thought" step.
② Act — the agent executes an action: calling a tool, generating output, or invoking a sub-agent.
③ Observe — the agent receives the result of the action and incorporates it into its context for the next iteration.
The loop continues until:
• The agent determines the goal is complete (produces a final answer)
• A stopping condition is met (maximum steps, token budget, time limit)
• A safety guardrail triggers a halt
Key vocabulary:
• Agent step — one iteration of the loop (one think+act+observe cycle)
• Run — the complete execution from start to final output (all steps combined)
• Trajectory — the recorded history of all steps in a run
• Stopping condition — the rule that terminates the loop (e.g. max_steps=25)
Each iteration of the loop consists of three phases:
① Think (Reason) — the LLM processes available context and produces a plan or decision. In the ReAct pattern, this appears as a visible "Thought" step.
② Act — the agent executes an action: calling a tool, generating output, or invoking a sub-agent.
③ Observe — the agent receives the result of the action and incorporates it into its context for the next iteration.
The loop continues until:
• The agent determines the goal is complete (produces a final answer)
• A stopping condition is met (maximum steps, token budget, time limit)
• A safety guardrail triggers a halt
Key vocabulary:
• Agent step — one iteration of the loop (one think+act+observe cycle)
• Run — the complete execution from start to final output (all steps combined)
• Trajectory — the recorded history of all steps in a run
• Stopping condition — the rule that terminates the loop (e.g. max_steps=25)