Skip to content

hackingco/claude-flow

Repository files navigation

Claude Flow

Claude Flow is a powerful Model Context Protocol (MCP) server that provides advanced AI swarm orchestration, memory management, and performance monitoring capabilities. It enables sophisticated multi-agent coordination with real-time tracing and observability.

Features

Core Capabilities

  • πŸ€– AI Swarm Orchestration: Coordinate multiple AI agents with different topologies (mesh, hierarchical, ring, star)
  • 🧠 Persistent Memory: SQLite-based memory storage for cross-session context retention
  • πŸ“Š Real-time Monitoring: Live performance tracking and visualization
  • πŸ”— MCP Integration: Full Model Context Protocol server implementation
  • πŸ“ˆ Langfuse Tracing: Comprehensive observability with Langfuse integration
  • πŸš€ Performance Optimization: Automatic bottleneck detection and optimization

Advanced Features

  • Neural Pattern Learning: Agents learn from successful operations
  • GitHub Integration: Repository-aware swarms for code management
  • Hooks System: Pre/post operation hooks for automation
  • Session Management: Persistent state across sessions
  • Parallel Execution: 2.8-4.4x speed improvements through parallelization

Installation

Quick Start (MCP with Claude Code)

# Add Claude Flow MCP server to Claude Code
claude mcp add claude-flow npx claude-flow@alpha mcp start

NPM Installation

# Global installation
npm install -g claude-flow@alpha

# Or use directly with npx
npx claude-flow@alpha [command]

Docker Deployment

# Using Docker Compose
docker-compose -f docker-compose.yml up -d

# Minimal setup
docker-compose -f docker-compose.minimal.yml up -d

# Full stack with monitoring
docker-compose -f docker-compose.stack.yml up -d

Usage

CLI Commands

# Start MCP server
npx claude-flow@alpha mcp start

# Initialize a swarm
npx claude-flow@alpha swarm init --topology mesh --agents 5

# Spawn an agent
npx claude-flow@alpha agent spawn --type researcher --name "API Explorer"

# Use hooks
npx claude-flow@alpha hooks pre-task --description "Analyze codebase"
npx claude-flow@alpha hooks post-edit --file "src/app.js" --format true

MCP Tools (in Claude Code)

Once configured as an MCP server, use these tools:

  • mcp__claude-flow__swarm_init - Initialize swarm coordination
  • mcp__claude-flow__agent_spawn - Create specialized agents
  • mcp__claude-flow__task_orchestrate - Coordinate complex tasks
  • mcp__claude-flow__memory_usage - Store/retrieve persistent memory
  • mcp__claude-flow__swarm_monitor - Real-time monitoring

Architecture

Project Structure

claude-flow/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ agents/           # Agent implementations
β”‚   β”œβ”€β”€ mcp/              # MCP server
β”‚   β”œβ”€β”€ memory/           # Memory management
β”‚   β”œβ”€β”€ monitoring/       # Performance monitoring
β”‚   β”œβ”€β”€ tracing/          # Langfuse integration
β”‚   └── hooks/            # Hook system
β”œβ”€β”€ bin/                  # CLI executables
β”œβ”€β”€ scripts/              # Utility scripts
└── docs/                 # Documentation

Key Components

  1. MCP Server (src/mcp/server.js)

    • Handles MCP protocol communication
    • Provides tool interfaces for Claude
  2. Swarm Manager (src/agents/swarm-manager.js)

    • Orchestrates multi-agent coordination
    • Manages different topology patterns
  3. Memory Store (src/memory/store.js)

    • SQLite-based persistent storage
    • Cross-session context retention
  4. Trace Manager (src/instrumentation/trace-manager.js)

    • Langfuse integration for observability
    • Performance metrics collection

Configuration

Environment Variables

# Langfuse Configuration (optional)
LANGFUSE_SECRET_KEY=your-secret-key
LANGFUSE_PUBLIC_KEY=your-public-key
LANGFUSE_HOST=https://cloud.langfuse.com

# Performance Settings
MAX_AGENTS=10
PARALLEL_EXECUTION=true
MEMORY_DB_PATH=.swarm/memory.db

Hooks Configuration

Hooks are configured in .claude/settings.json:

  • Automatic agent assignment
  • Code formatting on save
  • Performance optimization
  • Session persistence

Performance

  • 84.8% SWE-Bench solve rate - Superior problem-solving
  • 32.3% token reduction - Efficient task coordination
  • 2.8-4.4x speed improvement - Through parallelization
  • 27+ neural models - Diverse cognitive approaches

Docker Support

Available Images

  • claude-flow:latest - Full server with all features
  • claude-flow:worker - Lightweight worker image
  • claude-flow:dashboard - Monitoring dashboard

Docker Compose Stacks

  • docker-compose.yml - Standard deployment
  • docker-compose.minimal.yml - Minimal setup
  • docker-compose.stack.yml - Full monitoring stack

Development

Running Tests

npm test
npm run test:integration
npm run test:performance

Building

npm run build
npm run docker:build

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests
  5. Submit a pull request

License

MIT License - see LICENSE file for details

Support


Claude Flow - Empowering AI coordination and collaboration πŸš€

About

Docker-based Claude agent orchestration with MCP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages