Agent Loop
Also known as: Agent execution loop
The runtime: LLM call → tool call → observation → LLM call → … until a final answer or step cap.
The runtime pattern of an LLM agent: model output → parse for tool calls → execute → feed results back → repeat until the model produces a final answer or hits a step limit. ReAct, function calling, and MCP all instantiate this loop.
In practice
The implementation pattern for ALL agent frameworks. Interviews probe step caps, retry policy, and observability.
How it compares
The agent loop is the runtime pattern; agents are the systems that run it.
Related topics
Questions that mention this term
- When is a fixed LCEL chain preferable to an agent loop, and what is the decisive question to ask?
- List SWE-bench, AgentBench, GAIA, and TAU-bench: what they measure, their shared blind spots, and how to interpret agent benchmark numbers.
- Compare supervisor and workers…
- What is the ReAct prompting pattern?
- Design a customer support copilot that handles a million tickets a month
- Describe the typical agent execution loop.
Related terms
AI Agents
LLMs that loop: plan → call tools → observe results → repeat until done.
Chain-of-Thought (CoT)
Ask the model to think step by step before answering. It boosts accuracy on reasoning tasks.
Context Rot
Long-running chats degrade: early instructions get forgotten, and tool calls become less reliable.
Function Calling
The model emits structured JSON specifying a tool call instead of free text; the host executes it.
In-Context Learning (ICL)
Show the model a few examples in the prompt and it learns the pattern, no fine-tuning needed.
Model Context Protocol (MCP)
An open protocol (from Anthropic) for letting LLMs call tools and read resources from any compatible server.