An agentic loop is the core execution pattern of AI agent systems: the repeated cycle of perceiving the environment, reasoning about the situation, selecting and taking an action, observing results, and repeating. Each iteration the agent updates its internal state based on what happened, then reasons about what to do next. This loop continues until a goal is achieved, a termination condition is met, or the agent determines it cannot proceed. The architecture mirrors how humans execute complex tasks: assess the situation, decide on an action, do it, see what changed, reassess. In code execution agents, the loop might be: generate code, run it, read the error, fix the error, run again, verify output. In research agents: formulate query, search, read results, identify gaps, search again, synthesize. The challenge is managing context across loop iterations, keeping track of what's been tried, what failed, and what information has been gathered. Long agentic loops can exceed model context windows, requiring memory systems. They can also get stuck in unproductive cycles, requiring termination heuristics. Building reliable agentic loops is the core engineering challenge in AI agent development.
Back to Glossary