Enterprise-grade multi-agent collaboration system for pi coding agents
WebSocket-based agent-to-agent communication with distributed context synchronization, cryptographic authentication, and task delegation.
- Ed25519 digital signatures for agent authentication
- Self-signed identity verification
- Automatic key generation and secure storage
- Server Mode: Listen on port 9999 (configurable)
- Client Mode: Connect to remote agents
- Federation: Server-to-server agent network
- Heartbeat mechanism for connection health
- MessagePack binary serialization (efficient & compact)
- Signed message envelopes (tamper-proof)
- 15+ message types (HELLO, PING, TASK_REQUEST, etc.)
- Priority-based message handling
- Vector clocks for causal consistency
- CRDT-style merge strategies
- Automatic conflict resolution
- Session management with metadata
# Via npm npm install pi-multi-agent-collaboration # Or install directly in pi pi install npm:pi-multi-agent-collaboration
pi --agent-server --agent-name "Coordinator"pi --agent-client ws://192.168.1.50:9999 --agent-name "Worker1"/agents- List connected agents/agent-broadcast <message>- Send to all agents/agent-session-create- Create shared workspace/agent-status- Show system status
send_to_agent- Send messages between agentsdelegate_task- Delegate coding tasks to capable agentslist_agents- Find agents by capability
- Node.js >= 18.0.0
- pi coding agent >= 0.60.0
- Agent Identity: Each agent gets a unique Ed25519 keypair for signing messages
- Discovery: Agents register on WebSocket server or connect to existing servers
- Communication: Signed messages flow between agents via WebSocket
- Context Sync: Vector clocks ensure causal consistency of shared state
- Task Delegation: LLM can delegate tasks to agents with matching capabilities
--agent-server- Start WebSocket server--agent-port 9999- Server port (default: 9999)--agent-host 0.0.0.0- Server host--agent-client ws://host:port- Connect to server--agent-name "MyAgent"- Agent identity name--agent-capabilities "coding,review"- Comma-separated capabilities--agent-federation- Enable server-to-server federation
βββββββββββββββββββββββββββββββββββββββββββββββ
β pi Multi-Agent System β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β ββββββββββββ ββββββββββββ ββββββββββββ
β β Identity β β Protocol β β Context ββ
β β Manager β β Handler β β Sync ββ
β ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ
β β β β β
β ββββββ΄ββββββ ββββββ΄ββββββ ββββββ΄ββββββ
β β Server β β Client β β State ββ
β β(Port 9999)β β(WS Conn) β β Manager ββ
β ββββββββββββ ββββββββββββ ββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββ
- npm: https://www.npmjs.com/package/pi-multi-agent-collaboration
- Repository: https://github.com/DrOlu/pi-multi-agent-collaboration
- Issues: https://github.com/DrOlu/pi-multi-agent-collaboration/issues
MIT License - See LICENSE file for details.
Author: Dr. Olu (Seyi Akin)
Version: 1.0.0