What is an agent loop?

Definition

An artificial intelligence agent loop is the recurring control cycle that lets an agent work through a task. Each iteration can add context, call a model, invoke a tool, inspect the result and decide whether another step is needed.

Loops enable multi-step work but can run longer than intended when completion conditions are weak or failures repeat. Runtimes should track iterations, cost, progress and side effects, then support steering or termination when behavior becomes unproductive.

Acronyms and aliases

agentic loop synonymAI agent loop variantartificial intelligence agent loop variant

Frequently asked questions

Why can AI agent loops become expensive?

Every iteration may add context and trigger more model or tool calls, causing cost to compound across the run.

How should an agent loop stop?

It should stop on verified completion, a defined failure, a safety or budget limit, or an authorized human intervention.

Videos explaining agent loop