agent-ciklus
in English: agent loop
The agent cycle is the repeating loop in which an AI agent thinks, acts, reviews the result, and decides again until the task is completed.
In plain terms
A plain chatbot answers your question once and is done. An agent, by contrast, works in cycles: it takes a step, sees what resulted, and decides the next move based on that. This cycle is called the agent loop.
It is like when you are making soup. You do not throw everything in at once: you taste it, add salt, taste it again, and repeat until it is good. The agent proceeds similarly, except that instead of tasting, it might run a search, open a file, or try a program.
Due to the cycle, the agent can independently complete multi-step tasks and correct its own mistakes along the way. However, this makes it slower and more expensive than a simple response, as each round requires additional computation.
How it works
- It receives the goal: you write what you want, and the agent stores it in its working memory, the context.
- Decides on the next step: the language model assesses what is still missing and selects a tool, such as search, file reading, or code execution.
- Acts: the program running around it actually executes the requested operation, because the model itself only writes text and does not touch the outside world.
- It observes the result: the operation's output, even an error message, is fed back into the context, so the next decision is made with this knowledge.
- It repeats or stops: the loop continues until the agent deems the task complete or reaches a set limit, such as the allowed number of steps, time, or cost. Before a sensitive step, the cycle may pause to await human approval.
An everyday example
You ask an AI assistant to find weekend accommodation in Eger for two adults, with parking. You watch it work step by step: searching, opening a few pages, comparing prices, searching again because one place is full, and only at the end making a recommendation. This sequence of steps is the agent loop.
Who is affected
A common misconception
Limits and risks
- An early error can ripple through subsequent rounds because the agent builds its next step on its own flawed result.
- An agent can get stuck and repeat the same failed step, so a step, time, or cost limit is always required.
- In long cycles, the working memory can fill up. In such cases, previous steps must be compressed or omitted, and the agent may lose the thread or forget your original request.
- If the agent performs real operations, such as sending an email, deleting a file, or making a payment, a faulty loop has real consequences, so request approval for irreversible steps.
Similar, but not the same
- chain of thought – A chain of thought is the model's step-by-step reasoning performed internally, whereas in an agent cycle, thinking is followed by actual action and its results.
- munkafolyamat (workflow) – In a workflow, a human pre-writes the sequence of steps; in an agent loop, the model decides step by step what comes next.
- training loop – The training cycle runs when the model is being trained and changes the model itself; the agent loop occurs while using the finished model.
Related concepts
AI-agent, agent-based AI, autonomous system
tool calling, stopping condition, planning, self-check
context window, agent-keretrendszer, human approval, multi-agent system, coding agent
A brief history
The perception–decision–action loop is an old concept in artificial intelligence research. The 2022 ReAct paper described the alternation of thinking, acting, and observing for language models. After that, the term 'agent loop' spread in its current meaning.
Where things stand
By the end of 2026, almost every AI agent is built on this cycle, from coding agents to research and browsing assistants. Current development focuses mainly on ensuring the cycle remains reliable, verifiable, and affordable even for long tasks.
Also known as
agent loop · agentic loop · agent-hurok · agentciklus · agent loop · ReAct-ciklus · think-act-observe cycle · think-act-observe loop
Sources
- Yao et al.: ReAct: Synergizing Reasoning and Acting in Language Models (arXiv, 2022)
- Anthropic: Building effective agents
This entry was machine-edited and has undergone machine expert review; the “In the news” section updates automatically from Agent Age stories.