Supervisor Multi-Agent System
Enterprise-grade AI Native Workspace Platform | ไผไธ็บงAIๅ็ๅทฅไฝๅนณๅฐ
- โจ Features
- ๐ธ Screenshots & Demo
- ๐๏ธ Architecture
- ๐ Quick Start
- ๐ฆ Installation
- ๐ง Configuration
- ๐ Documentation
- ๐ ๏ธ Tech Stack
- ๐ค Contributing
- ๐ License
-
๐ง Supervisor + SubAgent Architecture: Five-layer intelligent orchestration system
- L1 Input Router (Intent Classification & Slot Extraction)
- L2 Query Optimizer (Coreference Resolution & Query Rewriting)
- L3 Task Planner (DAG-based Task Decomposition)
- L4 Execution Dispatcher (Intelligent Scheduling with Circuit Breaker)
- L5 Security Guard (Permission Intersection & Data Sanitization)
-
๐ค Dual-Layer Agent System:
- Infrastructure Layer: RAG, Skill (Docker Sandbox), File (RealDoc-style), Intent Recognition
- Domain Expert Layer: 6 Business Domain Agents with Skill-driven workflows
-
๐ MCP Integration: Model Context Protocol for external system connectivity
- FileSystem Server, Database Server, Search Server
- Unified client management and cross-server tool invocation
-
๐จ Modern Frontend: React 18 + TypeScript + Vite + TailwindCSS
- Real-time chat interface with streaming support
- Domain selector with 6 business areas
- Responsive design with smooth animations
| Domain Agent | Core Capabilities | Workflows |
|---|---|---|
| ๐ Ecommerce | Product Research, Sourcing Decision, Listing Generation | product_research, sourcing_decision, listing_generation |
| ๐จ Design | Brand Identity, Marketing Asset Creation | branding_solution, marketing_assets |
| ๐ฐ Finance | Financial Analysis, Tax Management, Reporting | monthly_close, quick_analysis |
| ๐ป Developer | Feature Development, Bug Fixing, Code Review, DevOps | feature_development, bugfix_workflow |
| โ๏ธ Content | Article Writing, SEO Optimization, Social Media Batch | article_writing, social_media_batch |
| ๐ง Customer Service | Ticket Resolution, Sentiment Analysis, FAQ Matching | ticket_resolution, feedback_analysis |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ React Frontend (Vite) โ
โ Chat Interface โ Sidebar โ Domain Selector โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HTTP/WebSocket / SSE
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FastAPI Backend (main.py) โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ WukongSupervisor (LangGraph) โ โ
โ โ โ โ
โ โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ โ
โ โ โInput โโโถโQuery โโโถโTask โ โ โ
โ โ โRouter โ โOptimizer โ โPlanner โ โ โ
โ โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโฌโโโโโ โ โ
โ โ โ โ โ
โ โ โโโโโโโโผโโโโโโโ โ โ
โ โ โExecution โ โ โ
โ โ โDispatcher โ โ โ
โ โ โโโโโโโโฌโโโโโโโ โ โ
โ โ โ โ โ
โ โ โโโโโโโโผโโโโโโโ โ โ
โ โ โSecurity โ โ โ
โ โ โGuard โ โ โ
โ โ โโโโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Agent Pool (10 Agents) โ โ
โ โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ Infrastructure Layer (Tools/Capabilities) โ โ โ
โ โ โ โข RAGSubAgent (Hybrid Retrieval + Reranking) โ โ โ
โ โ โ โข SkillSubAgent (Docker Sandbox Execution) โ โ โ
โ โ โ โข FileSubAgent (RealDoc Atomic Operations) โ โ โ
โ โ โ โข IntentSubAgent (3-Tier: RulesโSemanticโLLM) โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ Domain Expert Layer (Business Intelligence) โ โ โ
โ โ โ โข EcommerceDomainAgent โ โ โ
โ โ โ โข DesignDomainAgent โ โ โ
โ โ โ โข FinanceDomainAgent โ โ โ
โ โ โ โข DeveloperDomainAgent โ โ โ
โ โ โ โข ContentDomainAgent โ โ โ
โ โ โ โข CustomerServiceDomainAgent โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ MCP Client (External Systems) โ โ
โ โ FileSystem โ Database (PostgreSQL) โ Search Engine โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ โ
PostgreSQL Redis Milvus MinIO
(Users/Sessions) (Cache/Sessions) (Vector Store) (File Storage)
User Input โ L1 Router (Intent+Slots) โ L2 Optimizer (Rewrite)
โ
L3 Planner (Task DAG) โ L4 Dispatcher (Schedule to Agents)
โ
Domain Agent Execution (Skills + Infrastructure Agents + MCP)
โ
L5 Security Check (PermissionโฉSanitization) โ Response Aggregation
โ
Streaming Output โ Frontend Display
- Python: 3.11+
- Node.js: 18+
- Docker: 20.10+ (for containerized deployment)
- PostgreSQL: 15+ (or use Docker)
- Redis: 7+ (or use Docker)
# Clone the repository
git clone https://github.com/liuyang0508/SupraMAS.git
cd SupraMAS
# Start all services (11 containers)
cd docker
docker-compose -f docker-compose.dev.yml up -d
# Wait for services to be healthy (~30s)
docker-compose ps
# Access the application
open http://localhost:8000 # API Docs: http://localhost:8000/docs
open http://localhost:5173 # Frontend (if running separately)# Navigate to backend directory
cd backend
# Create virtual environment
python3.11 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Start the server
python main.py
# OR with hot-reload:
uvicorn main:app --host 0.0.0.0 --port 8000 --reload# Navigate to frontend directory (new terminal)
cd frontend
# Install dependencies
npm install
# Start development server
npm run dev
# Open browser
open http://localhost:5173pip install -r requirements.txtKey packages:
fastapi- High-performance web frameworklangchain+langgraph- AI/LLM orchestrationpydantic-settings- Configuration managementsqlalchemy+asyncpg- Async database ORMmilvus+pymilvus- Vector database clientsentence-transformers- Embedding models for RAG
npm installKey packages:
react+react-dom- UI framework@tanstack/react-query- Data fetching & cachingzustand- State managementtailwindcss- Utility-first CSSrecharts- Data visualizationlucide-react- Icon library
Create a .env file in the backend/ directory:
# Application Settings
APP_NAME=SupraMAS
APP_VERSION=1.0.0
ENVIRONMENT=development
DEBUG=true
LOG_LEVEL=INFO
# Database (PostgreSQL)
DATABASE_URL=postgresql+asyncpg://supramas:supramas@localhost:5432/supramas
# Cache (Redis)
REDIS_URL=redis://localhost:6379/0
# Vector Database (Milvus)
MILVUS_HOST=localhost
MILVUS_PORT=19530
# Object Storage (MinIO)
MINIO_ENDPOINT=localhost:9000
MINIO_ACCESS_KEY=supramasadmin
MINIO_SECRET_KEY=supramasadmin123
# Message Queue (RabbitMQ)
RABBITMQ_URL=amqp://guest:guest@localhost:5672/
# LLM Configuration
Supports **OpenAI**, **Anthropic**, and **MiniMax** providers.
#### OpenAI (GPT-4)
```env
LLM_PROVIDER=openai
OPENAI_API_KEY=sk-your-key-here
OPENAI_MODEL=gpt-4-turbo-preview
OPENAI_BASE_URL=https://api.openai.com/v1LLM_PROVIDER=minimax
OPENAI_API_KEY=your-minimax-api-key
OPENAI_BASE_URL=https://api.minimax.io/anthropic/v1
OPENAI_MODEL=MiniMax-M2LLM_PROVIDER=anthropic
OPENAI_API_KEY=sk-ant-your-key-here
OPENAI_BASE_URL=https://api.anthropic.com
OPENAI_MODEL=claude-3-5-sonnet-20241022Customize the 5-layer supervisor in backend/main.py:
supervisor_config = {
"input_router": {
"mode": "hybrid", # rule_based | llm_based | hybrid
"confidence_threshold": 0.75
},
"query_optimizer": {
"context_window_size": 20,
"enable_query_expansion": True
},
"task_planner": {
"max_task_depth": 3
},
"dispatcher": {
"scheduling_strategy": "intelligent",
"enable_parallel_execution": True,
"max_parallel_subtasks": 5,
"circuit_breaker_threshold": 5
},
"security": {
"enable_permission_intersection": True,
"enable_data_sanitization": True,
"enable_audit_logging": True
}
}- Product Requirements Document (PRD) - Complete feature specifications
- Technical Design Document - Architecture decisions (ADRs), database schema, API specs
- API Reference - Interactive Swagger/OpenAPI documentation
- Contributing Guide - How to contribute to SupraMAS
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/v1/chat/completions |
Main chat interface (OpenAI-compatible) |
GET |
/health |
Health check |
GET |
/health/ready |
Readiness check with component status |
GET |
/api/v1/agents/status |
List all registered agents with stats |
GET |
/api/v1/domains |
List available business domains (6 total) |
GET |
/api/v1/domains/{name}/info |
Get domain details, workflows, skills |
GET |
/api/v1/skills/installed |
List installed skills via Skill Agent |
GET |
/api/v1/mcp/status |
MCP servers connection status |
GET |
/api/v1/intent/domains |
Intent recognition domain registry |
| Technology | Version | Purpose |
|---|---|---|
| 18.2+ | UI framework | |
| 5.3+ | Type safety | |
| 5.0+ | Build tool | |
| 3.4+ | Styling | |
| 4.4+ | State mgmt | |
| 5.17+ | Data fetching | |
| 2.10+ | Charts |
| Technology | Purpose |
|---|---|
| Containerization | |
| Orchestration | |
| Metrics collection | |
| Visualization | |
| Message queue |
SupraMAS/
โโโ backend/ # FastAPI Python Backend
โ โโโ config/
โ โ โโโ settings.py # Pydantic configuration
โ โโโ core/
โ โ โโโ supervisor/ # 5-Layer Supervisor System
โ โ โ โโโ __init__.py # WukongSupervisor (LangGraph)
โ โ โ โโโ state.py # TypedDict state definitions
โ โ โ โโโ layers/
โ โ โ โโโ input_router.py
โ โ โ โโโ query_optimizer.py
โ โ โ โโโ task_planner.py
โ โ โ โโโ execution_dispatcher.py
โ โ โ โโโ security_guard.py
โ โ โโโ subagents/ # Agent Implementations
โ โ โ โโโ base.py # BaseSubAgent ABC
โ โ โ โโโ intent/ # Intent Recognition Agent
โ โ โ โโโ rag/ # RAG Agent
โ โ โ โโโ skill/ # Skill Execution Agent
โ โ โ โโโ file/ # File Processing Agent
โ โ โ โโโ domain/ # 6 Business Domain Agents
โ โ โ โโโ base.py # BaseDomainAgent
โ โ โ โโโ ecommerce.py
โ โ โ โโโ design.py
โ โ โ โโโ finance.py
โ โ โ โโโ developer.py
โ โ โ โโโ content.py
โ โ โ โโโ customer_service.py
โ โ โโโ mcp/ # MCP Integration Layer
โ โ โโโ __init__.py # Servers + Client
โ โโโ main.py # Application entry point
โ โโโ requirements.txt # Python dependencies
โ
โโโ frontend/ # React TypeScript Frontend
โ โโโ src/
โ โ โโโ components/
โ โ โ โโโ chat/ChatInterface.tsx
โ โ โ โโโ Sidebar.tsx
โ โ โโโ App.tsx
โ โ โโโ main.tsx
โ โ โโโ styles/index.css
โ โโโ package.json
โ โโโ vite.config.ts
โ โโโ tailwind.config.js
โ โโโ tsconfig.json
โ
โโโ docker/ # Container Configurations
โ โโโ Dockerfile # Multi-stage build
โ โโโ docker-compose.dev.yml # Dev environment (11 services)
โ โโโ docker-compose.prod.yml # Production setup
โ โโโ init-db.sql # Database initialization
โ
โโโ k8s/ # Kubernetes Manifests
โ โโโ deployment.yaml # Deployment + HPA + Ingress
โ
โโโ docs/ # Documentation
โ โโโ PRD.md # Product Requirements
โ โโโ Technical_Design.md # Architecture & Design
โ
โโโ README.md # This file
โโโ .gitignore # Git ignore rules
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow PEP 8 for Python code
- Use TypeScript strict mode for frontend
- Write tests for new features (pytest for backend, Jest/Vitest for frontend)
- Update documentation for API changes
- Ensure Docker builds succeed before submitting PR
By participating in this project, you agree to maintain a respectful and inclusive environment.
- Total Lines of Code: ~9,500+ (Backend: ~8,000 | Frontend: ~1,500)
- Python Files: 40+ modules
- React Components: 5 core components
- API Endpoints: 10+ RESTful endpoints
- Domain Agents: 6 business experts
- Infrastructure Agents: 4 capability providers
- Docker Services: 11 containerized services
- Documentation Pages: 1,650+ lines (PRD + Tech Design)
- Inspired by Alibaba DingTalk Wukong platform architecture
- Built on LangChain/LangGraph ecosystem
- Powered by FastAPI performance
- Enhanced by React modern UX patterns
This project is licensed under the MIT License - see the LICENSE file for details.
- GitHub Issues: Report bugs or request features
- Discussions: Join community discussions
โญ If this project helped you, please give it a star! โญ
Made with โค๏ธ by the SupraMAS Team