Agentic Loop: How AI Agents Actually Work
An agentic loop is the cycle that turns a language model into an agent. Here is how it works, where it stops, and what it means for a small business.

My first production loop put the same bid into the team chat twice. It also linked a directory page where an apply-able posting belonged. A person caught both in review, and that check has sat in front of every record since.
An agentic loop is the repeating cycle that turns a language model into an agent. The model runs a tool and reads the result. It picks its next step from that result, over and over, until a verifiable goal is met or a stop condition fires.
For the wider category, my post on agentic AI defines the umbrella term and the goal-versus-prompt split. This page stays on the loop itself.
Most explainers on the agentic loop come from developer newsletters and vendor docs. They define the cycle well and never name a job you can hand over this week. This is the operator’s version.
TL;DR
- An agentic loop turns a model that answers into a system that acts.
- One pass runs 5 steps:
- Gather context.
- Pick one action.
- Run the tool.
- Read the result.
- Repeat.
- Plain automation fires a fixed rule. A loop picks its next step from what it just saw.
- A loop stops on a limit you set, like
max_turns, a token budget, a timeout, or a person in the gate. - You can run one without writing code. The review step is still yours to own.
What is an agentic loop?
An agentic loop is the cycle where a model runs a tool and reads the result. It picks its next step from that result, over and over, until the job is done. The model acts, checks, and acts again inside limits you control.
The word “agent” is loose. Wikipedia notes there is no universally agreed definition of an AI agent. The shared traits are goal direction, tool use, and some autonomy. Anthropic’s engineering team starts from the same place and calls the augmented LLM the basic building block of an agentic system. That is a model wired to retrieval, tools, and memory. The loop is the part that runs it.
The loop is what turns a model that answers into a system that acts, one step at a time.
The checks I run before a loop touches real work
I put the bid workflow on a loop before quoting, and the reason is the cost of a mistake. A wrong record lands in a team chat, where a person reads it. A wrong price lands in a client’s inbox. Every workflow I hand to a loop has to pass 3 checks first.
- Does it repeat at least weekly? A task that happens twice a year will not earn back the setup.
- Can I write the correct output in one line? If the answer needs a paragraph, the loop will drift.
- If it gets it wrong, does a person catch it before a customer or a price is touched? That one sets the order.
The checks picked the first job, and they also took one back. I tried an invoice-reconciliation loop early on. The right answer needed a paragraph of context each time, so the loop guessed. I pulled it and finished the job by hand.
If you cannot name the person who catches a bad output, the loop is not ready for real work.

AutomateReal skills
How is an agentic loop different from a chatbot or plain automation?
A chatbot answers turn by turn and waits for you. Plain automation fires a fixed action from a fixed trigger. An agentic loop picks its next step from what it just observed, so the same job keeps working when the input changes shape.
Anthropic draws the line the same way and names both sides. It describes workflows and agents as two different builds. A workflow runs the model through code paths you wrote in advance. An agent lets the model direct its own process and tool use. The loop is what the agent runs.
The three look like this side by side.
| System | What you hand it | Who picks the next step | When it stops |
|---|---|---|---|
| Chatbot | a question | you, every turn | you close the tab |
| Plain automation | a fixed rule | the rule, every time | the trigger ends |
| Agentic loop | a goal | the model, inside your limits | a goal or a stop condition |
The difference that matters to an owner sits in the third column. Most owners already bought automation. What they own is a rule that fires on a trigger, and it breaks the moment a form field moves. The loop adds a decision at each pass, which is the part a fixed rule cannot do.
You already own automation. The loop is the part that decides what to do next.
What are the steps inside an agentic loop?
One pass through an agentic loop runs 5 steps. It gathers context, chooses one action, and runs the tool. The result comes back as fact, and then the loop repeats or stops.
The 5 steps are the same in every implementation, and the order is the point.
- Gather context. The model reads the goal, the files, and the result of every earlier pass.
- Reason and decide. It picks one action, like a search or a file read.
- Act. The runtime around the model runs the tool call and hands back the output.
- Observe. The output returns as ground truth, not as a guess.
- Repeat or stop. It runs another pass, or a stop condition ends the run.
That order is why a loop can correct itself. The 2022 ReAct paper named the move. It runs reasoning traces and task-specific actions in an interleaved way, so the model updates its plan from what it observes. Before ReAct, most systems did the thinking first and the acting after.
Every pass adds its output to the stack the model reads on the next turn. That stack is the context window, and choosing what stays in it is context engineering.
My bid reader runs this loop every morning. It reads long bid documents and pulls the fields I care about. Then it drops duplicate rows and routes one record per job into a team chat. The 5 steps take a few turns, and my part is the 2-minute read that follows the drop.
Plan-first systems think once. A loop re-plans on every result, which is the whole point.
Where a loop breaks in month one
The first month breaks in 3 places. Only one throws an error you will notice, and the other two ship as work that looks finished.
- The loop repeats an action it already took.
- It fills a value it could not read.
- It goes quiet when a tool changes shape under it.
My week-one break hit the first two at once. The duplicate read as two jobs, and the directory link looked like a normal link. Neither looked broken. I fixed both with checks, not with a better prompt.
- Dedupe on the job id before anything routes.
- A link only counts if it resolves to a posting page, not a directory page.
- A blank required field stops the run and waits for a person.
That last fix is the Reflexion idea in plain form, and the pattern has a paper behind it. Reflexion reinforces a language agent with a written self-critique instead of a weight update. The agent reads the critique on the next try and changes course.
The failure that costs you is the quiet one. A loop that repeats an action still looks busy.
Which agentic loop patterns exist, from ReAct to plan-and-execute?
The common patterns are ReAct, Reflexion, and Plan-and-Execute. The orchestrator, the evaluator, and Tree of Thoughts round out the set. Each answers one question. When should the model think, and when should it act?
The same 6 patterns, sorted by what they handle.
| Pattern | How it runs | Fits |
|---|---|---|
| ReAct | think, act, and observe in one pass | jobs that lean on tools, like search |
| Reflexion | act, critique the result, then retry | jobs with a clear pass or fail |
| Plan-and-Execute | write the full plan, then run it | long jobs with many steps |
| Orchestrator-Workers | one model splits the job across helpers | work that divides into parts |
| Evaluator-Optimizer | one model writes, another grades, in a loop | output you can score against a rule |
| Tree of Thoughts | branch several paths and keep the best | jobs with many dead ends |
The names come from a few places. ReAct and Reflexion trace to their papers above. The plan-and-execute and loop-engineering framing has become common shorthand through 2026, sitting next to the older prompt engineering. Anthropic’s team added the orchestrator and evaluator patterns, next to prompt chaining, routing, and parallelization.
Match the pattern to the failure you expect. A plan-first loop wastes turns on a job you can finish in one pass.
What a loop cycle costs, in hours saved
One cycle on my bid reader costs a handful of turns. Each turn re-sends the whole conversation to the model, per the agent-loop docs, so the bill scales with the transcript length.
I do not track a model invoice per job. The loop rides API plans I already pay for, and I watch the hours instead. My follow-up system takes in about 200 form submissions a day, and each one gets a reply path without me touching it. That is the number a loop is worth.
The setup month is the real entry price. It is the tuning that makes the loop correct on your own inputs. Budget the hours before you pick a tool.
The model bill is the small line. The setup hours are the cost that decides whether a loop survives.
What stops an agentic loop from running forever?
A loop stops on a limit you set. The model rarely decides on its own to quit. Common stops include a max-iteration cap, a token budget, and a timeout. A repeated-action detector and a human gate end the run too.
The vendor docs make the mechanics plain. In the agent loop of the Claude Agent SDK, one turn is one cycle. You cap the run with max_turns or a spend limit called max_budget_usd. Without a limit, Anthropic’s docs warn, the loop runs until the model decides it is done. That is fine on a tight task and slow on an open-ended one.
The GitHub Copilot SDK counts the same cycle from the other side. In its tool-use loop, every iteration is exactly one LLM API call. It logs as an assistant.turn_start and assistant.turn_end pair, and the run goes quiet at session.idle.
The checks wrapped around a run are the guardrails, and the human gate is the last one. The loop finishes its work and stops. An approval gate means nothing ships until a person signs off.
| Stop condition | What it does | Set it when |
|---|---|---|
| Max-iteration cap | counts turns and stops at a fixed number | always, as the backstop |
| Token or spend budget | stops when the run crosses a cost line | the loop reads long documents |
| Timeout | kills the run after a fixed time | the loop runs on a schedule |
| Repeated-action detector | stops when the model repeats the same call | the loop can circle |
| Human gate | holds the output until a person approves | anything customer-facing |
On my bid reader the repeated-action detector fired first, before the turn cap ever did. One posting came back with a blank field the model could not read. It re-opened the same document on the next pass, then the pass after that.
The model was doing its job. My rule was the problem. I added a stop: a blank required field ends the run and sends the record to a person.
A limit you set is the difference between a loop that finishes and a loop that runs all night.
Can a small business use an agentic loop without writing code?
Yes. A managed build or a no-code platform runs the loop for you. The model calls, the tool wiring, and the stop conditions are already in place. What stays with you is the setup and the review gate, not the code.
You have 3 routes, and only one asks for a developer.
- A platform seat. You wire the workflow on a no-code builder and own the fix when an app changes.
- A developer build. You pay for the build, then hosting and model calls, then every change after.
- A managed build. The build and the upkeep land in one place, and you get the outcome.
Anthropic’s own advice is to reach for the simplest thing that works and add complexity only when it pays. Its docs note that agentic systems trade latency and cost for better task performance. A rule that already handles a job does not need a loop.
If you want the build path instead, how to build an AI agent walks the 4 steps a loop sits inside. If you would rather hand it over, the AI services page covers what a managed build includes.

AutomateReal services
Running a loop without a developer is normal. Someone still has to read the output before it ships.
Related: fiddler AI
Related: AI Agents Examples: Real Use Cases for Small Business
Related: What Is Automation? Definition, Types, and Examples
Related: best AI agents for personal use
FAQ
Is an agentic loop the same thing as workflow automation?
No. Workflow automation fires a fixed action from a fixed trigger, so it breaks when the input changes shape. An agentic loop decides its next step from what it just observed. The loop keeps working on the messy cases a fixed rule was never written for.
Can an agentic loop run with no human in it at all?
It can run a whole pass without you. A sensible build still puts a gate before the output leaves the box. The loop makes the decisions inside the run, and a person holds the finished result. Keep the gate in front of anything a customer or a price depends on.
How much does running an agentic loop cost per month?
The software is the small line. Model calls scale with how often the loop runs and how long the transcript grows. The setup month and the upkeep are the real cost, and both come out of your hours. That is the number to weigh before you start.
How long does it take to set up an agentic loop for one task?
Plan a setup month for a real workflow. A demo takes an afternoon. The month goes into tuning the loop on your own messy inputs until a person can check the output in a minute or two. Start with one job that repeats weekly.
What happens if an agentic loop gets stuck?
A loop gets stuck when it repeats an action without new information. A repeated-action detector ends that run, and an unreadable required field should stop it too. The fix is usually in the rule you gave the loop. A bigger model rarely helps. Send the record to a person and move on.
If you want help finding that first workflow for a loop, a 30-minute discovery call maps it against the tools you already run.