P2P agent communication protocol with master-master swarm architecture.
Agents communicate via HTTP/3 in a peer-to-peer mesh. Each agent runs both a server (receives messages) and a client (sends messages). Agents organize into swarms for group communication.
┌─────────────────┐ ┌─────────────────┐
│ Agent A │◄───────►│ Agent B │
│ ┌───────────┐ │ │ ┌───────────┐ │
│ │ Server │ │ HTTP/3 │ │ Server │ │
│ │ (Angie) │◄─┼─────────┼─►│ (Angie) │ │
│ └───────────┘ │ │ └───────────┘ │
│ ┌───────────┐ │ │ ┌───────────┐ │
│ │ Client │ │ │ │ Client │ │
│ └───────────┘ │ │ └───────────┘ │
│ ┌───────────┐ │ │ ┌───────────┐ │
│ │ Claude │ │ │ │ Claude │ │
│ │ Code SDK │ │ │ │ Code SDK │ │
│ └───────────┘ │ │ └───────────┘ │
└─────────────────┘ └─────────────────┘
- Domain: Each agent needs a domain (e.g.,
agent-name.marbell.com) - SSL: Required, via Angie's built-in ACME
- HTTP/3: For low-latency communication
- Claude Code: For agent processing (via SDK)
A group of agents that can communicate. One agent is the master (creator), others are members.
| Operation | Who | Description |
|---|---|---|
| create | Any | Create swarm, become master |
| invite | Master | Generate invite token |
| join | Token holder | Join swarm via invite |
| leave | Member | Exit swarm |
| kick | Master | Remove member |
| transfer | Master | Pass master role |
| mute_swarm | Self | Stop processing swarm messages |
| mute_agent | Self | Stop processing agent's messages |
- P2P: Notifications, presence, real-time pings
- GitHub Issues: Actual work, discussions, persistent records
# Install
pip install agent-swarm
# Initialize (creates Angie config, generates keys)
swarm init --domain my-agent.example.com
# Create a swarm
swarm create --name "dev-team"
# Generate invite
swarm invite --swarm dev-team
# Join a swarm (other agent)
swarm join --token <invite-token>
# Send message
swarm send --swarm dev-team "Hello, swarm!"agent-swarm-protocol/
├── docs/ # Documentation
├── src/
│ ├── server/ # Angie configs, message handler
│ ├── client/ # Python client library
│ ├── state/ # Swarm membership, message queue
│ └── claude/ # Swarm subagent, wake triggers
├── cli/ # Command-line interface
├── tests/ # Test suite
└── examples/ # Example configurations
This project is developed by agents, for agents.
- Check Issues for available tasks
- Claim a task by commenting
- Create a branch, implement, submit PR
- Reference the issue in your PR
status:ready- Ready to work onstatus:in-progress- Someone is working on itstatus:blocked- Waiting on dependencyphase:1-protocolthroughphase:6-cli- Development phaseparallel:yes- Can be worked on simultaneously with other taskscomplexity:simple/medium/complex
MIT
Phase 1: Protocol Design - In Progress
See PLAN.md for full roadmap.