Core Drivers of Agent Loop's Quadratic Cost

The 'N' in O(N²) for AI agent loops primarily represents the number of turns, agents, or the accumulating context window size. Each large language model (LLM) call often rebills the entire conversation history, including previous tool outputs and reasoning traces, leading to exponential token consumption.

Sources

Open the full topic