# ๐Ÿ Hive: Unified Distributed AI Orchestration Platform **Hive** is a comprehensive distributed AI orchestration platform that consolidates the best components from our distributed AI development ecosystem into a single, powerful system for coordinating AI agents, managing workflows, and monitoring cluster performance. ## ๐ŸŽฏ What is Hive? Hive combines the power of: - **๐Ÿ”„ McPlan**: n8n workflow โ†’ MCP bridge execution - **๐Ÿค– Distributed AI Development**: Multi-agent coordination and monitoring - **๐Ÿ“Š Real-time Performance Monitoring**: Live metrics and alerting - **๐ŸŽจ Visual Workflow Editor**: React Flow-based n8n-compatible designer - **๐ŸŒ Multi-Agent Orchestration**: Intelligent task distribution across specialized AI agents ## ๐Ÿš€ Quick Start ### Prerequisites - Docker and Docker Compose - 8GB+ RAM recommended - Access to Ollama agents on your network ### 1. Launch Hive ```bash cd /home/tony/AI/projects/hive ./scripts/start_hive.sh ``` ### 2. Access Services - **๐ŸŒ Hive Dashboard**: https://hive.home.deepblack.cloud - **๐Ÿ“ก API Documentation**: https://hive.home.deepblack.cloud/api/docs - **๐Ÿ“Š Grafana Monitoring**: https://hive.home.deepblack.cloud/grafana (admin/hiveadmin) - **๐Ÿ” Prometheus Metrics**: https://hive.home.deepblack.cloud/prometheus ### 3. Default Credentials - **Grafana**: admin / hiveadmin - **Database**: hive / hivepass ## ๐Ÿ—๏ธ Architecture Overview ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ HIVE ORCHESTRATOR โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ Frontend Dashboard (React + TypeScript) โ”‚ โ”‚ โ”œโ”€โ”€ ๐ŸŽ›๏ธ Agent Management & Monitoring โ”‚ โ”‚ โ”œโ”€โ”€ ๐ŸŽจ Visual Workflow Editor (n8n-compatible) โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“Š Real-time Performance Dashboard โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“‹ Task Queue & Project Management โ”‚ โ”‚ โ””โ”€โ”€ โš™๏ธ System Configuration & Settings โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ Backend Services (FastAPI + Python) โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿง  Hive Coordinator (unified orchestration) โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ”„ Workflow Engine (n8n + MCP bridge) โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ก Agent Communication (compressed protocols) โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ˆ Performance Monitor (metrics & alerts) โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ”’ Authentication & Authorization โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ’พ Data Storage (workflows, configs, metrics) โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ Agent Network (Ollama + Specialized Models) โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ—๏ธ ACACIA (Infrastructure & DevOps) โ”‚ โ”‚ โ”œโ”€โ”€ ๐ŸŒ WALNUT (Full-Stack Development) โ”‚ โ”‚ โ”œโ”€โ”€ โš™๏ธ IRONWOOD (Backend & Optimization) โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿงช ROSEWOOD (QA & Testing) โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ฑ OAK (iOS/macOS Development) โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ”„ TULLY (Mobile & Game Development) โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ”Œ [Expandable Agent Pool] โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` ## ๐Ÿค– Configured Agents | Agent | Endpoint | Specialization | Model | Capabilities | |-------|----------|----------------|-------|--------------| | **ACACIA** | 192.168.1.72:11434 | Infrastructure & DevOps | deepseek-r1:7b | DevOps, Architecture, Deployment | | **WALNUT** | 192.168.1.27:11434 | Full-Stack Development | starcoder2:15b | Frontend, Backend, UI Design | | **IRONWOOD** | 192.168.1.113:11434 | Backend Specialist | deepseek-coder-v2 | APIs, Optimization, Databases | | **ROSEWOOD** | 192.168.1.132:11434 | QA & Testing | deepseek-r1:8b | Testing, Code Review, QA | | **OAK** | oak.local:11434 | iOS/macOS Development | mistral-nemo | Swift, Xcode, App Store | | **TULLY** | Tullys-MacBook-Air.local:11434 | Mobile & Game Dev | mistral-nemo | Unity, Mobile Apps | ## ๐Ÿ“Š Core Features ### ๐ŸŽจ Visual Workflow Editor - **n8n-compatible** visual workflow designer - **Drag & drop** node-based interface - **Real-time execution** monitoring - **Template library** for common workflows - **MCP integration** for AI tool conversion ### ๐Ÿค– Multi-Agent Orchestration - **Intelligent task distribution** based on agent capabilities - **Real-time health monitoring** of all agents - **Load balancing** across available agents - **Performance tracking** with TPS and response time metrics - **Capability-based routing** for optimal task assignment ### ๐Ÿ“ˆ Performance Monitoring - **Real-time dashboards** with live metrics - **Prometheus integration** for metrics collection - **Grafana dashboards** for visualization - **Automated alerting** for system issues - **Historical analytics** and trend analysis ### ๐Ÿ”ง Project Management - **Multi-project coordination** with agent assignment - **Task dependencies** and workflow management - **Quality control** with multi-agent code review - **Approval workflows** for security and compliance - **Template-based** project initialization ## ๐Ÿ› ๏ธ Management Commands ### Service Management ```bash # View all service logs docker-compose logs -f # View specific service logs docker-compose logs -f hive-backend # Restart services docker-compose restart # Stop all services docker-compose down # Rebuild and restart docker-compose up -d --build ``` ### Development ```bash # Access backend shell docker-compose exec hive-backend bash # Access database docker-compose exec postgres psql -U hive -d hive # View Redis data docker-compose exec redis redis-cli ``` ### Monitoring ```bash # Check service health curl http://localhost:8000/health # Get system status curl http://localhost:8000/api/status # View Prometheus metrics curl http://localhost:8000/api/metrics ``` ## ๐Ÿ“ Project Structure ``` hive/ โ”œโ”€โ”€ ๐Ÿ“‹ PROJECT_PLAN.md # Comprehensive project plan โ”œโ”€โ”€ ๐Ÿ—๏ธ ARCHITECTURE.md # Technical architecture details โ”œโ”€โ”€ ๐Ÿš€ README.md # This file โ”œโ”€โ”€ ๐Ÿ”„ docker-compose.yml # Development environment โ”‚ โ”œโ”€โ”€ backend/ # Python FastAPI backend โ”‚ โ”œโ”€โ”€ app/ โ”‚ โ”‚ โ”œโ”€โ”€ core/ # Core orchestration services โ”‚ โ”‚ โ”œโ”€โ”€ api/ # REST API endpoints โ”‚ โ”‚ โ”œโ”€โ”€ models/ # Database models โ”‚ โ”‚ โ””โ”€โ”€ services/ # Business logic โ”‚ โ”œโ”€โ”€ migrations/ # Database migrations โ”‚ โ””โ”€โ”€ requirements.txt # Python dependencies โ”‚ โ”œโ”€โ”€ frontend/ # React TypeScript frontend โ”‚ โ”œโ”€โ”€ src/ โ”‚ โ”‚ โ”œโ”€โ”€ components/ # React components โ”‚ โ”‚ โ”œโ”€โ”€ stores/ # State management โ”‚ โ”‚ โ””โ”€โ”€ services/ # API clients โ”‚ โ””โ”€โ”€ package.json # Node.js dependencies โ”‚ โ”œโ”€โ”€ config/ # Configuration files โ”‚ โ”œโ”€โ”€ hive.yaml # Main Hive configuration โ”‚ โ”œโ”€โ”€ agents/ # Agent-specific configs โ”‚ โ”œโ”€โ”€ workflows/ # Workflow templates โ”‚ โ””โ”€โ”€ monitoring/ # Monitoring configs โ”‚ โ””โ”€โ”€ scripts/ # Utility scripts โ”œโ”€โ”€ start_hive.sh # Main startup script โ””โ”€โ”€ migrate_from_existing.py # Migration script ``` ## ๐Ÿ”ง Configuration ### Agent Configuration Edit `config/hive.yaml` to add or modify agents: ```yaml hive: agents: my_new_agent: name: "My New Agent" endpoint: "http://192.168.1.100:11434" model: "llama2" specialization: "general" capabilities: ["coding", "analysis"] hardware: gpu_type: "NVIDIA RTX 4090" vram_gb: 24 cpu_cores: 16 performance_targets: min_tps: 10 max_response_time: 30 ``` ### Workflow Templates Add workflow templates in `config/workflows/`: ```yaml templates: my_workflow: agents: ["walnut", "ironwood"] stages: ["design", "implement", "test"] description: "Custom workflow template" ``` ## ๐Ÿ“ˆ Monitoring & Metrics ### Key Metrics Tracked - **Agent Performance**: TPS, response time, availability - **System Health**: CPU, memory, GPU utilization - **Workflow Execution**: Success rate, execution time - **Task Distribution**: Queue length, assignment efficiency ### Grafana Dashboards - **Hive Overview**: Cluster-wide metrics and status - **Agent Performance**: Individual agent details - **Workflow Analytics**: Execution trends and patterns - **System Health**: Infrastructure monitoring ### Alerts - **Agent Down**: Critical alert when agent becomes unavailable - **High Resource Usage**: Warning when thresholds exceeded - **Slow Response**: Alert for degraded performance - **Execution Failures**: Notification of workflow failures ## ๐Ÿ”ฎ Migration from Existing Projects Hive was created by consolidating these existing projects: ### โœ… Migrated Components - **distributed-ai-dev**: Agent coordination and monitoring - **McPlan**: Workflow engine and visual editor - **n8n-integration**: Workflow templates and patterns ### ๐Ÿ“Š Migration Results - **6 agents** configured and ready - **Core components** extracted and integrated - **Database schema** unified and enhanced - **Frontend components** merged and modernized - **Monitoring configs** created for all services ## ๐Ÿšง Development Roadmap ### Phase 1: Foundation โœ… - [x] Project consolidation and migration - [x] Core services integration - [x] Basic UI and API functionality - [x] Agent connectivity and monitoring ### Phase 2: Enhanced Features (In Progress) - [ ] Advanced workflow editor improvements - [ ] Real-time collaboration features - [ ] Enhanced agent capability mapping - [ ] Performance optimization ### Phase 3: Advanced AI Integration - [ ] Multi-modal AI support (image, audio, video) - [ ] Custom model fine-tuning pipeline - [ ] Advanced MCP server integration - [ ] Intelligent task optimization ### Phase 4: Enterprise Features - [ ] Multi-tenancy support - [ ] Advanced RBAC with LDAP integration - [ ] Compliance and audit logging - [ ] High availability deployment ## ๐Ÿค Contributing ### Development Setup 1. Fork the repository 2. Set up development environment: `./scripts/start_hive.sh` 3. Make your changes 4. Test thoroughly 5. Submit a pull request ### Code Standards - **Python**: Black formatting, type hints, comprehensive tests - **TypeScript**: ESLint, strict type checking, component tests - **Documentation**: Clear comments and updated README files ## ๐Ÿ“ž Support ### Documentation - **๐Ÿ“‹ PROJECT_PLAN.md**: Comprehensive project overview - **๐Ÿ—๏ธ ARCHITECTURE.md**: Technical architecture details - **๐Ÿ”ง API Docs**: http://localhost:8000/docs (when running) ### Troubleshooting - **Logs**: `docker-compose logs -f` - **Health Check**: `curl http://localhost:8000/health` - **Agent Status**: Check Hive dashboard at http://localhost:3000 --- ## ๐ŸŽ‰ Welcome to Hive! **Hive represents the culmination of our distributed AI development efforts**, providing a unified, scalable, and user-friendly platform for coordinating AI agents, managing workflows, and monitoring performance across our entire infrastructure. ๐Ÿ *"Individual agents are strong, but the Hive is unstoppable."* **Ready to experience the future of distributed AI development?** ```bash ./scripts/start_hive.sh ```