The Call Stack for Distributed AI

Loop Stacks reimagine the foundational pattern of software call stacks, evolved to orchestrate dynamic, distributed, recursive AI workflows across the internet.

Understanding Loop Stacks

From Call Stack to Loop Stack

Traditional Call Stack

Functions call other functions in a linear, hierarchical manner. Execution is sequential and deterministic.

Loop Stack

Loops spawn other loops in distributed, parallel execution. AI agents participate democratically in recursive workflows.

Recursive Loop Stack Visualization

Watch how loop stacks spawn and contain other loop stacks in a recursive pattern

L0

Loop Frame

Circular boundary representing the loop execution context

Stack Layers

Horizontal layers representing stacked operations

L0→L1→L2

Recursion Levels

Each level spawns smaller nested loop stacks

Key Terminology

Loop

A circular execution context where AI agents collaborate. Has a purpose, name, and goal/return type.

Loop Stack

A hierarchical collection of loops, similar to a call stack but designed for distributed AI coordination.

Agent

Democratic citizens of realms who can participate in loops, vote, bid confidence, and spawn new loop stacks.

Realm

Logical domains where agents belong and can participate in AI orchestration using the LoopStacks SDK.

Interactive Loop Stack Visualizations

Loop Stack Architecture

A loop stack is a vertical collection of loops, each serving a specific purpose in the AI workflow. Loops can be spawned recursively and operate independently while contributing to the overall goal.

Loop Stack Structure

Each loop in the stack has a purpose and can spawn recursive sub-loops

Loop Stack Runtime

Active Loops: 0 / 0

Active Loop

Currently executing

+

Spawn Point

Can create recursive loops

Stack Layers

Execution context depth

Agents in Loop Circles

Each loop is visualized as a circle of agents. Agents can vote, bid confidence, and any agent can spawn a new loop stack for recursive problem-solving.

Agent Circle Loop

Agents collaborate in circular formations, voting and spawning new loops as needed

Phase: idle
Loop is idle, waiting for input or executing decided actions
LOOPIDLE

Voting Agent

Participating in consensus

Confidence Ring

Shows agent confidence level

Spawned Loop

New recursive loop stack

Connections

Agent collaboration links

Example: Conversation Processing Workflow

A typical loop stack template for conversation processing:INBIDDOOUT

Conversation Processing Workflow

A loop stack template for processing user conversations through coordinated agent loops

Current Stage: Idle
Executions: 0
IN Loop3 agentsBID Loop3 agentsDO Loop3 agentsOUT Loop3 agents

IN Loop

Intent parsing & validation

BID Loop

Agent confidence bidding

DO Loop

Task execution

OUT Loop

Response formatting

Building with Loop Stacks

LoopStacks SDK

Use the LoopStacks SDK to create, orchestrate, and participate in AI workflows. Build agents that can spawn recursive loop stacks and coordinate across realms.

Cross-Realm Federation

Deploy loop stacks across distributed networks. Agents from different realms can collaborate while maintaining logical boundaries and governance.