How lasithhaputhanthri/agentic_inverter_monitoring-system works
This repository is a simulated solar-inverter fleet incident-response system. Its main workflow runs from generated telemetry through deterministic monitoring and alerting, LLM diagnosis and remediation, policy checks, human approval, sandboxed execution, and audit storage; the dashboard/API exposes incident status and decisions. The README documents MQTT and subsystem boundaries; sampled workflow and agent excerpts clarify orchestration. Some runtime wiring (notably telemetry ingestion and API-to-workflow dispatch) is not shown in the excerpts, so those links rely on the README or are omitted.
Main entry points: graph.py Incident Workflow · detector.py Physical Monitor · executor.py Sandboxed Executor · routes.py REST API
Components 29
Fleet Simulation
- Simulated Inverters
simulator/devices.py - Telemetry Generator
simulator/generator.py - Simulator Runner
simulator/runner.py - MQTT Publisher
simulator/publisher.py - MQTT Listener
simulator/listener.py - Simulator State API
simulator/devices.py
Telemetry Monitoring
- Telemetry Schema
backend/common/schemas.py - Physical Monitor
backend/monitor/detector.py - Baseline Model
backend/monitor/baseline_model.py - Alert Models
backend/monitor/models.py - Runtime Configuration
backend/common/config.py - Clock Utilities
backend/common/clock.py - Redacting Logging
backend/common/logging.py
Incident Response
- Incident Workflow
backend/workflow/graph.py - Diagnosis Agent
backend/agents/diagnosis.py - Remediation Agent
backend/agents/remediation.py - LLM Client
backend/agents/llm_client.py - Agent Result Models
backend/agents/models.py - Policy Engine
backend/executor/policy.py - Approval Gate
backend/workflow/approval.py - Sandboxed Executor
backend/executor/executor.py
API and Dashboard
- REST API
backend/api/routes.py - API Authentication
backend/api/auth.py - Operator Dashboard
frontend/dashboard/app.py
Persistence
- Data Repositories
backend/storage/repositories.py - Incident Database
backend/storage/database.py - Audit Sink
backend/workflow/audit.py
Other components
- Operator
- MQTT Broker
Connections 33
- Simulator Runner → Telemetry Generator: generates
simulator/runner.py - Simulator Runner → Simulated Inverters: runs fleet
simulator/runner.py - Simulator Runner → MQTT Publisher: publishes via
simulator/runner.py - MQTT Publisher → MQTT Broker: publishes telemetry
README.md - MQTT Broker → MQTT Listener: delivers telemetry
README.md - MQTT Listener → Telemetry Schema: validates messages
simulator/listener.py - MQTT Listener → Physical Monitor: forwards telemetry
- Physical Monitor → Baseline Model: evaluates baseline
- Physical Monitor → Alert Models: raises alerts
backend/monitor/detector.py - Physical Monitor → Incident Workflow: triggers diagnosis
README.md - Incident Workflow → Diagnosis Agent: invokes
backend/workflow/graph.py - Diagnosis Agent → LLM Client: requests inference
backend/agents/diagnosis.py - Diagnosis Agent → Agent Result Models: returns diagnosis
backend/agents/diagnosis.py - Incident Workflow → Remediation Agent: invokes
backend/workflow/graph.py - Remediation Agent → LLM Client: requests inference
backend/agents/remediation.py - Remediation Agent → Agent Result Models: returns proposal
backend/agents/remediation.py - Incident Workflow → Policy Engine: checks proposal
backend/workflow/graph.py - Incident Workflow → Approval Gate: awaits decision
backend/workflow/graph.py - Operator → REST API: submits decision
README.md - REST API → API Authentication: authenticates
backend/api/routes.py - REST API → Data Repositories: reads and records
backend/api/routes.py - Approval Gate → Sandboxed Executor: authorizes execution
README.md - Incident Workflow → Sandboxed Executor: dispatches approved action
backend/workflow/graph.py - Sandboxed Executor → Simulator State API: mutates simulated state
README.md - Incident Workflow → Audit Sink: records events
backend/workflow/graph.py - Sandboxed Executor → Audit Sink: records execution
backend/executor/executor.py - Audit Sink → Data Repositories: persists records
- Data Repositories → Incident Database: stores records
backend/storage/database.py - Operator Dashboard → REST API: requests status
- Runtime Configuration → LLM Client: configures provider
backend/agents/llm_client.py - Runtime Configuration → Physical Monitor: configures thresholds
backend/monitor/detector.py - Clock Utilities → Incident Workflow: timestamps events
- Redacting Logging → Physical Monitor: redacts logs
backend/monitor/detector.py