Glossary

What is Agent loop?

In Turkish: Ajan döngüsü (agent loop) · Topic: Using AI

The repeating cycle in which an AI agent assesses the situation, chooses an action, carries it out, looks at the result and decides again, until it reaches its goal.

How does it work?

The agent gives the language model the user’s goal and a list of the tools available. The model picks the next step, for example suggesting a web search, reading a file or calling a software interface. The application runs that tool and passes the output back to the model. The model then assesses the result and either calls another tool or decides the goal is met and writes the final answer. The loop ends when the task is done, a step limit is reached or a human steps in.

Why does it matter?

This loop is the key difference between a one-shot question-and-answer exchange and an agent that does multi-step work. It lets the agent make mistakes and correct itself, but every turn adds cost and time, and an unchecked model can keep circling down a wrong path. That is why step limits, monitoring and human approval are part of the design.

Example

A coding assistant runs the tests, reads the error message, fixes the code and runs the tests again, repeating this until every test passes.

FAQ

Can an agent loop run forever?

If no safeguards are in place, yes; an agent can keep retrying the same mistake. That is why applications usually set a maximum number of steps, a time limit or a cost limit.

Is an agent loop the same as ReAct?

Not exactly. The agent loop is the general operating pattern. ReAct is a well-known prompting approach, interleaving reasoning and action steps, that can be used to build such a loop.

All terms