A multi-agent AI system where four specialized agents collaborate to detect, diagnose, and solve operational problems in real-time.
This system simulates an Operations War Room where AI agents work together like a team of specialists:
| Agent | Role | What It Does |
|---|---|---|
| Coordinator | Session Leader | Orchestrates the session, prioritizes issues, synthesizes findings |
| Monitor | Early Warning | Scans KPIs, calculates health scores, detects anomalies |
| Analyst | Detective | Deep-dives into anomalies, examines patterns, finds root causes |
| Strategist | Advisor | Proposes solutions with cost/benefit estimates |
- Multi-agent orchestration: Coordinator routes tasks to specialized agents
- Statistical anomaly detection: Compares metrics against baseline using z-score approach
- Pattern-based root cause analysis: Matches data patterns to known problem categories
- Actionable recommendations: 3-tier solutions (immediate / short-term / long-term)
- Professional PDF report: Charts, findings, recommendations, and full agent conversation log
- Two modes: Rule-based (offline) and AI-powered (Google Gemini)
# Install dependencies
pip install -r requirements.txt
# Generate data with anomalies
python data_generator.py
# Run the war room
python main.pyCheck results in:
reports/war_room_report.pdf(full report)charts/folder (4 PNG charts)
The data generator injects realistic problems that the agents must detect:
# See all scenarios
python data_generator.py --list
# Default: mixed anomalies across different months
python data_generator.py --scenario mixed
# Staffing shortage across departments
python data_generator.py --scenario staffing-crisis
# Supply chain quality issues cascade
python data_generator.py --scenario quality-crisis
# Progressive IT system degradation
python data_generator.py --scenario system-failureGet a free API key at https://aistudio.google.com/apikey, then:
export GEMINI_API_KEY=your-key-here
python main.py --with-aiAI mode adds natural language insights on top of the data analysis. The system works fully without AI using rule-based logic.
1. COORDINATOR: "Monitor Agent, begin your scan."
2. MONITOR: Scans 8,400 records, finds 3 anomalies
3. COORDINATOR: "Analyst, investigate the critical anomaly."
4. ANALYST: Deep-dives into data, finds root cause
5. COORDINATOR: "Strategist, propose solutions."
6. STRATEGIST: Recommends immediate, short-term, long-term actions
7. COORDINATOR: Synthesizes executive summary with action plan
multi-agent-operations/
├── main.py # Entry point - runs the war room session
├── agents.py # 4 agent definitions (Coordinator, Monitor, Analyst, Strategist)
├── kpi_engine.py # KPI calculations and anomaly detection
├── data_generator.py # Generate data with intentional anomalies
├── report_generator.py # PDF report and chart generation
├── requirements.txt # Python dependencies
├── data/ # Generated data files
├── charts/ # Generated charts (4 PNG files)
└── reports/ # Generated PDF report
- Python - Core language
- pandas / numpy - Data analysis and statistical calculations
- matplotlib / seaborn - Chart generation
- fpdf2 - PDF report generation
- scikit-learn - (available for future ML extensions)
- Google Gemini API - Optional AI-powered insights (free tier)
Leo - AI Engineering Portfolio Project