
Agentic Loop
The agentic loop is the basic pattern by which AI programs work autonomously: think, take an action, look at the result, continue. This cycle repeats itself until the task is done.
A chat program like ChatGPT normally answers a question once, and that’s the end of the process. An agentic loop turns this principle into a cycle. The program first considers what to do next. Then it carries out a step, such as searching the internet or saving a file. Afterward, it reads the result of this step and decides anew how to proceed. This round repeats until the goal is reached or a termination criterion kicks in. Programs that work this way are called AI agents.
From answer-giver to task-taker
Without a loop, a language model can only talk. It describes how you would solve a problem, but it doesn’t solve it. With a loop, it can actually get things done. One example: You say “find out why our website is slow.” The agent opens the page, measures load times, looks at the code, and finally writes a report.
The decisive advantage is the ability for self-correction. On the first attempt, something often goes wrong: a file is missing, a command fails, a search result doesn’t fit. A program without a loop would simply give a wrong answer at this point. An agent sees the error message and tries a different approach. This is exactly why agents solve tasks on which individual model responses fail.
Economically, this is the reason for the current hype around agents. A tool that gives a professional tips saves a few minutes. A tool that works independently for half an hour replaces work time. Companies like OpenAI, Anthropic, and Google now explicitly sell their models with this promise.
Thinking, Acting, Observing
Technically, one round consists of three parts. First, the thought: the model writes down in words what it intends to do. Second, the action: it calls a tool, i.e., a piece of software with a fixed task, such as a search engine or a calculator. Third, the observation: the tool’s result is inserted into the conversation as new text. Then the next round begins with this additional knowledge.
It’s important that the model itself doesn’t store anything. The entire history so far is resent with every round. This growing amount of text is called context, and it is limited. If a loop runs too long, the history no longer fits. That’s why good agents summarize old steps or store notes in files.
Every loop also needs a brake. Without one, an agent can circle endlessly, incurring computing costs, since every round costs money. Common safeguards are an upper limit on the number of rounds, a time limit, and a clear condition for success. Some systems additionally ask a human before risky steps, such as before deleting data.
Agents in products and headlines
Agentic loops are most visible in programming. Tools like Claude Code, Cursor, or GitHub Copilot edit multiple files, run tests, and fix the errors that the tests report. That’s exactly a loop: action, result, correction. Such systems often run for many minutes without user intervention.
The deep research features of the major providers also work this way. They search through dozens of web pages, evaluate the results, and specifically search for gaps. The same applies to agents that operate a browser and fill out forms. When news talks about “agents” or “AI that gets tasks done,” this pattern is almost always behind it.
A common misconception is the assumption that an agentic loop is a particularly smart model. It is initially just flow control, meaning ordinary program code around the model. Still, how good the result turns out depends heavily on the model. Errors add up: anyone who decides correctly ninety percent of the time per round is usually wrong after twenty rounds.