Skip to content

khaoss85/AI-Team-Orchestrator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

507 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 AI Team Orchestrator

SYSTEM STATUS (2025-09-05): Post sub-agent analysis remediation complete. AI services operational with enhanced autonomous recovery, comprehensive quality gates, and systematic goal progress pipeline. Advanced AI-driven features fully functional.

Multi-Agent AI Platform - Complete functionality with 14 specialized sub-agents, AI-driven business value analysis, and intelligent task orchestration.

GitHub stars GitHub license Python Next.js

OpenAI Agents SDK FastAPI Supabase TypeScript Tailwind CSS

⚡ What Makes This Special

🧠 Real-Time Thinking Processes (Claude/o3 Style)

  • Live AI Reasoning: Watch agents think step-by-step in real-time
  • Collaborative Intelligence: Multi-agent coordination with handoffs
  • Explainable Decisions: Full transparency into AI decision-making

Quality Gates System (Post Sub-Agent Analysis)

  • OPERATIONAL: 14 specialized sub-agents providing comprehensive quality validation
  • AI-Driven: Director orchestrates systematic quality gates based on change analysis
  • Intelligent: Sub-agents automatically triggered based on file patterns and architectural impact

AI Architecture Status (Systematic Improvements Applied)

  • AI-Driven Logic: Universal learning engine provides semantic understanding
  • Business Value Analysis: AI-powered task evaluation replacing hardcoded patterns
  • Adaptive System: Context-aware decision making via universal AI pipeline engine

System Features (Enhanced & Operational)

  • Autonomous Recovery: Enhanced auto-complete with intelligent failed task recovery
  • Goal Planning: AI-driven goal decomposition with business insight extraction
  • Professional Output: AI content transformation providing business-ready deliverables
  • Real Cost Tracking: OpenAI Usage API v1 integration for accurate budget management
  • Cost Intelligence: AI-driven optimization alerts detecting duplicate calls and waste

⚠️ Document Intelligence Status (Limited)

  • Basic Document Upload: Simple file upload may work, advanced processing broken
  • RAG BROKEN: OpenAI Assistants API integration failing due to SDK issues
  • Vector Search BROKEN: Semantic search not working, using basic keyword matching
  • AI Analysis BROKEN: Document intelligence features not working
  • Agent Knowledge BROKEN: Cannot assign documents to agents due to agent creation failures
  • Context DEGRADED: Basic conversation memory only, advanced context broken
  • MCP BROKEN: Model Context Protocol integration not functional
  • Processing LIMITED: Basic text extraction only, AI analysis failing

🚀 Quick Start (< 5 minutes)

Prerequisites

  • Node.js 18+ and Python 3.11+
  • OpenAI API key (for AI agents)
  • Supabase account (free tier works)

One-Command Setup

# Clone and setup everything
git clone https://github.com/khaoss85/multi-agents.git
cd ai-team-orchestrator
./scripts/quick-setup.sh

Manual Setup

# Backend setup
cd backend
pip install -r requirements.txt
cp .env.example .env  # Add your API keys

# Frontend setup  
cd ../frontend
npm install

# Start both services
npm run dev     # Frontend (port 3000)
python main.py  # Backend (port 8000) - run from backend/

⚙️ Configuration Files

The following configuration files are required but not included in Git for security. Create them locally:

📁 Backend Configuration (backend/.env)

Copy backend/.env.example and fill in your credentials:

# 🔑 Required API Keys
OPENAI_API_KEY=sk-your-openai-api-key-here
SUPABASE_URL=https://your-project-id.supabase.co  
SUPABASE_KEY=your-supabase-anon-public-key

# 📚 OpenAI Assistants API (RAG)
USE_OPENAI_ASSISTANTS=true                    # Enable native OpenAI Assistants for RAG
OPENAI_ASSISTANT_MODEL=gpt-4-turbo-preview    # Model for assistants (optional)
OPENAI_ASSISTANT_TEMPERATURE=0.7              # Response temperature (optional)
OPENAI_FILE_SEARCH_MAX_RESULTS=10             # Max search results (optional)

# 🎯 Goal-Driven System (Core Features)
ENABLE_GOAL_DRIVEN_SYSTEM=true
AUTO_CREATE_GOALS_FROM_WORKSPACE=true
GOAL_VALIDATION_INTERVAL_MINUTES=20
MAX_GOAL_DRIVEN_TASKS_PER_CYCLE=5
GOAL_COMPLETION_THRESHOLD=80

# 📦 Asset & Deliverable Configuration
USE_ASSET_FIRST_DELIVERABLE=true
PREVENT_DUPLICATE_DELIVERABLES=true
MAX_DELIVERABLES_PER_WORKSPACE=3
DELIVERABLE_READINESS_THRESHOLD=100
MIN_COMPLETED_TASKS_FOR_DELIVERABLE=2
DELIVERABLE_CHECK_COOLDOWN_SECONDS=30

# 🤖 AI Quality Assurance
ENABLE_AI_QUALITY_ASSURANCE=true
ENABLE_DYNAMIC_AI_ANALYSIS=true
ENABLE_AUTO_PROJECT_COMPLETION=true

# 🧠 Enhanced Reasoning (Claude/o3 Style)
ENABLE_DEEP_REASONING=true
DEEP_REASONING_THRESHOLD=0.7
REASONING_CONFIDENCE_MIN=0.6
MAX_REASONING_ALTERNATIVES=3

# ⚡ Performance & Rate Limiting
OPENAI_RPM_LIMIT=3000
VALIDATION_CACHE_TTL=600
ENABLE_AGGRESSIVE_CACHING=true
AUTO_REFRESH_INTERVAL=600

🔗 Getting Your API Keys

OpenAI API Key

  1. Visit OpenAI Platform
  2. Create new API key
  3. Copy the sk-... key to your .env file
  4. Important: Add payment method for usage beyond free tier

Supabase Database Setup

  1. Visit Supabase Dashboard
  2. Create new project (free tier available - 500MB database, 2 CPU hours)
  3. Go to SettingsAPI
  4. Copy Project URL and anon public key
  5. Paste both in your .env file

🗄️ Database Schema Setup

The AI Team Orchestrator uses a sophisticated PostgreSQL schema optimized for AI-driven operations with support for multi-agent coordination, real-time thinking processes, and intelligent deliverable management.

🚀 Quick Database Setup

  1. Create Supabase Project

    # After creating your Supabase project, get your connection details:
    # Project URL: https://YOUR-PROJECT-ID.supabase.co
    # API Key: your-anon-public-key
  2. Run Complete Production Schema

    We provide a complete production-ready database schema that includes all tables, indexes, and optimizations used in our live system.

    Option A: Using Supabase SQL Editor

    1. Open your Supabase Dashboard
    2. Go to SQL Editor
    3. Copy the contents of database-schema.sql
    4. Execute the complete script

    Option B: Using CLI (if you have psql)

    # Download and execute the schema file
    psql -h db.YOUR-PROJECT-ID.supabase.co -p 5432 -d postgres -U postgres -f database-schema.sql

    The complete schema includes:

    • 🏗️ Core Tables: workspaces, agents, tasks, deliverables, workspace_goals
    • 🧠 AI Features: thinking_processes, memory_patterns, learning_insights
    • 📊 Analytics: system_health_logs, agent_performance_metrics
    • 🔧 Performance: 25+ optimized indexes for AI operations
    • 🛡️ Security: Proper foreign keys, constraints, and RLS policies
  3. Verify Setup

    -- Check all tables were created (should return 15+ tables)
    SELECT table_name FROM information_schema.tables 
    WHERE table_schema = 'public' 
    ORDER BY table_name;
    
    -- Verify core functionality
    SELECT 
      (SELECT count(*) FROM information_schema.tables WHERE table_schema = 'public') as total_tables,
      (SELECT count(*) FROM information_schema.columns WHERE table_schema = 'public') as total_columns,
      (SELECT count(*) FROM pg_indexes WHERE schemaname = 'public') as total_indexes;

⚡ Quick Test

After setup, test your database connection:

# From backend directory
python -c "
from database import get_supabase_client
client = get_supabase_client()
result = client.table('workspaces').select('count').execute()
print('✅ Database connected successfully!')
print(f'Tables accessible: {bool(result.data is not None)}')
"

🔧 Environment Variables

Make sure your backend/.env contains:

SUPABASE_URL=https://your-project-id.supabase.co
SUPABASE_KEY=your-anon-public-key-here

🛡️ Security Best Practices

  • Never commit .env files to Git
  • Use different API keys for development/production
  • Set OpenAI usage limits to control costs
  • Rotate keys regularly for production deployments
  • ⚠️ Keep your .env file private - it contains sensitive credentials

📋 Files Excluded from Git

The following files are automatically ignored for security/cleanup:

# 🔐 Sensitive configuration files
.env*                    # Environment variables with API keys
!*.env.example          # Example files are kept in repo

# 📊 Development artifacts  
*.log                   # Log files from development
*.tmp, *.bak           # Temporary and backup files
__pycache__/           # Python bytecode
node_modules/          # NPM dependencies

# 🧪 Test artifacts
test_results/          # Test output files
.pytest_cache/         # Python test cache
.coverage              # Coverage reports

# 🔧 Development tools
.vscode/, .idea/       # IDE configuration
.DS_Store             # macOS system files

🔧 Optional Configuration

For development customization, you can also create:

  • Backend: Additional .env.local for local overrides
  • Frontend: No additional config files needed (Next.js handles this)
  • Database: Supabase handles all database configuration remotely

🏗️ System Architecture

AI Team Orchestrator implements a multi-layer intelligent architecture that transforms business objectives into concrete deliverables through specialized AI agents.

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│  👤 User Input  │───▶│ 🎯 Goal Engine  │───▶│ 📋 Task Planner │
│  Business Goal  │    │ AI Decomposition│    │ Smart Breakdown │  
└─────────────────┘    └─────────────────┘    └─────────────────┘
         │                       │                       │
         ▼                       ▼                       ▼
┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│ 🤖 Agent Team   │───▶│ ⚡ Task Executor │───▶│ 📦 Deliverable  │
│ Dynamic Assembly│    │ Real-time Exec  │    │ Generator       │
└─────────────────┘    └─────────────────┘    └─────────────────┘
         │                       │                       │
         ▼                       ▼                       ▼
┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│ 🧠 Memory &     │    │ 🛡️ Quality      │    │ 🔄 Improvement  │
│ Learning Engine │    │ Assurance       │    │ Loop System     │
└─────────────────┘    └─────────────────┘    └─────────────────┘

🧠 Core Components

1. Goal-Driven Planning Engine (backend/ai_agents/director.py)

  • AI Goal Decomposition: Transforms high-level business objectives into concrete sub-goals
  • Dynamic Team Assembly: Intelligently selects specialized agents based on project requirements
  • Context-Aware Resource Planning: Estimates time, cost, and skill requirements

2. Multi-Agent Orchestration System (backend/executor.py)

  • Semantic Task Distribution: AI-powered task-agent matching beyond keyword filtering
  • Real-Time Coordination: Agents collaborate with handoffs and shared context
  • Adaptive Priority Management: Dynamic task prioritization based on business impact

3. Intelligent Quality Assurance (backend/improvement_loop.py)

  • Six-Step Improvement Loop: Automated feedback, iteration, and quality gates
  • AI-Driven Enhancement: Content quality assessment and automatic improvements
  • Human-in-the-Loop Integration: Strategic manual review for critical decisions

4. Professional Output Generation

  • AI Content Transformation: Raw JSON → Business-ready HTML/Markdown documents
  • Asset-First Architecture: Generates concrete deliverables, not just status reports
  • Dual-Format System: Technical data for processing + professional display for users

🔄 Data Flow Architecture

# 1. Business Goal Input
workspace = {
    "goal": "Increase Instagram engagement by 40% in 3 months",
    "domain": "social_media_marketing"
}

# 2. AI Goal Decomposition  
goals = await director.decompose_goal(workspace.goal)
# → ["Content Strategy", "Engagement Analysis", "Growth Tactics"]

# 3. Dynamic Agent Team Assembly
team = await director.assemble_team(goals, workspace.domain)
# → [MarketingStrategist, ContentCreator, DataAnalyst, SocialMediaExpert]

# 4. Intelligent Task Generation
tasks = await goal_engine.generate_tasks(goals, team)
# → Concrete, actionable tasks with skill requirements

# 5. Semantic Task-Agent Matching
for task in tasks:
    agent = await ai_matcher.find_best_match(task, team, context)
    await executor.assign_task(task, agent)

# 6. Real-Time Execution with Quality Gates
result = await executor.execute_with_qa(task, agent)
# → Includes thinking process, quality validation, improvement loops

# 7. Professional Deliverable Generation
deliverable = await content_transformer.generate_asset(result)
# → Business-ready document with insights and recommendations

🛠️ Technical Implementation

Backend Architecture (FastAPI + Python)

backend/
├── 🎯 ai_agents/           # Specialized AI agent implementations
│   ├── director.py         # Team composition & project planning  
│   ├── conversational.py   # Natural language task interface
│   └── specialist_*.py     # Domain expert agents
├── ⚡ services/            # Core business logic services
│   ├── autonomous_task_recovery.py    # Self-healing task system
│   ├── content_aware_learning_engine.py  # Business insights extraction
│   ├── unified_memory_engine.py       # Context & learning storage
│   ├── thinking_process.py            # Real-time reasoning capture
│   ├── document_manager.py            # RAG document processing & indexing
│   └── mcp_tool_discovery.py          # Model Context Protocol integration
├── 🔄 routes/             # RESTful API endpoints  
│   ├── director.py        # Team proposal & approval
│   ├── conversational.py  # Chat interface & tool execution
│   ├── documents.py       # Document upload & RAG management
│   └── monitoring.py      # System health & metrics
├── 💾 database.py         # Supabase integration & data layer
├── ⚙️ executor.py          # Task execution & orchestration engine  
└── 🏃 main.py             # FastAPI application entry point

Frontend Architecture (Next.js 15 + TypeScript)

frontend/src/
├── 📱 app/                # App Router (Next.js 15)
│   ├── layout.tsx         # Global layout & providers
│   ├── page.tsx          # Landing page
│   └── projects/         # Project management interface
├── 🧩 components/         # Reusable UI components
│   ├── conversational/   # Chat interface & thinking display
│   ├── orchestration/    # Team management & task views
│   ├── improvement/      # Quality feedback & enhancement
│   └── documents/        # Document upload, RAG, and knowledge management
├── 🔧 hooks/             # Custom React hooks for data management
│   ├── useConversationalWorkspace.ts  # Progressive loading system
│   ├── useGoalThinking.ts            # Goal-driven UI state
│   └── useAssetManagement.ts         # Deliverable management
├── 🔌 utils/             # API client & utilities
│   ├── api.ts            # Type-safe API client
│   └── websocket.ts      # Real-time updates
└── 🎨 types/             # TypeScript definitions
    ├── workspace.ts      # Core domain models
    └── agent.ts          # Agent & task types

📊 Built-in Telemetry & Monitoring

The AI Team Orchestrator includes production-ready observability out-of-the-box. Once you add your OpenAI API key, the system automatically enables comprehensive monitoring:

🔍 OpenAI Tracing Integration

  • Automatic Request Tracking: All OpenAI API calls are traced with performance metrics
  • Token Usage Monitoring: Real-time tracking of prompt/completion tokens and costs
  • Model Performance Analytics: Response times, success rates, and quality metrics per model
  • Rate Limit Management: Built-in monitoring and adaptive throttling for API limits

📈 System Health Dashboard

# Built-in health monitoring endpoints
curl localhost:8000/health                    # Overall system status
curl localhost:8000/api/monitoring/metrics    # Performance metrics
curl localhost:8000/api/monitoring/costs      # API usage and costs
curl localhost:8000/api/system-telemetry      # Comprehensive telemetry

🧠 AI Agent Activity Tracking

  • Real-time Agent Status: Monitor which agents are active, thinking, or completing tasks
  • Task Execution Traces: Complete visibility into task lifecycle and handoffs
  • Quality Gate Monitoring: Track which sub-agents are triggered and their success rates
  • Memory System Analytics: Insights into learning patterns and knowledge retention

⚡ Performance Intelligence

# Automatic performance logging (built-in)
# No configuration needed - works immediately after API key setup

logger.info(f"🔍 Web search completed in {execution_time:.2f}s")
logger.info(f"🤖 AI classification confidence: {result.confidence:.2f}")  
logger.info(f"💰 API cost estimate: ${cost_tracker.current_session}")
logger.info(f"🧠 Thinking process: {thinking_steps} steps completed")

🎯 Debug Mode Features

  • Live Thinking Processes: Watch AI agents reason through problems step-by-step (Claude/o3 style)
  • Tool Orchestration Traces: See exactly which tools are selected and why
  • Domain Classification Insights: Understand how the system identifies project domains
  • Memory Pattern Analysis: Visualize how the system learns from past projects

🔒 Privacy-First Telemetry

  • No External Services: All telemetry stays within your infrastructure
  • Configurable Logging: Fine-tune what gets logged via environment variables
  • API Key Security: Telemetry never exposes your API keys or sensitive data
  • GDPR Compliant: No personal data collection by default

📊 Production Monitoring Commands

# System performance check
python3 backend/check_system_health.py

# View recent API usage and costs
curl localhost:8000/api/monitoring/usage-summary

# Export telemetry for analysis
curl localhost:8000/api/system-telemetry/export > telemetry-$(date +%Y%m%d).json

# Monitor thinking processes in real-time
curl localhost:8000/api/monitoring/thinking-processes/active

⚙️ Telemetry Configuration

# Optional: Customize monitoring (all enabled by default)
ENABLE_OPENAI_TRACING=true          # OpenAI API call tracking
ENABLE_PERFORMANCE_LOGGING=true     # Execution time monitoring  
ENABLE_COST_TRACKING=true          # API usage cost calculation
ENABLE_THINKING_TRACE=true         # Real-time reasoning capture
TELEMETRY_LOG_LEVEL=INFO           # DEBUG, INFO, WARNING, ERROR
TELEMETRY_EXPORT_INTERVAL=3600     # Export telemetry every hour

🎉 Zero Configuration Required: Simply add your OPENAI_API_KEY and the system automatically provides enterprise-grade monitoring and debugging capabilities.

🎨 User Experience

Professional Interface Design

AI Team Orchestrator features a clean, intuitive interface designed for business users and technical teams alike.

📋 Project Creation & Setup

New Project Creation

Streamlined project creation with goal-driven setup and domain selection

Project Configuration

Advanced project configuration with AI-driven parameter optimization

👥 Intelligent Team Assembly

AI Team Proposal

AI Director proposes optimal team composition based on project requirements

Team Management

Real-time team management with agent performance monitoring and role adjustment

🧠 Real-Time Thinking Processes

Thinking Process Visualization

Claude/o3-style thinking visualization - watch AI agents reason through complex problems in real-time

💾 Intelligent Memory System

Memory System Interface

Comprehensive memory and learning system with business insights and performance analytics

🎯 Key UX Features

  • 📱 Progressive Loading: Essential UI renders in <200ms, enhanced features load in background
  • 🔄 Real-Time Updates: WebSocket integration for live project status and thinking processes
  • 🎨 Professional Output: AI-transformed deliverables from raw JSON to business-ready documents
  • 🧠 Explainable AI: Complete transparency into agent decision-making and reasoning steps
  • 📊 Performance Monitoring: Real-time system health, task progress, and quality metrics
  • 🛡️ Quality Gates: Visual feedback for improvement loops and human-in-the-loop reviews

🔬 Technical Deep Dive

💡 Core Innovation: AI-First Development

Traditional development uses hard-coded business logic. AI Team Orchestrator transforms this with Semantic Intelligence:

# ❌ Traditional Hard-Coded Approach
if task_type in ["email", "campaign", "marketing"]:
    agent = marketing_specialist
elif domain == "finance":
    agent = finance_specialist

# ✅ AI-Driven Semantic Matching  
agent = await ai_agent_matcher.find_best_match(
    task_content=task.description,
    required_skills=task.extracted_skills,
    context=workspace.domain
)

⚙️ 15 Architectural Pillars

Our system is built on 15 core principles that ensure scalability and reliability:

  1. 🌍 Domain Agnostic - No industry-specific hard-coding
  2. 🧠 AI-First Logic - Semantic understanding over keyword matching
  3. 🔄 Autonomous Recovery - Self-healing without human intervention
  4. 📊 Goal-Driven Architecture - Everything ties to measurable objectives
  5. 🛡️ Quality Gates - Automated architectural review system
  6. 📝 Explainable AI - Transparent decision-making processes
  7. 🎯 Real Tool Usage - Actual web search, file operations, not mocks
  8. 💾 Contextual Memory - Learns from past patterns and decisions
  9. 🔧 SDK-Native - Leverages OpenAI Agents SDK vs custom implementations
  10. ⚡ Cost Optimization - Smart API usage reduction (94% savings)
  11. 📱 Production Ready - Enterprise-grade error handling and monitoring
  12. 🤝 Human-in-the-Loop - Strategic human oversight for critical decisions
  13. 🔒 Security First - Secrets management and secure API practices
  14. 📚 Living Documentation - Self-updating technical documentation
  15. 🌐 Multi-Language Support - Internationalization-ready architecture

🧪 Advanced Features

Autonomous Task Recovery

# Failed tasks automatically heal themselves
try:
    result = await execute_task(task)
except Exception as error:
    recovery = await autonomous_recovery.analyze_and_fix(
        task_id=task.id,
        error_context=str(error),
        workspace_history=workspace.memory
    )
    # Task continues without human intervention

Real-Time Thinking Visualization

// Watch AI agents think step-by-step (Claude/o3 style)
const { thinkingSteps, isThinking } = useThinkingProcess(taskId)

// Live updates: Analysis → Planning → Execution → Validation
return (
  <ThinkingViewer steps={thinkingSteps} realTime={isThinking} />
)

Cost-Optimized Quality Gates

# Director intelligently decides which agents to invoke
analysis = await director.analyze_changes(modified_files)
if analysis.requires_architecture_review:
    await invoke_agent("system-architect")
if analysis.has_database_changes:
    await invoke_agent("db-steward")
# Result: $3/month vs $240/month in API costs

🎮 Demo Features

Real-Time AI Thinking

// Watch AI agents think step-by-step
const thinkingProcess = useThinkingProcess(workspaceId)
// Displays: Analysis → Planning → Synthesis → Validation

Smart Cost Control

// Director intelligently decides which agents to invoke
Change: "frontend/Button.tsx"  0 agent calls (UI only)
Change: "backend/database.py"  3 agents (architecture + security + DB)
Result: $3/month vs $240/month in costs

Autonomous Recovery

# Tasks self-heal without human intervention
try:
    result = await execute_task(task)
except Exception as e:
    # AI analyzes failure and selects recovery strategy
    recovery = await autonomous_recovery(task_id, error_context)
    # Success: Task continues automatically

📈 Use Cases

🏢 Enterprise Development Teams

  • Quality Assurance: Automated architectural reviews
  • Cost Control: Intelligent sub-agent triggering
  • Team Coordination: Multi-agent task distribution

🚀 AI-First Startups

  • Rapid Prototyping: AI-driven feature development
  • Scalable Architecture: Built-in best practices enforcement
  • Professional Output: Business-ready deliverables from day one

🎓 Research & Education

  • Multi-Agent Systems: Study real-world coordination patterns
  • AI Transparency: Observe reasoning processes in detail
  • Production Patterns: Learn enterprise AI architecture

🛠️ Advanced Configuration

Environment Variables (Backend)

# Core AI Configuration
OPENAI_API_KEY=your_openai_key
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key

# Cost Optimization
ENABLE_SUB_AGENT_ORCHESTRATION=true
SUB_AGENT_MAX_CONCURRENT_AGENTS=5
SUB_AGENT_PERFORMANCE_TRACKING=true

# AI-Driven Features
ENABLE_AI_AGENT_MATCHING=true
ENABLE_AI_QUALITY_ASSURANCE=true
ENABLE_AUTO_TASK_RECOVERY=true

# Goal-Driven System
ENABLE_GOAL_DRIVEN_SYSTEM=true
GOAL_COMPLETION_THRESHOLD=80
MAX_GOAL_DRIVEN_TASKS_PER_CYCLE=5

Development Commands

# Backend (FastAPI)
cd backend && python main.py              # Start server (port 8000)
cd backend && pytest                      # Run tests
cd backend && python check_system.py     # Health check

# Frontend (Next.js)  
cd frontend && npm run dev                # Start dev server (port 3000)
cd frontend && npm run build              # Production build
cd frontend && npm run lint               # Code quality check

# End-to-End Testing
./scripts/run_e2e_flow.sh                # Complete system test

📊 Performance Benchmarks

Metric Before Optimization After AI-Driven
Quality Gates Cost $240/month $3/month (94% reduction)
Task Recovery Time Manual intervention <60s autonomous
Code Review Coverage 60% manual 95% automated
Architecture Violations 15-20/week <2/week

🤝 Contributing

We welcome contributions! Check out our Contributing Guide for:

  • 🐛 Bug Reports: Help us improve quality
  • Feature Requests: Shape the roadmap
  • 🧪 Sub-Agent Development: Create specialized agents
  • 📖 Documentation: Improve developer experience

Development Setup

# Setup development environment
git clone <your-fork>
cd ai-team-orchestrator
pip install -r backend/requirements-dev.txt
npm install --save-dev # Frontend dev dependencies

# Run quality gates locally
./scripts/run-quality-gates.sh

📚 Document Intelligence & RAG

The AI Team Orchestrator includes advanced document processing and retrieval-augmented generation (RAG) capabilities for knowledge-enhanced agent interactions.

📄 Document Upload & Processing

Upload Documents for Agent Knowledge

# Upload domain-specific documents for specialized agents
curl -X POST "http://localhost:8000/api/documents/upload" \
  -F "file=@./company-guidelines.pdf" \
  -F "agent_id=specialist_agent_id" \
  -F "scope=agent" \
  -F "description=Company guidelines for business analysis"

# Upload team-wide knowledge base
curl -X POST "http://localhost:8000/api/documents/upload" \
  -F "file=@./industry-report.pdf" \
  -F "workspace_id=workspace_id" \
  -F "scope=team" \
  -F "description=Industry market analysis for all agents"

Supported Document Formats

  • 📄 Text Documents: PDF, DOCX, TXT, Markdown
  • 📊 Structured Data: CSV, JSON, XML
  • 🎨 Images: PNG, JPG (with OCR processing)
  • 📋 Presentations: PPTX (text extraction)
  • 🔗 Web Content: URLs for automatic scraping

🧠 RAG-Enhanced Agent Interactions

Agent-Specific Knowledge

// Agents automatically access their knowledge base during task execution
const specialist = {
  "role": "Financial Analyst",
  "knowledge_sources": [
    "financial_reports_2024.pdf",
    "market_analysis.docx", 
    "company_policies.md"
  ],
  "rag_enabled": true
}

// Agent reasoning with document context
"Based on the Q3 financial report (uploaded document), 
 I recommend focusing on the emerging markets strategy..."

Multi-Modal Document Understanding

# Process complex documents with text, images, and tables
document_insights = await document_manager.process_document(
    file_path="comprehensive_report.pdf",
    agent_context="business_strategy",
    extract_modes=["text", "images", "tables", "charts"]
)

# Agents can reason about visual content
# "The chart on page 5 shows declining trend in Q4..."

🔍 Intelligent Knowledge Retrieval

Context-Aware Document Search

# Search across agent knowledge base
curl -X GET "http://localhost:8000/api/documents/search" \
  -G \
  -d "query=customer retention strategies" \
  -d "agent_id=marketing_specialist" \
  -d "limit=5"

# Team-wide knowledge search
curl -X GET "http://localhost:8000/api/documents/search" \
  -G \
  -d "query=risk assessment frameworks" \
  -d "workspace_id=workspace_id" \
  -d "scope=team"

Semantic Similarity Matching

  • 📊 Vector Embeddings: Documents indexed with OpenAI embeddings
  • 🎯 Contextual Retrieval: Relevant content based on current task context
  • 🔄 Real-Time Updates: Document changes reflected immediately in agent knowledge
  • 📈 Usage Analytics: Track which documents agents reference most frequently

🔧 MCP Integration (Model Context Protocol)

External Tool Connectivity

# MCP-enabled agents can connect to external systems
mcp_tools = [
    "database_connector",    # Direct database queries
    "api_integrations",     # REST/GraphQL APIs
    "file_system_access",   # Local and cloud file systems
    "web_scraping",         # Real-time web content
    "email_integration"     # Email and calendar access
]

# Agents automatically discover and use available MCP tools
agent_capabilities = await mcp_discovery.scan_available_tools(workspace_id)

Dynamic Knowledge Expansion

  • 🌐 Web Integration: Real-time access to web resources and APIs
  • 💾 Database Connectivity: Direct queries to business databases
  • 📧 Communication Tools: Email, Slack, and messaging platform integration
  • ☁️ Cloud Services: Integration with Google Drive, Dropbox, OneDrive

⚙️ Configuration

# RAG & Document Processing Configuration
ENABLE_DOCUMENT_RAG=true                    # Enable RAG capabilities
DOCUMENT_STORAGE_PATH="./documents"         # Local document storage
ENABLE_OCR_PROCESSING=true                  # Image text extraction
MAX_DOCUMENT_SIZE_MB=50                     # Upload size limit
DOCUMENT_RETENTION_DAYS=365                 # Automatic cleanup

# Vector Search Configuration  
EMBEDDING_MODEL="text-embedding-3-large"    # OpenAI embedding model
VECTOR_SIMILARITY_THRESHOLD=0.8             # Relevance threshold
MAX_RAG_CONTEXT_TOKENS=8000                 # Context window limit

# MCP Integration
ENABLE_MCP_TOOLS=true                       # Model Context Protocol
MCP_DISCOVERY_INTERVAL=3600                 # Tool discovery frequency
MCP_SECURITY_VALIDATION=true               # Security checks for external tools

📊 Document Analytics & Insights

# Monitor document usage and effectiveness
curl "http://localhost:8000/api/documents/analytics/workspace/workspace_id"

# Document usage by agents
curl "http://localhost:8000/api/documents/usage/agent/agent_id"

# Knowledge gap analysis
curl "http://localhost:8000/api/documents/gaps/workspace_id"

The RAG system transforms agents from generic AI assistants into domain experts with access to your specific business knowledge, documents, and external systems! 🚀

🗺️ Roadmap

🎯 Q1 2025

  • Multi-Model Support: Claude, Gemini, local models
  • Plugin Architecture: Custom sub-agent marketplace
  • Advanced Metrics: Performance analytics dashboard

🚀 Q2 2025

  • Collaborative Workspaces: Multi-user team support
  • API Rate Optimization: Intelligent caching layer
  • Mobile Dashboard: React Native companion app

🔮 Future Vision

  • Self-Improving Agents: ML-based agent optimization
  • Industry Templates: Domain-specific agent configurations
  • Enterprise SSO: Advanced authentication systems

📖 Complete Learning Resources

🎓 "AI Team Orchestrator" - The Complete Guide

Read the Complete Book

Free comprehensive guide covering:

  • 🏗️ Multi-Agent Architecture Patterns - Design principles and best practices
  • 🤖 AI-First Development Methodology - Moving beyond hard-coded logic
  • 🛡️ Production Quality Gates - Automated review and optimization systems
  • 💰 Cost Optimization Strategies - 94% API cost reduction techniques
  • 📊 Real-World Case Studies - Enterprise implementations and lessons learned
  • 🔧 Advanced Implementation Guides - Deep technical implementation details

📚 Technical Documentation

🌐 Community & Learning

📄 License

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

⭐ Star History

If you find this project useful, please consider giving it a star! It helps others discover the project and motivates continued development.

Star History Chart

📢 Share the Project

Help spread the word about AI Team Orchestrator!

🐦 Social Media

Share on Twitter Share on LinkedIn Share on Reddit

💬 Join the Community

🏷️ Trending Keywords

#AIOrchestration #MultiAgentSystems #OpenAI #ProductivityTools #AutomationPlatform #EnterpriseAI #SemanticIntelligence #QualityGates #RealTimeThinking #CostOptimization #RAG #DocumentIntelligence #MCP #KnowledgeManagement


🗺️ Development Roadmap

🏗️ Core Pillars Enhancement

The AI Team Orchestrator evolves through systematic implementation of architectural pillars that enhance intelligence, scalability, and user experience.

📈 Deliverable Evolution & History

  • Smart Deliverable Versioning: Track evolution of deliverables with AI-driven change analysis
  • Collaborative Editing Timeline: Visual history of agent contributions and human feedback loops
  • Content Genealogy: Trace how insights from previous deliverables influence new outputs
  • Quality Delta Analysis: Measure improvement across deliverable iterations

🛠️ AI-Driven Tool Ecosystem

  • Dynamic Tool Discovery: AI agents automatically discover and integrate new tools based on task requirements
  • Adaptive Tool Selection: Context-aware tool recommendation engine for optimal task execution
  • Custom Tool Generation: AI-powered creation of domain-specific tools for specialized workflows
  • Tool Performance Analytics: Intelligent tool usage optimization based on success patterns
  • Advanced RAG Integration: Multi-modal document processing with agent-specific knowledge bases
  • MCP Ecosystem Expansion: Model Context Protocol support for external tool and data connectivity

💰 Cost & Resource Optimization

  • Predictive Budget Management: AI forecasting of project costs based on scope and team composition
  • Dynamic Resource Allocation: Automatic scaling of AI agent teams based on workload and deadlines
  • Cost-Benefit Analysis Engine: Real-time ROI calculation for different execution strategies
  • Energy-Efficient Processing: Smart task batching and API call optimization

🔍 Advanced Quality Assurance

  • Multi-Dimensional Quality Metrics: Beyond completion rates - measure business impact, user satisfaction, innovation
  • Contextual Quality Thresholds: Adaptive quality standards based on domain, urgency, and stakeholder requirements
  • Automated Quality Enhancement: AI-driven iterative improvement suggestions before human review
  • Quality Prediction Models: Forecast deliverable quality early in the execution cycle

🧠 Personalized Memory Architecture

  • Individual Learning Profiles: Customized knowledge bases for each workspace and user preference
  • Cross-Project Intelligence: Insights from one project intelligently applied to related domains
  • Memory Consolidation Engine: Automatic synthesis of fragmented learnings into coherent knowledge
  • Contextual Memory Retrieval: Smart access to relevant past experiences based on current task context

👤 Human-in-the-Loop Enhancement

  • Intelligent Escalation: AI determines optimal moments for human intervention based on complexity and risk
  • Collaborative Decision Making: Structured frameworks for human-AI consensus building
  • Expertise Recognition: System learns individual human strengths to route appropriate decisions
  • Feedback Loop Optimization: Minimize human effort while maximizing decision quality

⚡ Advanced Reasoning & Thinking

  • Multi-Path Reasoning: Explore alternative solution approaches simultaneously for complex problems
  • Reasoning Chain Validation: Self-verification mechanisms to ensure logical consistency
  • Adaptive Thinking Depth: Dynamic adjustment of reasoning complexity based on problem difficulty
  • Collaborative Reasoning: Multiple agents contributing specialized thinking to complex decisions

🎯 Implementation Philosophy

Each pillar enhancement follows our core principles:

  • 🤖 AI-First: No hard-coded logic, everything driven by semantic intelligence
  • 📊 Data-Driven: All improvements backed by performance metrics and user feedback
  • 🔧 Production-Ready: Enhancements deployed with comprehensive testing and monitoring
  • 🌍 Domain-Agnostic: Features work across all business sectors and use cases
  • ⚡ Performance-Focused: Maintain sub-3s response times while adding sophistication

💡 Community-Driven Evolution

Priority is determined by:

  • Community feedback and feature requests
  • Real-world usage patterns and performance bottlenecks
  • Alignment with the 15 Architectural Pillars
  • Business impact potential across diverse domains

Get Involved:

  • 🐛 Bug Reports: Help identify areas for improvement
  • Feature Requests: Shape the roadmap with your use cases
  • 📖 Documentation: Improve guides and tutorials
  • 🔧 Code Contributions: Implement enhancements following our AI-driven approach

Built with ❤️ by the AI Team Orchestrator community

Transform your development workflow with intelligent AI agent orchestration.

About

Next-generation multi-agent AI platform with autonomous quality gates, real-time thinking processes, and cost-optimized orchestration. Built with OpenAI Agents SDK, FastAPI, and Next.js 15.

Topics

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors