Agent loop
The agent loop is the iterative cycle of an AI agent's reasoning: the model decides what to do, calls a tool, reads the tool's result, decides again, and continues until the goal is reached or a budget cap is hit.
Why it matters
The agent loop is the engine that turns a language model into something that does work. A single model call is a question-and-answer. The loop is the pattern that lets the model reach a goal that requires several actions, with each action informed by what came before.
The classic shape is the plan-act-observe cycle. The model plans (decides what to do), acts (calls a tool), and observes (reads the tool's output). The output goes back into context; the model plans again with new information; the loop continues. Most modern agent frameworks implement some version of this pattern, with variations on whether planning is explicit or implicit, and how aggressively the loop bounds itself.
Bounding matters. An unbounded agent loop can run forever, accumulate context past the model's window, or repeat itself in subtle pathological ways. Good agent runtimes implement per-turn token budgets, max-iteration limits, archive-on-overflow rules, and graceful fall-throughs when a step fails. These details are invisible when they work and very visible when they do not.
How Ajeris handles this
Ajeris's agent loop bounds each turn with token and step budgets sized to the channel (a 90-second voice call needs a tighter budget than an asynchronous WhatsApp thread). Tool calls feed back into context for the next planning step. When context approaches the model's limit, the agent archives older turns into memory. The loop is conservative on consequential actions; the approval parser holds money movement and public posting in a queue until the user authorizes.