# What Is an Agent Loop?

> An agent loop is the recurring cycle of perceive → reason → act → observe that lets an AI agent pursue multi-step goals instead of single-turn responses.

**Term:** Agent Loop  
**Category:** Architecture  
**Also known as:** control loop, agentic loop, ReAct loop  
**Updated:** 2026-07-22  
**Canonical:** https://www.frameworkr.com/glossary/agent-loop

---

An **agent loop** (also called a control loop or agentic loop) is the recurring cycle that lets an AI agent pursue goals across multiple steps:

1. **Perceive** — Receive input (user message, tool result, environment state)
2. **Reason** — Decide what to do next given the goal and current context
3. **Act** — Execute a tool call, send a message, or update state
4. **Observe** — Read the outcome of the action
5. **Repeat** — Reassess whether the goal is met or another step is needed

This loop is what separates an agent from a chatbot. A chatbot completes one turn. An agent runs the loop until the task is done, an error requires escalation, or a safety limit is hit.

## Common loop patterns

- **ReAct** (Reason + Act) — The model alternates between reasoning traces and tool calls. Widely used and easy to debug.
- **Plan-and-execute** — The model first generates a full plan, then executes steps sequentially. Better for long, structured tasks.
- **Reflection** — After acting, the model critiques its own output and may retry. Useful for quality-sensitive work.

## Loop safety

Production agents need guardrails on the loop itself: maximum iteration counts, timeout limits, cost caps, and human-in-the-loop checkpoints for high-stakes actions. Without these, a confused agent can loop indefinitely.

## Related reading

[Loop Engineering](/blog/loop-engineering) covers how to design loops that are reliable in production, not just in demos.

## Related terms

- [ai agent](https://www.frameworkr.com/glossary/ai-agent.md)
- [agent architecture](https://www.frameworkr.com/glossary/agent-architecture.md)
- [tool use](https://www.frameworkr.com/glossary/tool-use.md)
- [agent orchestration](https://www.frameworkr.com/glossary/agent-orchestration.md)


---

_Published by Frameworkr — https://www.frameworkr.com_
