Skip to content

Nova-Stark/AstraGuard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏙️ AstraGuard: Smart City Agentic AI

AstraGuard is an intelligent "Edge-to-Agent" system designed for high-throughput IoT data ingestion and AI-driven incident orchestration in smart cities.


🏗️ Architecture Overview

The system is split into four distinct phases to handle city-scale telemetry without over-relying on expensive LLM calls:

  1. Phase 1: Ingestion & Simulation (Simulated Power, Traffic, and Env sensors via NGINX).
  2. Phase 2: Edge ML Workers (Unsupervised Anomaly Detection using Isolation Forests).
  3. Phase 3: Agentic Orchestrator (Context synthesis and LLM-driven incident reporting).
  4. Phase 4: Human-in-the-Loop (Response Dashboard for city officials).

🔌 API Reference (Data Formats & Structures)

🚀 NGINX Gateway (Entry Point)

  • Host: http://localhost:8080
  • Routes: /api/traffic, /api/power, /api/environment

1. 🚗 Traffic Edge Worker

  • Port: 5000 | Endpoint: /api/traffic

POST (Input from Sensors)

{
    "timestamp": "ISO-8601",
    "sensor_type": "traffic_flow",
    "location": "Intersection_Main_St",
    "cars_per_minute": 45,
    "avg_speed_kmh": 42.5
}

GET (Output for UI Dashboard)

{
    "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
    }
}

2. ⚡ Power Grid Edge Worker

  • Port: 5001 | Endpoint: /api/power

POST (Input from Sensors)

{
    "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"
}

GET (Output for UI Dashboard)

{
    "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"
    }
}

3. ☣️ Environment Edge Worker

  • Port: 5002 | Endpoint: /api/environment

POST (Input from Sensors)

{
    "timestamp": "ISO-8601",
    "sensor_type": "air_quality_node",
    "zone": "City Center",
    "aqi_level": 42,
    "voc_ppm": 0.12
}

GET (Output for UI Dashboard)

{
    "status": "live",
    "ml_active": true,
    "data": {
        "timestamp": "ISO-8601",
        "zone": "City Center",
        "aqi_level": 42,
        "voc_ppm": 0.12
    }
}

🧠 4. Agentic Orchestrator

  • Port: 8000

GET /api/latest-incident (AI Synthesis for UI)

{
  "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"]
  }
}

🛠️ Internal Data Contracts (Orchestrator Handoff)

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors