Loading…
Loading…
Written by Max Zeshut
Founder at Agentmelt · Last updated Jul 8, 2026
The core control flow of an AI agent: observe → think → act → observe again. The model receives input, reasons about the next step, calls a tool, reads the result, and decides whether to keep going or stop. Every modern agent framework (LangGraph, OpenAI Agents SDK, Anthropic Claude Agent SDK, CrewAI) is at its heart a loop with different policies for when to halt, how to handle errors, and how many iterations to allow.
A support agent receives a ticket. Iteration 1: it reads the ticket and decides to search the knowledge base (tool call). Iteration 2: it reads the search results and decides it needs the customer's order history (tool call). Iteration 3: it has enough context and drafts a reply (no tool call). The loop halts because no tool was called and the agent has produced a final answer.