# Agent Loop

> The cycle an agent runs: think, act, check. It goes round until the job is done.

**Field:** Artificial Intelligence  
**Category:** AI Agents  
**Also known as:** Agentic Loop, ReAct Loop, Think-Act-Observe Loop

## Think of it like

Think of it like baking. You taste, add a bit more, and taste again until it is right.

## Definition

The agent loop is the cycle an agent repeats until its task is done. The model reads the goal and everything so far, then picks an action, often a tool call. The program runs that action and adds the result to the conversation. The model reads the new result and picks the next action. The loop ends when the model gives a final answer or hits a limit, such as a set number of steps.

## Example

Lucy's agent goes round five times. It searches the web, reads a page, searches again and reads one more page. Then it writes the summary.

## Why it matters

Every agent, however complex, is this loop at its core. Knowing it helps you see why an agent stalls or spins.

## Common mistake

Running the loop with no step limit. A confused agent can go round for hours and spend a lot of money.

## Three principles

- **Think, act, check.** Then repeat.
- **Results feed back.** Each step sees the last.
- **Needs a stop.** A goal or a limit.

## Related terms

- [AI Agent](https://learn.benibix.com/term/ai/ai-agent)
- [Tool Use (Function Calling)](https://learn.benibix.com/term/ai/tool-use)
- [Agent Harness](https://learn.benibix.com/term/ai/agent-harness)
- [Agentic RAG](https://learn.benibix.com/term/ai/agentic-rag)
- [Agent Stop Condition](https://learn.benibix.com/term/ai/agent-stop-condition)
- [Agent Trajectory](https://learn.benibix.com/term/ai/agent-trajectory)
- [Agentic AI](https://learn.benibix.com/term/ai/agentic-ai)

![A circle of three steps: the model thinks, it calls a tool, and it reads the result. An exit arrow leads to the final answer when the task is done.](https://learn.benibix.com/diagrams/ag-agent-loop.svg)

---

Source: https://learn.benibix.com/term/ai/agent-loop
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
