Kreisdiagramm eines Agent-Loops mit vier Stationen: Planen, Werkzeug wählen, Werkzeug ausführen, Ergebnis zurück ins Modell. Ein Pfeil führt vom Ergebnis zurück zum Planen, ein zweiter Pfeil zeigt aus der Schleife heraus zum Feld Abbruch, wenn Ziel erreicht oder Rundenlimit erschöpft.

Agent Loop

An agent loop is the cycle in which an AI program works through a task step by step: it thinks, carries out an action, looks at the result, and then decides anew. This loop repeats until the goal is reached or a limit kicks in.

Typical AI chat programs work like a question-and-answer game: you type something, the program answers once, and that’s it. An agent loop breaks with this pattern. Here, the program is given a goal instead of a single question, for example: “Find the three cheapest train connections to Hamburg and write them into a table.” After that, it works in a loop: it considers what the next sensible step is, carries out that step, looks at the result, and thinks again. This round repeats many times in succession. Only once the goal is reached or a previously set limit kicks in does the program stop. The term “loop” describes exactly this repetition.

From answer-giver to task-doer

The leap from a single answer to a loop changes what AI can actually accomplish. A single answer is always only as good as the first attempt. In a loop, the program is allowed to fail and improve. It can search for a file, notice that it doesn’t exist, and then look somewhere else. This very ability for self-correction is the reason for the hype around so-called AI agents, i.e. programs that carry out tasks independently.

Economically, this is the interesting part. A program that only formulates text saves a human minutes. A program that works through an entire chain of tasks can replace hours of work. That’s why companies like OpenAI, Anthropic, or Google no longer announce “chatbots” these days, but agents. The agent loop is the technical foundation of these announcements.

But there is a downside. Every round of the loop costs computing time and thus money. An agent that runs fifty rounds on a difficult task is fifty times as expensive as a simple answer. And an error in round three can propagate through all the following rounds.

The four stations of a round

A typical round consists of four stations. First, the model plans: it formulates in words what needs to be done next. Second, it chooses a tool, i.e. a function it is allowed to call. Typical tools are a web search, a program for reading and writing files, or a calculator. Third, the surrounding program actually executes this call. Fourth, the result, for instance a search hit or an error message, travels back into the model.

Importantly: the language model itself does nothing. It only proposes. The execution is handled by an ordinary piece of software that manages the loop. This program also keeps the history together so that the model still knows in round ten what happened in round two. You can think of the model as the head and the loop as the hands and memory.

So that an agent doesn’t keep running endlessly, there are termination conditions. Common ones are a maximum number of rounds, a cost limit, or a check-in with the human before risky steps. Without such limits, agents can run in circles and keep trying the same failed action over and over.

Agent loops in products and headlines

Agent loops are most clearly visible in programming. Tools like Claude Code, GitHub Copilot Agent, or Cursor are given a task like “fix this bug.” They then read files, change code, run tests, and react to the test results. Anyone watching can recognize the loop by the many small intermediate steps in the log.

The “deep research” features of several providers also work this way. They search the web, read pages, notice gaps, and search specifically for them. A report emerges there over many minutes and dozens of rounds. In contrast, a normal chat answers immediately and without tools.

In stock market announcements, the term usually appears indirectly. When a provider advertises “agentic capabilities,” they mean the agent loop. A common misconception here: the loop doesn’t make the model smarter. It merely gives an equally smart model more attempts and tools. If the underlying capability is weak, the loop mainly produces many errors one after another.

Subscribe free. Unsubscribe the second it sucks.

High-signal news across AI, business, UX, and tech. Every morning.