AI engineering glossary · Agents tools MCP
What is agent loop?
Agent loop (also called Agent execution loop): The repeating cycle at the core of an agent: send the conversation to the model, read its reply, run any tool it asked for, append the result, and call the model again. The cycle ends when the model gives a final answer or a limit such as a step cap is reached.
Agent loop: an example
while not done: reply = model(messages); if reply.tool_call: messages.append(run(reply.tool_call)); else: done = True.
Related terms
More Agents tools MCP terms
- Agent memory
- Agent observability
- Agent skills
- Agent trace
- Agent-to-agent protocol
- Agentic workflow
- AI agent
- Approval gate
Where you learn it
Agent loop is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.