# Agent Loop

> The repeated cycle where an agent reasons, calls a tool, observes the result, and decides the next step.

- Category: Agents & Autonomy
- Stage: Established
- Also called: Run loop, Think-act-observe loop
- Canonical: https://www.joelcsaji.com/ai-dictionary/agent-loop

## Plain English

It is the heartbeat of an agent: decide, act, look at what happened, repeat.

## Example

Search the docs, read a result, update the plan, run a command, inspect the error, and try a fix.

## Why it matters

Loops make AI useful for open-ended work, but they also create compounding cost and error risk.

## Related

- [Tool Use](https://www.joelcsaji.com/ai-dictionary/tool-use)
- [Goal Mode](https://www.joelcsaji.com/ai-dictionary/goal-mode)
- [Trace](https://www.joelcsaji.com/ai-dictionary/trace)

## Sources

- [Anthropic: Building Effective Agents](https://www.anthropic.com/engineering/building-effective-agents)
- [OpenAI: Function Calling](https://developers.openai.com/api/docs/guides/function-calling)
