
Execution Loop
An execution loop is the repeated cycle by which an AI program works through a task step by step: think, act, check the result, start over. It is the core of modern AI assistants that don't just answer but actually do things themselves.
A simple AI program receives a question and returns exactly one answer. After that, it’s done. An execution loop turns this into a repeated cycle. The program thinks, carries out a step, looks at the result, and starts over. This round repeats until the task is complete or a stopping condition kicks in. The English term literally means “execution running in a loop”: execution that runs in circles.
From answer-giver to task-solver
Many tasks cannot be solved in a single step. “Find the cheapest train to Hamburg and put it in my calendar” consists of several actions. One has to search, compare, and then enter something. The second step only makes sense once the first has produced a result. Without a loop, a human would have to check in after every intermediate step.
This is exactly where the difference lies between a chatbot and a so-called agent. An agent is an AI program that independently plans and carries out multiple steps. The execution loop is the technical foundation for this. When news reports talk about “agentic AI,” they are almost always referring to systems with such a loop.
But the loop also carries a risk. A wrong intermediate step becomes the basis for the next one. Errors can thus compound instead of canceling out. That’s why the question of when a loop stops is at least as important as the question of what it does.
The four stations of a round
A round usually consists of four stations. First, the model considers what to do next. Then it selects an action, such as a web search or running a small program. This action is actually carried out, outside the model. The result comes back as new text and is appended to the previous history.
These tools are called tools. A tool can be a calculator, a database, or access to the file system. The model itself does not do the calculating. It only decides which tool to use and with what inputs. You can think of it like a cook who orders ingredients instead of growing them himself.
Every round makes the history longer, since all intermediate results remain in place. This costs computing time and money, because the model has to read the entire text anew each time. That’s why limits are set: a maximum of twenty rounds, for example, or a fixed time limit. A common misconception is that more rounds automatically lead to better results. In practice, poorly guided loops often just go in circles without getting closer to the goal.
Execution loops in real products
Coding assistants like GitHub Copilot Agent or Claude Code work this way. You describe a bug, the program reads files, changes code, runs tests, and reads the error message. Then the next round begins. This is visible in the long list of intermediate steps that such tools display.
The research features of large chat services also use loops. With “Deep Research,” the system searches, reads results, formulates new search queries, and works for minutes at a time. The fact that an answer takes longer than usual is usually a sign of a loop running in the background.
In business news, the topic comes up mainly because of cost and safety concerns. An agent that runs through twenty rounds incurs many times the cost of a single answer. At the same time, it can actually change real things, such as deleting files or triggering orders. Many providers therefore build in a confirmation step before a critical action is carried out.