Skip to content

DreamLab-AI/multi-agent-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Claude Swarm Launcher πŸš€

GitHub Stars License Docker Python React

A sophisticated multi-agent orchestration platform that coordinates Claude, Gemini, and OpenAI agents to collaboratively solve complex software engineering tasks through parallel execution and intelligent solution synthesis.

Live Demo β€’ Documentation β€’ Report Bug β€’ Request Feature


🌟 Key Features

πŸ€– Multi-Agent Orchestration

  • Parallel execution of Claude, Gemini, and OpenAI agents
  • Intelligent task distribution and workload balancing
  • Real-time agent collaboration and communication

πŸ”„ Smart Integration

  • Automatic solution synthesis from multiple agents
  • Conflict resolution and consensus building
  • Best-practice extraction from diverse approaches

πŸ“Š Real-Time Monitoring

  • WebSocket-based live agent status updates
  • Performance metrics and cost tracking
  • Interactive timeline visualization

πŸ›‘οΈ Robust Architecture

  • Git-based workspace isolation
  • Automatic error recovery and retry logic
  • Docker containerization for easy deployment

πŸ—οΈ System Architecture

graph TB
    subgraph "Client Layer"
        UI[React UI]
        WS[WebSocket Client]
    end
    
    subgraph "API Layer"
        WSAPI[WebSocket API]
        REST[REST API]
        AUTH[Authentication]
    end
    
    subgraph "Orchestration Layer"
        OM[Orchestration Manager]
        TQ[Task Queue]
        IM[Integration Manager]
    end
    
    subgraph "Agent Layer"
        CA[Claude Agent]
        GA[Gemini Agent]
        OA[OpenAI Agent]
    end
    
    subgraph "Infrastructure"
        GIT[Git Workspaces]
        CACHE[Redis Cache]
        METRICS[Metrics Store]
    end
    
    UI <--> WS
    WS <--> WSAPI
    UI <--> REST
    REST --> AUTH
    WSAPI --> OM
    REST --> OM
    OM --> TQ
    TQ --> CA
    TQ --> GA
    TQ --> OA
    CA --> GIT
    GA --> GIT
    OA --> GIT
    CA --> IM
    GA --> IM
    OA --> IM
    IM --> WSAPI
    OM --> CACHE
    OM --> METRICS
    
    style UI fill:#61DAFB,stroke:#333,stroke-width:2px
    style CA fill:#7C3AED,stroke:#333,stroke-width:2px
    style GA fill:#4285F4,stroke:#333,stroke-width:2px
    style OA fill:#10B981,stroke:#333,stroke-width:2px
Loading

πŸš€ Quick Start

Prerequisites

System Requirements
  • Docker: 20.10+ with Docker Compose
  • Node.js: 20+ LTS (for local development)
  • Python: 3.11+ (for local development)
  • Git: 2.30+
  • Memory: 8GB RAM minimum
  • Storage: 10GB available space

🐳 Docker Installation (Recommended)

# Clone the repository
git clone https://github.com/yourusername/Claude-Swarm-Launcher.git
cd Claude-Swarm-Launcher

# Configure environment
cp .env.example .env
nano .env  # Add your API keys

# Launch with Docker Compose
docker-compose up -d

# View logs
docker-compose logs -f

The application will be available at http://localhost:8100

πŸ’» Local Development Setup

Backend Setup
# Navigate to backend
cd backend

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run development server
uvicorn main:app --reload --port 8000
Frontend Setup
# Navigate to frontend
cd frontend

# Install dependencies
npm install

# Run development server
npm run dev
AI CLI Tools Installation
# Install required CLI tools globally
npm install -g @anthropic/claude-cli @google/gemini-cli openai-cli

# Verify installations
claude --version
gemini --version
openai --version

πŸ”§ Configuration

Environment Variables

Create a .env file with the following variables:

# API Keys (Required)
ANTHROPIC_API_KEY=your_claude_api_key
GEMINI_API_KEY=your_gemini_api_key
OPENAI_API_KEY=your_openai_api_key

# Model Configuration (Optional)
CLAUDE_MODEL=claude-3-5-sonnet-20241022
GEMINI_MODEL=gemini-2.5-pro
OPENAI_MODEL=gpt-4o-mini

# Server Configuration
PORT=8100
HOST=0.0.0.0
DEBUG=false

# Performance Tuning
MAX_CONCURRENT_AGENTS=3
AGENT_TIMEOUT=300
RETRY_ATTEMPTS=3

Advanced Configuration

Model Selection Matrix
Use Case Claude Model Gemini Model OpenAI Model
Code Generation claude-3-5-sonnet gemini-2.5-pro gpt-4o
Quick Tasks claude-3-haiku gemini-2.5-flash gpt-4o-mini
Complex Analysis claude-3-opus gemini-2.5-pro gpt-4

πŸ“‘ API Reference

WebSocket API

sequenceDiagram
    participant Client
    participant WebSocket
    participant Orchestrator
    participant Agents
    participant Integration
    
    Client->>WebSocket: Connect
    WebSocket-->>Client: Connection Established
    
    Client->>WebSocket: Send Task Request
    WebSocket->>Orchestrator: Process Request
    
    Orchestrator->>Agents: Distribute Tasks
    Agents-->>WebSocket: Status Updates
    WebSocket-->>Client: agent_status
    
    Agents->>Integration: Submit Solutions
    Integration->>Integration: Synthesize Results
    Integration-->>WebSocket: Final Solution
    WebSocket-->>Client: integration_complete
Loading

Request Format

interface TaskRequest {
  prompt: string;
  config?: {
    models?: {
      claude?: string;
      gemini?: string;
      openai?: string;
    };
    timeout?: number;
    retries?: number;
  };
  context?: {
    files?: string[];
    previousTaskId?: string;
  };
}

Response Types

type WebSocketMessage = 
  | { type: 'agent_status'; agent: string; status: string; progress: number }
  | { type: 'agent_output'; agent: string; output: string; timestamp: string }
  | { type: 'integration_complete'; solution: string; metrics: object }
  | { type: 'error'; message: string; code: string };

REST Endpoints

Endpoint Method Description
/ GET Health check
/docs GET Swagger documentation
/api/tasks GET List all tasks
/api/tasks/{id} GET Get task details
/api/agents/status GET Agent status overview
/api/metrics GET Performance metrics

πŸ§ͺ Testing

# Run unit tests
python -m pytest tests/unit -v

# Run integration tests
python -m pytest tests/integration -v

# Run end-to-end tests
python test_agents.py

# Generate coverage report
python -m pytest --cov=backend --cov-report=html

πŸ“Š Performance Metrics

graph LR
    subgraph "Performance Indicators"
        A[Task Completion Time]
        B[Agent Response Time]
        C[Solution Quality Score]
        D[Resource Usage]
        E[Cost per Task]
    end
    
    A --> F[Dashboard]
    B --> F
    C --> F
    D --> F
    E --> F
    
    F --> G[Optimization Engine]
    G --> H[Auto-scaling]
    G --> I[Model Selection]
    G --> J[Load Balancing]
Loading

πŸ› οΈ Development

Project Structure

Claude-Swarm-Launcher/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ agents/              # Agent implementations
β”‚   β”‚   β”œβ”€β”€ base_agent.py    # Abstract base class
β”‚   β”‚   β”œβ”€β”€ claude_agent.py  # Claude integration
β”‚   β”‚   β”œβ”€β”€ gemini_agent.py  # Gemini integration
β”‚   β”‚   └── codex_agent.py   # OpenAI integration
β”‚   β”œβ”€β”€ api/                 # API endpoints
β”‚   β”œβ”€β”€ core/                # Core orchestration logic
β”‚   β”œβ”€β”€ utils/               # Utility functions
β”‚   └── main.py              # FastAPI application
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/      # React components
β”‚   β”‚   β”œβ”€β”€ hooks/           # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ services/        # API services
β”‚   β”‚   └── App.jsx          # Main application
β”‚   └── public/              # Static assets
β”œβ”€β”€ tests/                   # Test suites
β”œβ”€β”€ docker/                  # Docker configurations
└── docs/                    # Documentation

Adding New Agents

  1. Create a new agent class:
from backend.agents.base_agent import BaseAgent

class YourAgent(BaseAgent):
    def __init__(self, api_key: str, model: str):
        super().__init__("your-agent", api_key, model)
    
    async def execute(self, prompt: str) -> dict:
        # Implement agent logic
        pass
  1. Register in orchestrator:
# In backend/main.py
from backend.agents.your_agent import YourAgent

agents.append(YourAgent(api_key, model))

UI Component Architecture

graph TD
    A[App.jsx] --> B[DashboardOverview]
    A --> C[AgentMonitorPanel]
    A --> D[ProjectTimeline]
    
    B --> E[PerformanceMetrics]
    B --> F[CostTracker]
    
    C --> G[AgentStatus]
    C --> H[AgentOutput]
    
    D --> I[TaskHistory]
    D --> J[CodeDiffViewer]
    D --> K[FileModificationSummary]
    
    A --> L[ModelSelector]
    L --> M[ModelConfig]
Loading

🚨 Troubleshooting

Common Issues and Solutions

API Key Errors

# Verify API keys are set
cat .env | grep API_KEY

# Test individual agents
python -c "from backend.agents.claude_agent import ClaudeAgent; agent = ClaudeAgent('key', 'model'); print(agent.test_connection())"

Port Conflicts

# In docker-compose.yml, change ports:
services:
  app:
    ports:
      - "8200:8100"  # Change 8200 to any available port

WebSocket Connection Issues

// Check browser console for errors
// Verify WebSocket URL matches your server
const ws = new WebSocket('ws://localhost:8100/ws');

Memory Issues

# Increase Docker memory limit
docker-compose down
# Edit docker-compose.yml to add memory limits
docker-compose up -d

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

gitGraph
    commit id: "main"
    branch feature/new-feature
    checkout feature/new-feature
    commit id: "Add feature"
    commit id: "Add tests"
    checkout main
    merge feature/new-feature
    commit id: "Release v1.1"
Loading

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Anthropic for Claude API
  • Google for Gemini API
  • OpenAI for GPT API
  • All contributors and community members

Made with ❀️ by the Claude Swarm community

⬆ Back to Top

About

Containerised, more secure, general purpose Claude swarm launcher script.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published