Sistava

What is Recursion Limit?

Also called depth limit, delegation depth.

A recursion limit is the maximum nesting depth allowed when agents create other agents, or when a graph based agent revisits the same node. It prevents unbounded delegation chains where each agent spawns another, and it is enforced by the runtime rather than by any single agent's judgment.

Nesting multiplies rather than adds. If an agent may spawn three subagents and each may do the same, depth four already implies dozens of concurrent runs. Cost, latency, and external system load all scale with that product, so a limit on depth is the only practical way to keep the total bounded when each level looks individually reasonable.

The limit is usually implemented by propagating a depth counter through the call chain, incremented at each spawn and checked before any new agent is created. At the limit, the spawn is refused and the calling agent must complete the work itself or report that it cannot. Refusal must be visible, since a silently ignored spawn looks to the caller like an empty result.

Graph based frameworks apply a related limit to node visits, capping how many times execution may traverse the graph before halting. This catches cycles where two nodes hand control back and forth without progressing, which is a different failure from deep delegation but has the same unbounded shape.

Shallow limits are the norm in practice. Most real work decomposes within two or three levels, and deeper chains usually indicate that a task was never properly scoped rather than that it is genuinely deep. Each level also loses information through summarization, so results returned from depth four are often too degraded to be useful anyway.

Key points

In practice

A research agent is allowed a delegation depth of two. It spawns three subagents to cover separate sources, and each of those may spawn one more to fetch a specific document. When a document fetcher tries to delegate further, the runtime refuses and returns a message saying the depth limit was reached, so the fetcher retrieves the page itself and returns its own summary.

Related terms

Back to the AI Glossary