Mesh topology for distributed agent communication and workload distribution
Project description
agent-grid — Mesh Topology for Distributed Agents
Grid-based agent communication with mesh, ring, star, and tree topologies. Failure detection and workload dispatch.
What This Gives You
- 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
Quick Start
pip install agent-grid
from 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]}")
API Reference
Grid(topology) — Node management and topology queries
GridNode(id, capabilities, status=ACTIVE) — Agent node representation
Topology / MeshTopology / RingTopology / StarTopology / TreeTopology
WorkDispatcher(grid) — Task → node assignment with load balancing
FailureDetector(timeout) — Heartbeat monitoring and node liveness
How It Fits
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
Testing
pytest tests/
Installation
pip install agent-grid
Python 3.10+. MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
si_agent_grid-0.1.0.tar.gz
(19.5 kB
view details)
File details
Details for the file si_agent_grid-0.1.0.tar.gz.
File metadata
- Download URL: si_agent_grid-0.1.0.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1635be540be7ff3fc636392d031a1c9e777e80eb056a776987b37b9310e38bbd
|
|
| MD5 |
d09aee2d9437dd5a7247a14b01f5f90e
|
|
| BLAKE2b-256 |
37e0797a6fe57572b2624b3136812a337bed114f2372a2f96aff729f1f54d7aa
|