Skip to content

Glossary

Agent loop

The agent loop is the repeating cycle of deciding, acting and looking at what happened, which continues until the goal is reached or something stops it.

In plain terms

Decide, do, look, decide again. That is the whole of it, and it repeats until the job is done or something calls a halt. A chat window answers once and stops; this cycle repeats as many times as it takes, which is what lets it handle work whose shape nobody knew in advance.

01

Why it matters

Because it explains the two things buyers find hardest to plan for. You cannot know in advance how long a task will take or what it will cost, since neither is a property of the request but of how many times round the loop it turns out to need. Nothing about a well-written brief makes that predictable.

02

How it works

Each turn feeds the next, which is where the capability comes from. The result of an action becomes part of what the next decision is made on, so an agent that runs a command and gets an error has genuinely new information to work with. That is why acting matters more than reasoning here: the loop is a way of learning about the world rather than thinking harder about it.

It has to be stopped by something, and what stops it varies more than people expect. Reaching the goal is the intended end. The rest are limits: a cap on turns, a spend ceiling, a timeout, or a person declining an action. A loop with no limit and a goal it cannot reach is the failure this category is most prone to, and it consumes steadily while doing it.

Cost accumulates per turn, invisibly, because each turn resends the accumulated context alongside whatever is new. Ten turns is not ten times the first request, it is more, and the growth is why a task that wanders is expensive out of proportion to how long it appears to run. The interface shows progress; it rarely shows the arithmetic.

Frameworks make the loop inspectable, which is the main thing they add over writing one. Expressing an agent as a graph with checkpointing, durability and a defined place for a person to intervene turns an opaque cycle into something with states you can look at. That matters less for making it work and a great deal for finding out why it did not.

What the interface shows, and what is happening

What the interface shows, and what is happeningThis is the practical reason limits are treated as infrastructure in this category rather than as a safety feature. Watching a run in progress is genuinely reassuring: each step is legible, each follows from the last, and the whole thing has the texture of somebody working carefully through a problem. That texture is produced by the loop regardless of whether it is getting anywhere, because every turn is generated the same way whether the approach is sound or not. An agent that has misread the task will produce an equally coherent sequence of steps in the wrong direction, and will keep producing them, accumulating context and cost with each pass, for exactly as long as it is allowed to. Nothing in the display distinguishes the two cases, which means the ending has to be imposed rather than recognised.On screenA sequence of sensible steps.Steady visible progress.Each step reads as deliberate.No indication of how manyremain.UnderneathA cycle with no fixed length.History resent and rechargedeach turn.A wrong turn looks like a rightone.Only a limit guarantees anending.The left column is equallyconsistent with converging andwith circling, which is whywatching an agent work tells youmuch less than it feels like itdoes.
This is the practical reason limits are treated as infrastructure in this category rather than as a safety feature. Watching a run in progress is genuinely reassuring: each step is legible, each follows from the last, and the whole thing has the texture of somebody working carefully through a problem. That texture is produced by the loop regardless of whether it is getting anywhere, because every turn is generated the same way whether the approach is sound or not. An agent that has misread the task will produce an equally coherent sequence of steps in the wrong direction, and will keep producing them, accumulating context and cost with each pass, for exactly as long as it is allowed to. Nothing in the display distinguishes the two cases, which means the ending has to be imposed rather than recognised.
03

Seen in the wild

  • A framework expressing agents as controllable graphs with checkpointing, human intervention and durability, which is the loop made inspectable.

    LangChain / LangGraph
  • A general agent that plans and executes end to end in a sandbox, going round until it has a finished deliverable rather than answering once.

    Manus
  • A persistent agent running on your own machine that takes actions rather than only producing text, which is the same cycle without a vendor around it.

    OpenClaw
04

Common misconceptions

People assume

More turns means better work.

In fact

More turns means more attempts, and a loop can circle without converging. An agent stuck between two approaches will keep going, each pass confident and billable, until a limit intervenes. Duration is evidence of difficulty rather than of thoroughness, and the two look identical from outside.

People assume

The cost is roughly the request times the number of steps.

In fact

It grows faster than that, because each turn carries the accumulated history forward alongside the new material. The tenth turn is more expensive than the first for the same reason a long conversation is. That compounding is why wandering runs cost out of proportion to how long they seem to take.

05

Telling them apart

Agent loop vs Workflow

Agent loop

The next step is decided each time round.

Workflow

The steps are laid out before anything runs.

One can handle a case nobody anticipated; the other can be costed in advance. That is the same trade seen from two directions.

06

Questions

What actually ends a run?
Either the goal or a limit, and it is worth knowing which limits exist before relying on one. Turn caps, spend ceilings, timeouts and a person refusing an action are the usual set. A loop whose only stopping condition is success will not stop on a task it cannot do.
Why can nobody estimate the cost beforehand?
Because the cost is a function of how many times round it goes, and that is discovered rather than specified. Two briefs of similar length can differ enormously, since one happens to be solvable in three passes and the other keeps meeting things that change the plan.
Is a longer run a sign it is working hard?
It is a sign it has not finished, which is different. Circling without converging looks exactly like careful work from the outside, and both produce a steady sequence of plausible steps. That is why turn and spend limits are the mechanism rather than judgement about how it seems to be going.
07

Key takeaways

  • Decide, act, observe, repeat: the result of each turn feeds the next decision.
  • Something has to stop it, and success is only one of the several things that can.
  • Cost compounds per turn because each carries the accumulated history forward.
  • A long run is evidence of difficulty, not of thoroughness.
09

Tools that use this

  • LangChain / LangGraph

    Graphs with checkpointing and intervention, the loop made inspectable.

  • Manus

    Plans and executes end to end rather than answering once.

  • OpenClaw

    A persistent local agent that takes actions rather than producing text.

Last checked July 2026

All glossary terms