How iamkk369/ecogaurdmonitor works
EcoGuardAI is a prototype for industrial air and water pollution monitoring. Its main workflow accepts simulated or REST/MQTT sensor readings, evaluates them through an event-driven agent system, and exposes violations, alerts, health assessments, and live dashboard updates. The graph also preserves the documented AI, persistence, and monitoring capabilities. Some connections rely on README descriptions or SOURCE INDEX references; unsampled implementation details are not inferred beyond those references.
Main entry points: orchestrator.py Agent Orchestrator · main.py FastAPI Application · database.py PostgreSQL Database · monitoring.py Monitoring API
Components 23
Ingestion and API
- Sensor Simulator
scripts/simulate_sensors.py - Sensor Ingestion
core/data_ingestion.py - FastAPI Application
api/main.py - Monitoring API
api/routes/monitoring.py - API Middleware
api/middleware.py
Monitoring Agents
- Agent Orchestrator
core/orchestrator.py - Agent Interface
agents/base_agent.py - Emission Monitoring
agents/emission_agent.py - Violation Detection
agents/violation_agent.py
Analysis and Alerts
- Health Risk Assessment
agents/health_agent.py - Granite Analysis
core/ibm_granite.py - IBM Cloud Integration
core/ibm_cloud.py - Regulatory Alerts
agents/alert_agent.py
Persistence
- Event Persistence
services/persistence.py - PostgreSQL Database
core/database.py - Reading and Station Models
models/sensor_reading.py - Violation Model
models/violation.py - Alert Model
models/alert.py
Dashboard and Access
- Dashboard Aggregation
agents/dashboard_agent.py - Live Dashboard
dashboard/app.js
Other components
- Sensor Sources
- Dashboard User
- Email and Webhook
Connections 28
- Sensor Sources → Sensor Ingestion: sends readings
README.md - Sensor Simulator → Sensor Sources: simulates feeds
README.md - FastAPI Application → Agent Orchestrator: starts lifecycle
api/main.py - FastAPI Application → API Middleware: configures
api/main.py - FastAPI Application → Monitoring API: routes requests
api/main.py - Sensor Ingestion → Agent Orchestrator: dispatches readings
core/orchestrator.py - Monitoring API → Agent Orchestrator: triggers pipeline
api/routes/monitoring.py - Monitoring API → PostgreSQL Database: reads and writes
api/routes/monitoring.py - Monitoring API → Reading and Station Models: uses model
api/routes/monitoring.py - Agent Orchestrator → Emission Monitoring: dispatches readings
core/orchestrator.py - Agent Orchestrator → Violation Detection: dispatches violations
core/orchestrator.py - Agent Orchestrator → Regulatory Alerts: dispatches violations
core/orchestrator.py - Agent Orchestrator → Health Risk Assessment: dispatches violations
core/orchestrator.py - Agent Orchestrator → Dashboard Aggregation: dispatches events
core/orchestrator.py - Emission Monitoring → Agent Orchestrator: emits violations
README.md - Violation Detection → Granite Analysis: generates reports
agents/violation_agent.py - Health Risk Assessment → Granite Analysis: requests advisories
agents/health_agent.py - Regulatory Alerts → Event Persistence: persists alerts
agents/alert_agent.py - Regulatory Alerts → Email and Webhook: escalates alerts
README.md - Violation Detection → Event Persistence: persists violations
- Event Persistence → PostgreSQL Database: writes events
services/persistence.py - PostgreSQL Database → Reading and Station Models: stores readings
core/database.py - PostgreSQL Database → Violation Model: stores violations
core/database.py - PostgreSQL Database → Alert Model: stores alerts
core/database.py - Dashboard Aggregation → FastAPI Application: streams SSE
api/main.py - FastAPI Application → Live Dashboard: serves live updates
README.md - Dashboard User → Live Dashboard: views monitoring
README.md - FastAPI Application → IBM Cloud Integration: health integration