# Agent loop

**Source:** https://promtable.com/glossary/agent-loop

> An agent loop is the repeating cycle of an AI agent — observe state, decide on an action (usually a tool call), execute, observe the result, and repeat — until a goal is reached or a stop condition fires.

---
An agent loop is the repeating cycle of an AI agent — observe state, decide on an action (usually a tool call), execute, observe the result, and repeat — until a goal is reached or a stop condition fires.

Every AI agent in 2026 runs some variant of an agent loop. The simplest is pure ReAct (thought → action → observation, repeat). Production loops add planner-executor splits, budget caps, no-progress detectors, retry handlers, and circuit breakers. The hardest engineering problem is reliability across long loops: by step 15 most loops drift off-goal without active context distillation, summarisation, and goal re-injection. Best practice in 2026 is to keep loops as short as possible — fewer steps with stronger per-step quality beats long loops with weak steps.

## When to use

- Any tool-using agent.
- Multi-step workflows where each step depends on the previous result.

## Common mistakes

- Letting the loop run unbounded — set step + token + wall-clock caps.
- Skipping a planner — pure ReAct drifts on horizons past ~7 steps.

## Related terms

- [agent](https://promtable.com/glossary/agent)
- [react-pattern](https://promtable.com/glossary/react-pattern)
- [context-distillation](https://promtable.com/glossary/context-distillation)
- [guardrails](https://promtable.com/glossary/guardrails)

*Last updated: 2026-06-01*
---

Original page: https://promtable.com/glossary/agent-loop
Maintained by Promtable (https://promtable.com). Content: CC BY 4.0. Cite as "Promtable — https://promtable.com/glossary/agent-loop".
Contact: info@vibecodingturkey.com.