⚠️ EXPERIMENTAL - EARLY DEVELOPMENT This project is in active development and not production-ready. APIs and architectures are subject to significant changes.
The universal communication layer for agent frameworks. A standardized protocol that enables seamless collaboration between specialized development agents across different platforms.
A framework-agnostic communication bus that enables agent-to-agent collaboration. Whether you're using OpenCode for systems programming, Codex CLI for full-stack development, or other agent frameworks—this bus makes them all speak the same language and work together.
The Problem: Development agents are isolated islands. You want the Go specialist to review the backend API while the frontend expert builds the UI, with proper coordination between them. Right now, that's a manual coordination nightmare.
The Solution: One unified communication layer that lets agents discover each other, collaborate on sessions, and synthesize their results into coherent outcomes.
import { AgentCommunicationFactory } from '@vibes/agent-communication-bus';
// Fire up the entire ecosystem
const system = await AgentCommunicationFactory.quickStart();
// Boom. You now have:
// - Communication Bus running on port 8080
// - OpenCode adapter ready for Go/Python/Systems work
// - Codex adapter handling frontend development
// - Claude Code adapter managing architecture and coordination
// When you're done conquering the world
await system.shutdown();That's it. No complex setup, no configuration hell, no wrestling with APIs.
Complete documentation is available in the docs/ directory:
- Quick Start Guide - Get running in 5 minutes
- API Reference - HTTP endpoints, WebSocket protocol, message format
- Troubleshooting - Common issues and solutions
- Claude Code Integration - Natural language delegation
- OpenCode Integration - Systems programming tasks
- Codex CLI Integration - Full-stack development
- Architecture Overview - System design and components
- Contributing Guide - How to contribute
- Testing Guide - Writing and running tests
- Deployment Guide - Production deployment
- Multi-Agent Collaboration - Coordinate multiple agents
- Custom Adapter Development - Build your own adapter
- Session Management - Manage workflows
- Roadmap - Current status and future plans
- Implementation Status - Detailed progress tracking
// Send the same task to multiple specialists and get the best result
const message = {
message_id: 'perf_audit_001',
sender: { agent_id: 'claude-code://coordinator', framework: 'claude-code' },
recipient: { agent_id: 'opencode://performance-pro', framework: 'opencode' },
message_type: 'task_request',
priority: 'high',
payload: {
task_type: 'performance_audit',
target: './src/api/',
metrics: ['latency', 'memory', 'throughput']
},
routing: {
timeout: '300s',
retry_policy: { max_retries: 3, backoff: 'exponential' },
fallback_agents: ['codex://performance-expert']
}
};
await bus.sendMessage(message);// Create a session where agents build on each other's work
const sessionId = sessionManager.createSession(
'claude-code://orchestrator',
[
{ agent_id: 'opencode://backend-architect', role: 'designer' },
{ agent_id: 'codex://frontend-developer', role: 'implementer' },
{ agent_id: 'opencode://security-auditor', role: 'reviewer' }
],
[
{ name: 'api_design', required_agents: ['opencode://backend-architect'] },
{ name: 'ui_implementation', required_agents: ['codex://frontend-developer'] },
{ name: 'security_review', required_agents: ['opencode://security-auditor'] }
]
);// Let the system pick the right model for each job
const selection = modelSelector.selectModel({
taskType: 'code_review',
constraints: {
maxCost: 0.01,
maxLatency: 5000,
preferredProviders: ['anthropic']
},
context: {
language: 'go',
complexity: 'high',
securityCritical: true
}
});
// System picks Claude 3.5 Sonnet for Go security reviews
// Automatically falls back to GPT-4 if Claude is unavailable
console.log(`Selected: ${selection.model.model_id} with ${selection.confidence}% confidence`);- CommunicationBus - The central nervous system. Routes messages, handles failures, keeps everything alive.
- SessionManager - Orchestrates multi-agent workflows. Think of it as the project manager for AI agents.
- ModelSelector - Intelligent model routing. Picks the right tool for the job based on cost, speed, and capability.
- ResultAggregator - Synthesizes multiple agent outputs into coherent results. Handles conflicts and builds consensus.
- MessageRouter - Load balancing and intelligent routing. Prevents bottlenecks and optimizes performance.
- OpenCodeAdapter - Bridges OpenCode's specialized agents (golang-pro, python-pro, security-auditor)
- CodexAdapter - Connects Codex CLI's full-stack capabilities
- ClaudeCodeAdapter - Integrates Claude Code's architectural and coordination strengths
Every message follows a strict but flexible format:
{
"message_id": "msg_123456789",
"timestamp": "2025-01-20T10:30:00Z",
"sender": {
"agent_id": "claude-code://task-coordinator",
"framework": "claude-code",
"session_id": "sess_feature_x"
},
"recipient": {
"agent_id": "opencode://golang-pro",
"framework": "opencode"
},
"message_type": "task_request",
"priority": "high",
"payload": {
"task_type": "code_optimization",
"context": {
"files": ["main.go", "utils.go"],
"requirements": ["performance", "memory_efficiency"]
}
},
"routing": {
"timeout": "300s",
"retry_policy": {
"max_retries": 3,
"backoff": "exponential"
},
"delivery_mode": "async"
}
}This isn't just JSON—it's a contract. Every agent knows exactly what to expect and how to respond.
- Node.js 18+
- TypeScript 5.0+
- The agent frameworks you want to integrate (OpenCode, Codex CLI, Claude Code)
# Clone and install
git clone https://github.com/vibes/agent-communication-bus
cd agent-communication-bus
npm install
# Build the system
npm run build
# Run tests
npm test
# Start development
npm run dev# Core communication bus
export AGENT_BUS_URL="http://localhost:8080"
export AGENT_BUS_API_KEY="your-api-key-here"
# OpenCode integration
export OPENCODE_BINARY_PATH="/usr/local/bin/opencode"
export OPENCODE_WORKING_DIR="$PWD"
# Codex CLI setup
export CODEX_CLI_PATH="/usr/local/bin/codex"
export CODEX_API_KEY="your-codex-key"
# Claude Code configuration
export ANTHROPIC_API_KEY="your-anthropic-key"
export CLAUDE_WORKSPACE_PATH="$PWD"- Circuit Breakers: Automatically route around failing agents
- Intelligent Retries: Exponential backoff with jitter prevents thundering herd
- Graceful Degradation: System keeps working even when some agents are down
- Health Monitoring: Real-time health checks with automatic recovery
- Load Balancing: Distribute tasks across available agents based on current load
- Result Caching: Cache and reuse results for similar tasks
- Parallel Processing: Run multiple agents simultaneously and aggregate results
- Smart Routing: Route tasks to the most capable available agent
- JWT Authentication: Secure agent-to-agent communication
- Role-Based Access: Control what each agent can do
- Message Encryption: Protect sensitive data in transit
- Audit Logging: Complete traceability of all agent interactions
// Architect designs the system
const architecture = await claudeCodeAgent.designAPI({
requirements: userStories,
constraints: { techStack: ['Go', 'React', 'PostgreSQL'] }
});
// Backend implements the API
const backend = await openCodeAgent.implementBackend({
architecture: architecture,
language: 'go',
framework: 'gin'
});
// Frontend builds the UI
const frontend = await codexAgent.implementFrontend({
apiSpec: backend.apiSpec,
framework: 'react',
styling: 'tailwind'
});
// Security audit
const security = await openCodeAgent.auditSecurity({
code: { backend: backend.code, frontend: frontend.code },
standards: ['OWASP', 'SOC2']
});
// Aggregate everything into a complete feature
const feature = await resultAggregator.synthesize({
results: [architecture, backend, frontend, security],
synthesisMethod: 'specialist_priority'
});// Parallel analysis by different specialists
const tasks = await Promise.all([
openCodeAgent.analyzePerformance({ target: './api/', focus: 'database' }),
codexAgent.analyzeFrontendPerformance({ target: './web/', focus: 'bundle' }),
claudeCodeAgent.analyzeArchitecture({ target: './', focus: 'scalability' })
]);
// Intelligent synthesis of recommendations
const optimization = await resultAggregator.synthesize({
results: tasks,
synthesisMethod: 'confidence_weighted',
priority: 'impact_vs_effort'
});// Get system health
const metrics = bus.getMetrics();
console.log(`
Active Sessions: ${metrics.active_sessions}
Registered Agents: ${metrics.registered_agents}
Average Response Time: ${metrics.average_response_time}ms
Error Rate: ${(metrics.error_rate * 100).toFixed(2)}%
Throughput: ${metrics.throughput} messages/second
Uptime: ${metrics.uptime}ms
`);// Check individual agent health
const health = await bus.getAgentHealth('opencode://golang-pro');
console.log(`
Status: ${health.status}
Response Time: ${health.response_time}ms
Error Rate: ${(health.error_rate * 100).toFixed(2)}%
CPU Usage: ${(health.resource_usage.cpu * 100).toFixed(1)}%
Memory Usage: ${(health.resource_usage.memory * 100).toFixed(1)}%
`);We're building this in the open. Here's how to help:
- Fork the repo and create a feature branch
- Add tests for any new functionality
- Ensure all tests pass:
npm test - Check linting:
npm run lint - Format your code:
npm run format - Submit a PR with a clear description of what you've built
- New Framework Adapters: Support for more agent frameworks
- Performance Optimization: Help us make this faster
- Security Enhancements: Auditing and hardening the system
- Documentation: Examples, tutorials, and guides
- Testing: More comprehensive test coverage
MIT License. Do what you want with it. Build cool stuff. Make the world better.
Stop treating your AI tools like separate apps. Start using them like a coordinated team.
This isn't just another integration library. It's a fundamental shift in how we think about AI agent collaboration. It's the difference between having a toolbox and having a workshop full of expert craftsmen working together.
Ready to orchestrate your AI swarm?
npm install @vibes/agent-communication-busLet's build something incredible. Together.