Grid-based agent communication with mesh, ring, star, and tree topologies. Failure detection and workload dispatch.
- Grid nodes — register agents as nodes with status tracking (ACTIVE, IDLE, OVERLOADED, OFFLINE)
- Multiple topologies — mesh, ring, star, tree — pick the right one for your coordination pattern
- Work dispatching — distribute tasks across the grid with load balancing
- Failure detection — heartbeat-based failure detection with configurable timeouts
- Pure Python — no external dependencies
pip install agent-gridfrom agent_grid import Grid, GridNode, MeshTopology, WorkDispatcher
# Create a grid with mesh topology
grid = Grid(topology=MeshTopology())
grid.add_node(GridNode(id="agent-1", capabilities=["python"]))
grid.add_node(GridNode(id="agent-2", capabilities=["rust"]))
grid.add_node(GridNode(id="agent-3", capabilities=["docs"]))
# Dispatch work
dispatcher = WorkDispatcher(grid)
task = Task(title="Build API", requirements=["python"])
assigned = dispatcher.dispatch(task)
print(f"Assigned to: {assigned.node_id}")
# Topology-aware routing
neighbors = grid.get_neighbors("agent-1")
print(f"Neighbors: {[n.id for n in neighbors]}")The network layer for the SuperInstance fleet. Agents register on the grid, work is dispatched by topology-aware routing.
- captain — Fleet commanding (uses grid for coordination)
- cluster-orchestrator — Cluster orchestration
- cocapn-com — Message routing
pytest tests/pip install agent-gridPython 3.10+. MIT license.