Skip to content

ZhanlinCui/Multi-Agent-Supervision-System

Β 
Β 

Repository files navigation

SuperAI Watch πŸ€–

SuperAI Logo

Enterprise-grade AI Agent Operations Platform for Monitoring, Diagnostics, and Self-healing

Live Demo β€’ Documentation β€’ Features β€’ Tech Stack


πŸ“– Overview

SuperAI is a next-generation AI operations platform that monitors, diagnoses, and automatically repairs AI agents in real-time. Built for the modern AI-first enterprise, SuperAI ensures your AI agents never go dark with autonomous health monitoring, intelligent diagnostics, and self-healing capabilities.

The Problem

AI agents are growing fast, but they break silently:

  • πŸ”΄ Silent Failures - Agent timeouts and degraded performance go unnoticed
  • ⏱️ Manual Debugging - Hours wasted troubleshooting AI-specific issues
  • πŸ’Έ Revenue Impact - Undetected failures cost time, trust, and money

The Solution

SuperAI provides:

  • βœ… Instant Detection - AI-powered monitoring detects issues in seconds
  • πŸ” Root Cause Analysis - Automated diagnosis identifies the exact problem
  • πŸ”§ Self-Healing - Autonomous remediation with zero downtime
  • πŸ“Š Full Visibility - Real-time dashboards and performance analytics

✨ Features

πŸ€– AI Agent Management

  • Agent Health Grid - Visual dashboard showing real-time status of all AI agents
  • Performance Monitoring - Track success rates, response times, and uptime
  • Agent Configuration - Manage models, data sources, and response styles
  • Custom Metrics - Define and track custom KPIs for each agent

🚨 Intelligent Incident Management

  • Automatic Detection - ML-powered anomaly detection for AI-specific issues
  • Root Cause Analysis - Deep diagnostics to identify exact failure points
  • Proposed Fixes - AI-generated remediation plans with confidence scores
  • Incident Timeline - Complete audit trail of detection, diagnosis, and recovery

πŸ”„ Self-Healing Automation

  • Auto-Remediation - Execute approved fixes without human intervention
  • Validation Testing - Run comprehensive tests before deploying fixes
  • Rollback Support - Automatic rollback if fixes don't resolve issues
  • Semi-Autonomous Mode - Human-in-the-loop for critical decisions

πŸ“Š Analytics & Insights

  • Performance Trends - Historical charts showing agent health over time
  • System Health Score - Overall platform health rating (0-10)
  • Activity Feed - Real-time supervisor actions and system events
  • Custom Reports - Generate detailed reports on agent performance

🎬 Interactive Demo

  • Live Simulation - See self-healing in action with realistic scenarios
  • Step-by-Step Walkthrough - Understand detection, diagnosis, and recovery phases
  • Real-Time Logs - Watch the supervisor AI work through issues

πŸ› οΈ Tech Stack

Frontend

  • React 18.3+ - Modern UI framework with hooks
  • TypeScript - Type-safe development
  • Vite - Lightning-fast build tool
  • TailwindCSS - Utility-first styling with custom design tokens
  • Radix UI - Headless UI primitives
  • shadcn/ui - Beautiful, accessible component library
  • TanStack Query v5 - Powerful data synchronization
  • React Router v6 - Client-side routing
  • Recharts - Data visualization
  • Lucide React - Icon library
  • Embla Carousel - Touch-friendly carousels
  • React Hook Form - Form validation and handling

Backend & Infrastructure

  • Supabase
    • PostgreSQL database
    • Real-time subscriptions
    • Edge Functions
    • Authentication
    • File Storage
    • Row Level Security
  • Serverless Architecture - Scalable backend logic
  • WebSocket - Real-time data streaming

AI & Integrations

  • Grok (x.ai API) - Intelligent diagnostics
  • Relevance AI - Agent orchestration
  • Custom AI Pipelines - Proprietary analysis engine
  • AI Supervisor - Automated decision making

πŸš€ Getting Started

Prerequisites

  • Node.js (v18 or higher) - Install with nvm
  • npm or yarn package manager
  • Git for version control

Installation

  1. Clone the repository
git clone <YOUR_GIT_URL>
cd <YOUR_PROJECT_NAME>
  1. Install dependencies
npm install
# or
yarn install
  1. Set up environment variables

The .env file is auto-configured by Lovable Cloud and includes:

VITE_SUPABASE_URL=<your-supabase-url>
VITE_SUPABASE_PUBLISHABLE_KEY=<your-publishable-key>
VITE_SUPABASE_PROJECT_ID=<your-project-id>
  1. Start the development server
npm run dev
  1. Open your browser The application will be available at the URL shown in your terminal (typically http://localhost:5173)

πŸ“ Project Structure

superai/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/          # React components
β”‚   β”‚   β”œβ”€β”€ landing/        # Landing page sections
β”‚   β”‚   β”‚   β”œβ”€β”€ HeroSection.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ProblemVisionSection.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ LiveSimulation.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ FeaturesSection.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ImpactSection.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ArchitectureSection.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ TeamSection.tsx
β”‚   β”‚   β”‚   └── Footer.tsx
β”‚   β”‚   β”œβ”€β”€ ui/             # shadcn/ui components
β”‚   β”‚   β”œβ”€β”€ AgentCard.tsx   # Agent status card
β”‚   β”‚   β”œβ”€β”€ AgentDetailsModal.tsx
β”‚   β”‚   β”œβ”€β”€ IncidentModal.tsx
β”‚   β”‚   β”œβ”€β”€ SelfHealingModal.tsx
β”‚   β”‚   β”œβ”€β”€ LogTerminal.tsx
β”‚   β”‚   β”œβ”€β”€ Navigation.tsx
β”‚   β”‚   β”œβ”€β”€ StatusBadge.tsx
β”‚   β”‚   └── SupervisorFeed.tsx
β”‚   β”œβ”€β”€ pages/              # Page components
β”‚   β”‚   β”œβ”€β”€ Landing.tsx     # Landing page
β”‚   β”‚   β”œβ”€β”€ Index.tsx       # Dashboard (main app)
β”‚   β”‚   β”œβ”€β”€ Agents.tsx      # Agents management
β”‚   β”‚   β”œβ”€β”€ Analytics.tsx   # Analytics view
β”‚   β”‚   β”œβ”€β”€ Incidents.tsx   # Incidents list
β”‚   β”‚   β”œβ”€β”€ Settings.tsx    # Settings page
β”‚   β”‚   └── CreateAgent.tsx # Create new agent
β”‚   β”œβ”€β”€ hooks/              # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ useAgents.tsx   # Agent CRUD operations
β”‚   β”‚   β”œβ”€β”€ useRelevanceAgents.tsx
β”‚   β”‚   └── useAISupervisor.tsx
β”‚   β”œβ”€β”€ data/               # Mock data
β”‚   β”‚   β”œβ”€β”€ mockData.ts
β”‚   β”‚   └── extendedMockData.ts
β”‚   β”œβ”€β”€ types/              # TypeScript types
β”‚   β”‚   └── agent.ts
β”‚   β”œβ”€β”€ integrations/       # External integrations
β”‚   β”‚   └── supabase/
β”‚   β”‚       β”œβ”€β”€ client.ts   # Supabase client
β”‚   β”‚       └── types.ts    # Auto-generated types
β”‚   β”œβ”€β”€ lib/                # Utility functions
β”‚   β”‚   └── utils.ts
β”‚   β”œβ”€β”€ App.tsx             # Main app component
β”‚   β”œβ”€β”€ main.tsx            # Entry point
β”‚   └── index.css           # Global styles & design system
β”œβ”€β”€ supabase/
β”‚   β”œβ”€β”€ functions/          # Edge Functions
β”‚   β”‚   β”œβ”€β”€ relevance-agents/
β”‚   β”‚   └── supervisor-diagnose/
β”‚   └── config.toml         # Supabase configuration
β”œβ”€β”€ public/                 # Static assets
β”œβ”€β”€ index.html              # HTML template
β”œβ”€β”€ tailwind.config.ts      # Tailwind configuration
β”œβ”€β”€ vite.config.ts          # Vite configuration
└── package.json            # Dependencies

πŸ—„οΈ Database Schema

Tables

agents

Stores AI agent configurations and metadata

- id (uuid, primary key)
- name (text, not null)
- icon (text)
- status (text) - 'healthy' | 'warning' | 'failed'
- description (text, not null)
- category (text)
- model (text)
- data_source (text)
- response_style (text)
- success_rate (numeric)
- uptime (numeric)
- avg_response_time (integer)
- total_requests (integer)
- last_issue (text)
- version (text)
- goal_metric (text)
- alert_sensitivity (text)
- owner (text)
- fix_permissions (text)
- self_monitoring (boolean)
- configuration (jsonb)
- created_at (timestamp)
- updated_at (timestamp)

incidents

Tracks detected issues and their resolution

- id (uuid, primary key)
- agent_id (uuid)
- agent_name (text, not null)
- title (text, not null)
- description (text)
- severity (text) - 'low' | 'medium' | 'high' | 'critical'
- status (text) - 'open' | 'resolving' | 'resolved'
- impact (text)
- root_cause (text)
- proposed_fix (jsonb)
- confidence (numeric)
- logs (jsonb)
- detected_at (timestamp)
- resolved_at (timestamp)

performance_data

Historical performance metrics for agents

- id (uuid, primary key)
- agent_id (uuid)
- success_rate (numeric)
- response_time (integer)
- requests (integer)
- timestamp (timestamp)

activity_logs

Audit trail of supervisor actions

- id (uuid, primary key)
- agent_id (uuid)
- action (text, not null)
- status (text) - 'success' | 'failed' | 'pending'
- details (text)
- timestamp (timestamp)

Edge Functions

relevance-agents

Fetches and synchronizes agents from Relevance AI platform

supervisor-diagnose

AI-powered diagnostic analysis for incident root cause identification


🎨 Design System

SuperAI uses a comprehensive design system with semantic tokens:

Color Palette

  • Primary - Midnight Blue (hsl(220 85% 16%))
  • Accent - Electric Cyan (hsl(185 100% 52%))
  • Purple - Neon Purple (hsl(280 95% 62%))
  • Success - Green (hsl(142 76% 48%))
  • Warning - Amber (hsl(38 95% 52%))
  • Destructive - Red (hsl(0 88% 62%))

Visual Effects

  • Glassmorphism - Frosted glass UI elements
  • Glow Effects - Cyan and purple neon glows
  • Animations - Smooth transitions and micro-interactions
  • Gradients - Multi-layer gradient overlays
  • Shadows - Cinematic elevation shadows

Typography

  • Headings - Large, bold, with gradient text effects
  • Body - Clean, readable with proper hierarchy
  • Mono - Terminal-style for logs and code

πŸ” Security

Database Security

  • Row Level Security (RLS) enabled on all tables
  • Public read access for demonstration purposes
  • Authenticated writes for production environments

Environment Variables

  • All sensitive keys stored in Supabase secrets
  • No hardcoded credentials in source code
  • Automatic injection via Lovable Cloud

API Security

  • Edge Functions use service role keys
  • CORS configured for allowed origins
  • Rate limiting on external API calls

🚒 Deployment

Production Build

  1. Create a production build:
npm run build
  1. Preview the production build:
npm run preview

Deployment

The app can be deployed to any static hosting provider that supports modern web applications:

Vercel

npm run build
vercel --prod

Netlify

npm run build
netlify deploy --prod --dir=dist

Make sure to configure your environment variables in your hosting provider's dashboard.


πŸ§ͺ Development

Running Tests

npm run test

Code Linting

npm run lint

Type Checking

npm run type-check

Building for Production

npm run build

πŸ“š Documentation

Key Concepts

Agent - An AI system being monitored (chatbot, analytics engine, etc.)

Supervisor - The AI that monitors and manages other agents

Incident - A detected issue with an agent requiring attention

Self-Healing - Automated remediation without human intervention

Performance History - Time-series data showing agent health trends

API Reference

Supabase Queries

Fetch all agents

const { data: agents } = await supabase
  .from("agents")
  .select("*")
  .order("created_at", { ascending: false });

Create incident

const { data: incident } = await supabase
  .from("incidents")
  .insert({
    agent_id: "uuid",
    agent_name: "Chat Agent",
    title: "High error rate detected",
    severity: "high",
    status: "open",
  })
  .select()
  .single();

Update agent status

const { data } = await supabase
  .from("agents")
  .update({ status: "healthy", success_rate: 97 })
  .eq("id", agentId);

🀝 Contributing

We welcome contributions! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Coding Standards

  • Use TypeScript for type safety
  • Follow the existing component structure
  • Use semantic variable names
  • Add comments for complex logic
  • Ensure responsive design
  • Test on multiple browsers

πŸ› Troubleshooting

Common Issues

Build Errors

  • Ensure Node.js version is 18+
  • Clear node_modules and reinstall: rm -rf node_modules && npm install
  • Check for TypeScript errors: npm run type-check

Database Connection Issues

  • Verify .env file has correct Supabase credentials
  • Check network connectivity to Supabase
  • Ensure RLS policies are configured correctly

Agent Not Updating

  • Check browser console for errors
  • Verify agent ID is valid UUID format
  • Ensure database permissions are correct

For more help, see the Lovable Troubleshooting Guide.


πŸ—ΊοΈ Roadmap

  • Real-time WebSocket updates for live agent monitoring
  • Advanced ML models for predictive failure detection
  • Multi-tenant support with organization management
  • Custom alert channels (Slack, PagerDuty, etc.)
  • Agent marketplace for pre-built configurations
  • API endpoints for third-party integrations
  • Mobile app for on-the-go monitoring
  • Advanced cost tracking and optimization

πŸ“„ License

This project is built with Lovable and is available for demonstration and educational purposes.


πŸ™ Acknowledgments

  • Supabase - For the powerful backend infrastructure
  • shadcn/ui - For the beautiful component library
  • Tailwind CSS - For the utility-first styling system
  • Radix UI - For accessible UI primitives
  • Relevance AI - For agent integration capabilities
  • x.ai - For Grok AI integration

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 95.9%
  • CSS 2.3%
  • PLpgSQL 1.3%
  • Other 0.5%