AstraGuard is an intelligent "Edge-to-Agent" system designed for high-throughput IoT data ingestion and AI-driven incident orchestration in smart cities.
The system is split into four distinct phases to handle city-scale telemetry without over-relying on expensive LLM calls:
- Phase 1: Ingestion & Simulation (Simulated Power, Traffic, and Env sensors via NGINX).
- Phase 2: Edge ML Workers (Unsupervised Anomaly Detection using Isolation Forests).
- Phase 3: Agentic Orchestrator (Context synthesis and LLM-driven incident reporting).
- Phase 4: Human-in-the-Loop (Response Dashboard for city officials).
- Host:
http://localhost:8080 - Routes:
/api/traffic,/api/power,/api/environment
- Port:
5000| Endpoint:/api/traffic
{
"timestamp": "ISO-8601",
"sensor_type": "traffic_flow",
"location": "Intersection_Main_St",
"cars_per_minute": 45,
"avg_speed_kmh": 42.5
}{
"status": "live",
"ml_active": true,
"data": {
"timestamp": "ISO-8601",
"sensor_type": "traffic_flow",
"location": "Intersection_Main_St",
"cars_per_minute": 45,
"avg_speed_kmh": 42.5
}
}- Port:
5001| Endpoint:/api/power
{
"timestamp": "ISO-8601",
"sensor_type": "substation_monitor",
"location": "Substation_A",
"load_mw": 52.4,
"transformer_temp_c": 68.2,
"voltage_kv": 11.0,
"power_status": "ON"
}{
"status": "live",
"ml_active": true,
"data": {
"timestamp": "ISO-8601",
"location": "Substation_A",
"load_mw": 52.4,
"transformer_temp_c": 68.2,
"voltage_kv": 11.0,
"power_status": "ON"
}
}- Port:
5002| Endpoint:/api/environment
{
"timestamp": "ISO-8601",
"sensor_type": "air_quality_node",
"zone": "City Center",
"aqi_level": 42,
"voc_ppm": 0.12
}{
"status": "live",
"ml_active": true,
"data": {
"timestamp": "ISO-8601",
"zone": "City Center",
"aqi_level": 42,
"voc_ppm": 0.12
}
}- Port:
8000
{
"status": "active_incident",
"report": {
"incident_title": "Short descriptive title",
"severity_level": "CRITICAL | HIGH | MODERATE",
"root_cause_analysis": "1-2 sentences explaining the root event.",
"recommended_actions": ["Action 1", "Action 2"]
}
}When an anomaly is detected, workers POST to http://orchestrator:8000/api/orchestrate:
| Field | Description |
|---|---|
source_worker |
The sensor type (traffic_flow, substation_monitor, etc.) |
trigger_reason |
Human-readable reason for the alert. |
trigger_data |
The specific JSON record that failed the ML check. |
historical_context |
A list of the last 100 records for baseline synthesis. |