Per-turn budget
A per-turn budget is the maximum number of tokens, tool calls, or seconds the agent will spend on a single user turn before forcing a response. Prevents runaway loops, controls cost, and keeps user-perceived latency bounded.
Why it matters
A multi-step agent loop can run forever in pathological cases: the agent calls a tool, gets a result, decides to call another tool, gets a result, keeps deciding more steps need to happen. Without bounds, the user waits indefinitely, the model burns tokens, and the cost climbs.
Per-turn budgets cap each of these dimensions:
- Token budget. Total input + output tokens for the turn. When approached, archive older context and force a response.
- Tool-call budget. Maximum number of tools the agent can call in one turn. Five is typical for most use cases.
- Wall-clock budget. Maximum seconds the user has to wait. After that, the agent surfaces what it has and asks the user how to continue.
Different channels have different budgets. A 90-second voice call needs aggressive budgets to keep latency low. An asynchronous WhatsApp thread can tolerate longer think-time. Production agents tune per channel.
The budget is a guardrail, not a hard limit on what the agent can do. If a turn legitimately needs more, the agent splits it: do what fits in the budget, surface the partial result, ask if the user wants to continue. Better than failing silently.
How Ajeris handles this
Ajeris's agent loop enforces per-turn budgets sized to the channel. Voice calls get tight budgets (seconds, not minutes). Async chat (SMS, WhatsApp) gets longer budgets. When a budget approaches, the agent emits a partial result and asks the user how to proceed.
Power users who consistently hit budget limits can configure higher budgets in their Soul; the cost flows through to their usage-based bill.