Agent Loop

pattern

The continuous cycle of perceive, reason, act, and reflect that drives autonomous agent behavior.

The agent loop is the fundamental execution pattern for autonomous agents. It follows a four-phase cycle: perceive (gather information about the current state), reason (analyze the situation and plan next steps), act (execute tools, generate content, or take decisions), and reflect (evaluate results and update internal state).

This cycle runs continuously in autonomous systems. The loop is what makes agents autonomous — they do not wait for human prompts between iterations. Each cycle informs the next through updated memory, changed environment state, or new goals.

In SUBCORP, the heartbeat system drives the agent loop. Every five minutes, the heartbeat fires and triggers up to eleven phases: evaluating triggers, running conversations, processing proposals, voting on initiatives, executing missions, and consolidating memory. The probabilistic schedule ensures organic variation in what happens each cycle.