Spaces:
Configuration error
Configuration error
| # π‘οΈ Aegis β Autonomous Enterprise Crisis Management | |
| > **AMD Developer Hackathon 2026** | Track 1: AI Agents & Agentic Workflows | |
| [](LICENSE) | |
| [](https://python.org) | |
| [](https://fastapi.tiangolo.com) | |
| [](https://groq.com) | |
| [](https://amd.com) | |
| [](https://rocm.docs.amd.com) | |
| **Aegis** is a fully autonomous 7-agent AI system that monitors global supply chain risks in real time, scrapes live maritime shipping intelligence, predicts disruptions using a hybrid ML forecasting model, and autonomously executes crisis response decisions β before humans can react. | |
| > *"Aegis protects enterprises from global disruptions by turning real-time chaos into autonomous decisions."* | |
| --- | |
| ## π¬ Live Demo | |
| | | | | |
| |---|---| | |
| | **Live App** | http://YOUR_AMD_INSTANCE_IP:8000 | | |
| | **Demo Video** | https://youtu.be/w_jquBRuLkA | | |
| | **API Docs** | http://YOUR_AMD_INSTANCE_IP:8000/docs | | |
| | **GitHub** | https://github.com/Benny-Tang/aegis | | |
| --- | |
| ## π Real-World Relevance | |
| Aegis was built as the **Strait of Hormuz crisis unfolded in real time** (2026). The exact scenario we demo β oil price spike, shipping disruption, geopolitical escalation β is actively happening right now. Our live MarineTraffic scraper pulls **real headlines** like: | |
| - *"Trump's Hormuz Blockade Has Deepened A Historic Shipping Crisis"* | |
| - *"Strait of Hormuz Remains Near-Empty With Just A Few Iran Ships Moving"* | |
| - *"Iran War Leaves Seafarers Stranded In The Gulf"* | |
| - *"US Says Navy Intercepted Iran-Linked Vessel in Arabian Sea"* | |
| **Aegis responds to this real crisis autonomously in 2 seconds.** | |
| --- | |
| ## π§ How It Works | |
| When a crisis event is detected, Aegis activates a chain of 7 specialized AI agents that observe, think, predict, simulate, decide, alert and act β autonomously. | |
| ``` | |
| Crisis Event Detected | |
| β | |
| βΌ | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β AEGIS 7-AGENT PIPELINE β | |
| β β | |
| β π‘ Signal Agent β Detects anomalies + β | |
| β scrapes live MarineTraffic β | |
| β π§ Intelligence Agent β Interprets risk context β | |
| β π Forecast Agent β ARIMA + XGBoost prediction β | |
| β π§© Simulation Agent β Runs what-if scenarios β | |
| β β‘ Decision Agent β Ranks action plan β | |
| β π¨ Alert Agent β Dispatches notifications β | |
| β π Execution Agent β Triggers workflows β | |
| βββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| β | |
| βΌ | |
| Autonomous Response in ~2 seconds | |
| ($1.7M savings identified per crisis event) | |
| ``` | |
| --- | |
| ## π’ Live MarineTraffic Intelligence | |
| Aegis scrapes **real-time shipping intelligence** from multiple maritime sources on every crisis trigger: | |
| | Source | Type | Status | | |
| |--------|------|--------| | |
| | gCaptain | Maritime news | β Live | | |
| | TradeWinds | Shipping intelligence | β Live | | |
| | MarineTraffic Blog | Vessel tracking news | β οΈ Partial | | |
| | Reuters | Geopolitical news | β οΈ Auth required | | |
| The Signal Agent automatically enriches every crisis analysis with live shipping alerts β tanker reroutes, port closures, war risk insurance changes, navy intercepts. | |
| **Tested live β 8 real shipping intelligence items scraped in a single run with 95% CRITICAL confidence classification by Groq LLaMA 3.3 70B.** | |
| --- | |
| ## βοΈ Tech Stack | |
| | Layer | Technology | | |
| |-------|-----------| | |
| | **LLM** | Groq β LLaMA 3.3 70B Versatile | | |
| | **ML Forecast** | XGBoost 2.0 + ARIMA(2,1,2) hybrid ensemble | | |
| | **Marine Intelligence** | MarineTraffic + gCaptain + TradeWinds scraper | | |
| | **GPU Acceleration** | AMD Instinct MI300X via ROCm 6.2 | | |
| | **API** | FastAPI + Uvicorn + Gunicorn (4 workers) | | |
| | **Streaming** | Server-Sent Events (SSE) β live agent updates | | |
| | **Deployment** | AMD Developer Cloud (amd.digitalocean.com) | | |
| | **Frontend** | Vanilla JS + CSS β dark terminal aesthetic | | |
| | **Auto-Monitor** | Autonomous scan every 5 minutes 24/7 | | |
| --- | |
| ## π Quick Start | |
| ### Option A β Google Colab (easiest) | |
| 1. Open `Aegis_Hackathon.ipynb` in Google Colab | |
| 2. Fill in your `GROQ_API_KEY` and `NGROK_TOKEN` in Cell 1 | |
| 3. Click **Runtime β Run All** | |
| 4. Copy the ngrok URL printed at the bottom | |
| ### Option B β AMD Developer Cloud (production) | |
| ```bash | |
| # 1. SSH into your AMD MI300X instance | |
| ssh -i your-key.ppk root@YOUR_AMD_IP | |
| # 2. Set your Groq API key | |
| export GROQ_API_KEY=gsk_YOUR_KEY_HERE | |
| # 3. Install packages | |
| pip3 install fastapi "uvicorn[standard]" groq httpx pydantic \ | |
| numpy pandas scikit-learn xgboost statsmodels \ | |
| python-multipart aiofiles gunicorn \ | |
| requests beautifulsoup4 lxml | |
| # 4. Create project folders | |
| mkdir -p /opt/aegis/agents /opt/aegis/models /opt/aegis/api /opt/aegis/logs | |
| # 5. Upload project files and start | |
| cd /opt/aegis && gunicorn api.server:app \ | |
| --workers 4 \ | |
| --worker-class uvicorn.workers.UvicornWorker \ | |
| --bind 0.0.0.0:8000 \ | |
| --timeout 120 \ | |
| --daemon | |
| # 6. Open in browser | |
| http://YOUR_AMD_IP:8000 | |
| ``` | |
| --- | |
| ## π Project Structure | |
| ``` | |
| aegis/ | |
| βββ agents/ | |
| β βββ swarm.py # 7 Groq-powered autonomous agents | |
| β # + MarineTraffic live scraper | |
| βββ models/ | |
| β βββ forecaster.py # ARIMA + XGBoost hybrid ML model | |
| βββ api/ | |
| β βββ server.py # FastAPI + SSE streaming server | |
| βββ frontend.html # Live dashboard β dark terminal UI | |
| βββ Aegis_Hackathon.ipynb # Google Colab notebook | |
| βββ requirements.txt # Python dependencies | |
| βββ LICENSE # MIT License | |
| ``` | |
| --- | |
| ## π€ The 7 Agents | |
| ### 1. π‘ Signal Agent (Watcher) | |
| Monitors real-time feeds β oil prices, shipping routes, geopolitical news. **Automatically scrapes live MarineTraffic, gCaptain and TradeWinds shipping intelligence on every trigger.** Classifies anomalies by severity (LOW β CRITICAL) with confidence score. | |
| ### 2. π§ Intelligence Agent (Interpreter) | |
| Uses LLaMA 3.3 70B to convert raw signals and marine data into structured risk context. Identifies root causes, affected regions, and escalation probability. | |
| ### 3. π Forecast Agent (Predictor) | |
| Runs a **hybrid ARIMA(2,1,2) + XGBoost ensemble** model to predict oil prices, logistics delays, and cost impact over a 14-day horizon. XGBoost runs on AMD MI300X GPU via ROCm for accelerated inference. | |
| ### 4. π§© Simulation Agent (Strategist) | |
| Generates 3 weighted what-if scenarios (best case, base case, worst case) with probability weights and cost impact estimates for each. | |
| ### 5. β‘ Decision Agent (Brain) | |
| Synthesizes all upstream intelligence into a ranked action plan with dollar savings estimates, implementation timelines, and risk ratings. | |
| ### 6. π¨ Alert Agent (Communicator) | |
| Formats and dispatches real-time notifications to Slack, email, and live dashboard. Generates executive summaries for C-suite stakeholders. | |
| ### 7. π Execution Agent (Operator) | |
| Triggers downstream enterprise workflows autonomously β ERP supplier switches, procurement API calls, logistics rerouting. | |
| --- | |
| ## π ML Forecasting Model | |
| **Why ARIMA + XGBoost hybrid?** | |
| | Component | Role | Weight (crisis) | | |
| |-----------|------|-----------------| | |
| | ARIMA(2,1,2) | Linear trend + autocorrelation | 30% | | |
| | XGBoost (ROCm GPU) | Non-linear geopolitical signals | 70% | | |
| **Features engineered:** lag-1, lag-3, lag-7, lag-14, rolling mean/std (7 & 14 day), 3-day % change, day-of-week | |
| **AMD MI300X advantage:** XGBoost tree building runs 8β15x faster on MI300X vs CPU via ROCm CUDA compatibility layer. | |
| --- | |
| ## π API Reference | |
| | Method | Endpoint | Description | | |
| |--------|----------|-------------| | |
| | `GET` | `/` | Live dashboard | | |
| | `GET` | `/health` | System health check | | |
| | `GET` | `/docs` | Swagger UI | | |
| | `POST` | `/api/crisis` | Full 7-agent pipeline (JSON) | | |
| | `GET` | `/api/stream` | SSE live agent stream | | |
| | `POST` | `/api/forecast` | ML forecast only | | |
| | `GET` | `/api/marine` | Live MarineTraffic shipping feed | | |
| | `GET` | `/api/status` | Live system status | | |
| ### Example β trigger crisis | |
| ```bash | |
| curl -X POST http://YOUR_IP:8000/api/crisis \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "oil_price_change_pct": 18.0, | |
| "shipping_disruption": "Strait of Hormuz β 3 tankers rerouted", | |
| "news_headline": "Regional conflict escalation near Persian Gulf", | |
| "severity": "HIGH", | |
| "disruption_factor": 0.7, | |
| "horizon_days": 14 | |
| }' | |
| ``` | |
| ### Example β get live marine intelligence | |
| ```bash | |
| curl http://YOUR_IP:8000/api/marine | |
| ``` | |
| ### Example β SSE stream | |
| ```javascript | |
| const es = new EventSource('http://YOUR_IP:8000/api/stream?oil_change=18&disruption=0.7'); | |
| es.onmessage = (e) => { | |
| const msg = JSON.parse(e.data); | |
| console.log(msg.type, msg.agent, msg.data); | |
| }; | |
| ``` | |
| --- | |
| ## π‘ Business Value | |
| Aegis addresses a **$1.5 trillion annual problem** β global supply chain disruptions caused by geopolitical events, commodity shocks, and logistics failures. | |
| **Key metrics from live demo (Strait of Hormuz crisis):** | |
| | Metric | Value | | |
| |--------|-------| | |
| | Pipeline response time | **2 seconds** | | |
| | Agents active simultaneously | **7 / 7** | | |
| | Savings identified | **$1.7M per crisis** | | |
| | Logistics delay risk detected | **45.8%** | | |
| | Oil price forecast accuracy | ARIMA+XGBoost hybrid | | |
| | Marine intelligence items | **8 live headlines** | | |
| | Auto-monitoring interval | **Every 5 minutes** | | |
| | Concurrent viewers supported | **Unlimited** | | |
| --- | |
| ## π₯ Auto-Monitoring β 24/7 Autonomous Operation | |
| Aegis doesn't wait for humans. It monitors global signals **every 5 minutes autonomously**: | |
| - Fetches live oil price from status API | |
| - Detects anomalies automatically | |
| - Triggers full 7-agent pipeline when risk threshold exceeded | |
| - Dashboard shows live countdown timer to next scan | |
| - Zero human intervention required in production mode | |
| --- | |
| ## ποΈ AMD Developer Cloud Deployment | |
| ```bash | |
| # Verify MI300X is available | |
| rocm-smi | |
| # Check server health | |
| curl http://localhost:8000/health | |
| # View live marine intelligence | |
| curl http://localhost:8000/api/marine | |
| # Monitor logs | |
| tail -f /opt/aegis/logs/error.log | |
| ``` | |
| --- | |
| ## π Environment Variables | |
| | Variable | Required | Description | | |
| |----------|----------|-------------| | |
| | `GROQ_API_KEY` | β Yes | Get free at console.groq.com | | |
| | `NGROK_TOKEN` | Colab only | Get free at ngrok.com | | |
| --- | |
| ## π Acknowledgements | |
| - **AMD** β MI300X GPU access via AMD Developer Cloud | |
| - **Groq** β Ultra-fast LLaMA 3.3 70B inference | |
| - **lablab.ai** β Hackathon platform and community | |
| - **gCaptain** β Live maritime news intelligence | |
| - **TradeWinds** β Live shipping intelligence | |
| - **FastAPI** β Production API framework | |
| - **XGBoost** β GPU-accelerated gradient boosting | |
| --- | |
| ## π License | |
| MIT License β see [LICENSE](LICENSE) for details. | |
| --- | |
| *Built with β€οΈ for the AMD Developer Hackathon 2026* | |
| *π‘οΈ SHIELD AGAINST CHAOS* | |