Skip to content
BENIBIX Learn

Agent Loop

AI🤖 AI AgentsAgent Basics

Also known as Agentic Loop, ReAct Loop, Think-Act-Observe Loop

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

Think of it like

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

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.

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.
The model thinks, calls a tool and reads the result. It goes round until the task is done.

Common mistake

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

Key takeaways

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