# akash-8991/renewable_energy_orchestrator architecture

> Architecture diagram of the GitHub repository akash-8991/renewable_energy_orchestrator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akash-8991/renewable_energy_orchestrator
- Repository: https://github.com/akash-8991/renewable_energy_orchestrator

## Overview

Renewable Energy Orchestrator is a multi-tenant renewable-energy decision and control platform. Users configure assets and connectors, ingest telemetry and documents, inspect forecasts and proposed decisions, and manage approvals and operations through a web console. Its backend and policy workers support the decision lifecycle; specialist agents add evidence-based review after decisions are ready. The tree also exposes simulation, governance, audit, and export capabilities. The supplied excerpts show only parts of this system, so unsampled subsystem links are omitted or marked unverified rather than inferred as confirmed calls.

Main entry points: [`platform/packages/reo_common/reo_common/events.py`](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/packages/reo_common/reo_common/events.py) (Telemetry stream), [`platform/backend/app/main.py`](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/backend/app/main.py) (Backend API), [`platform/policy/cycle.py`](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/policy/cycle.py) (Decision cycle), [`platform/packages/reo_common/reo_common/model_gateway.py`](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/packages/reo_common/reo_common/model_gateway.py) (Model gateway)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_web["Web console<br/>[App.tsx]"]
end

subgraph group_intake["Platform API and intake"]
  node_api["Backend API<br/>[main.py]"]
  node_ingestion_api["Ingestion routes<br/>[ingestion.py]"]
  node_ingest_services["Ingestion services"]
  node_telemetry["Telemetry stream<br/>[events.py]"]
  node_simulator["Edge simulator<br/>[simulator.py]"]
end

subgraph group_decision["Decision lifecycle"]
  node_cycle_worker["Decision cycle worker<br/>[worker.py]"]
  node_cycle["Decision cycle<br/>[cycle.py]"]
  node_forecast["Forecasting<br/>[forecast.py]"]
  node_solver["Optimizer<br/>[solver.py]"]
  node_scenario["Scenario simulation<br/>[scenario_lab.py]"]
  node_agent_worker["Agent orchestration<br/>[worker.py]"]
  node_evidence["Evidence assembly<br/>[context.py]"]
  node_specialists["Specialist agents"]
end

subgraph group_shared["Shared platform services"]
  node_canonical["Canonical domain model<br/>[canonical.py]"]
  node_database[("Tenant-isolated database<br/>[connection.py]")]
  node_model_gateway["Model gateway<br/>[model_gateway.py]"]
  node_settings["Platform settings<br/>[config.py]"]
end

subgraph group_controls["Controls and outputs"]
  node_guardrails["Model guardrails<br/>[circuit_breaker.py]"]
  node_governance["Governance and policy<br/>[governance.py]"]
  node_audit["Audit records<br/>[audit.py]"]
  node_exports["Export worker<br/>[worker.py]"]
end

node_operator(("Platform user"))

node_operator -->|"uses"| node_web
node_web -.->|"calls API"| node_api
node_api -->|"registers routes"| node_ingestion_api
node_ingestion_api -->|"uses intake"| node_ingest_services
node_ingestion_api -->|"requests mappings"| node_model_gateway
node_ingest_services -->|"publishes events"| node_telemetry
node_simulator -->|"writes telemetry"| node_database
node_simulator -->|"publishes events"| node_telemetry
node_cycle_worker -->|"runs cycle"| node_cycle
node_cycle_worker -->|"consumes events"| node_telemetry
node_cycle -.->|"requests forecast"| node_forecast
node_cycle -.->|"requests optimization"| node_solver
node_cycle -.->|"reads and writes decisions"| node_database
node_scenario -.->|"uses optimizer"| node_solver
node_agent_worker -->|"consumes decision events"| node_telemetry
node_agent_worker -.->|"assembles evidence"| node_evidence
node_agent_worker -->|"dispatches agents"| node_specialists
node_evidence -->|"reads domain records"| node_canonical
node_specialists -->|"requests structured output"| node_model_gateway
node_model_gateway -->|"loads provider settings"| node_settings
node_model_gateway -->|"uses circuit breaker"| node_guardrails
node_governance -.->|"manages policies"| node_canonical
node_exports -->|"reads export data"| node_database
node_exports -->|"uses event bus"| node_telemetry
node_audit -->|"records domain events"| node_canonical
node_api -->|"registers routes"| node_governance
node_api -.->|"configures sessions"| node_database

click node_web "https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/frontend/src/App.tsx"
click node_api "https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/backend/app/main.py"
click node_ingestion_api "https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/backend/app/routers/ingestion.py"
click node_ingest_services "https://github.com/akash-8991/renewable_energy_orchestrator/tree/master/platform/backend/app/ingestion"
click node_telemetry "https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/packages/reo_common/reo_common/events.py"
click node_canonical "https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/models/canonical.py"
click node_database "https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/database/connection.py"
click node_cycle_worker "https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/policy/worker.py"
click node_cycle "https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/policy/cycle.py"
click node_forecast "https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/policy/forecast.py"
click node_solver "https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/policy/solver.py"
click node_scenario "https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/policy/scenario_lab.py"
click node_agent_worker "https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/agent/worker.py"
click node_evidence "https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/agent/context.py"
click node_specialists "https://github.com/akash-8991/renewable_energy_orchestrator/tree/master/platform/agent/agents"
click node_model_gateway "https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/packages/reo_common/reo_common/model_gateway.py"
click node_settings "https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/packages/reo_common/reo_common/config.py"
click node_guardrails "https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/guardrails/circuit_breaker.py"
click node_governance "https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/backend/app/routers/governance.py"
click node_audit "https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/output/audit.py"
click node_exports "https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/output/export-worker/worker.py"
click node_simulator "https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/infrastructure/edge-simulator/simulator.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web,node_operator toneBlue
class node_api,node_ingestion_api,node_ingest_services,node_telemetry,node_simulator toneAmber
class node_cycle_worker,node_cycle,node_forecast,node_solver,node_scenario,node_agent_worker,node_evidence,node_specialists toneMint
class node_canonical,node_database,node_model_gateway,node_settings toneRose
class node_guardrails,node_governance,node_audit,node_exports toneIndigo
```

## Components

### User experience

- [Web console](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/frontend/src/App.tsx): `platform/frontend/src/App.tsx`

### Platform API and intake

- [Backend API](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/backend/app/main.py): `platform/backend/app/main.py`
- [Ingestion routes](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/backend/app/routers/ingestion.py): `platform/backend/app/routers/ingestion.py`
- [Ingestion services](https://github.com/akash-8991/renewable_energy_orchestrator/tree/master/platform/backend/app/ingestion): `platform/backend/app/ingestion`
- [Telemetry stream](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/packages/reo_common/reo_common/events.py): `platform/packages/reo_common/reo_common/events.py`
- [Edge simulator](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/infrastructure/edge-simulator/simulator.py): `platform/infrastructure/edge-simulator/simulator.py`

### Decision lifecycle

- [Decision cycle worker](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/policy/worker.py): `platform/policy/worker.py`
- [Decision cycle](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/policy/cycle.py): `platform/policy/cycle.py`
- [Forecasting](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/policy/forecast.py): `platform/policy/forecast.py`
- [Optimizer](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/policy/solver.py): `platform/policy/solver.py`
- [Scenario simulation](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/policy/scenario_lab.py): `platform/policy/scenario_lab.py`
- [Agent orchestration](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/agent/worker.py): `platform/agent/worker.py`
- [Evidence assembly](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/agent/context.py): `platform/agent/context.py`
- [Specialist agents](https://github.com/akash-8991/renewable_energy_orchestrator/tree/master/platform/agent/agents): `platform/agent/agents`

### Shared platform services

- [Canonical domain model](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/models/canonical.py): `platform/models/canonical.py`
- [Tenant-isolated database](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/database/connection.py): `platform/database/connection.py`
- [Model gateway](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/packages/reo_common/reo_common/model_gateway.py): `platform/packages/reo_common/reo_common/model_gateway.py`
- [Platform settings](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/packages/reo_common/reo_common/config.py): `platform/packages/reo_common/reo_common/config.py`

### Controls and outputs

- [Model guardrails](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/guardrails/circuit_breaker.py): `platform/guardrails/circuit_breaker.py`
- [Governance and policy](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/backend/app/routers/governance.py): `platform/backend/app/routers/governance.py`
- [Audit records](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/output/audit.py): `platform/output/audit.py`
- [Export worker](https://github.com/akash-8991/renewable_energy_orchestrator/blob/master/platform/output/export-worker/worker.py): `platform/output/export-worker/worker.py`

### Other components

- **Platform user**

## Connections

- Platform user → Web console: uses
- Web console → Backend API: calls API
- Backend API → Ingestion routes: registers routes (evidence: `platform/backend/app/main.py`)
- Ingestion routes → Ingestion services: uses intake (evidence: `platform/backend/app/routers/ingestion.py`)
- Ingestion routes → Model gateway: requests mappings (evidence: `platform/backend/app/routers/ingestion.py`)
- Ingestion services → Telemetry stream: publishes events (evidence: `platform/backend/app/ingestion/file_ingest.py`)
- Edge simulator → Tenant-isolated database: writes telemetry (evidence: `platform/infrastructure/edge-simulator/simulator.py`)
- Edge simulator → Telemetry stream: publishes events (evidence: `platform/infrastructure/edge-simulator/simulator.py`)
- Decision cycle worker → Decision cycle: runs cycle (evidence: `platform/policy/worker.py`)
- Decision cycle worker → Telemetry stream: consumes events (evidence: `platform/policy/worker.py`)
- Decision cycle → Forecasting: requests forecast (evidence: `platform/policy/cycle.py`)
- Decision cycle → Optimizer: requests optimization (evidence: `platform/policy/cycle.py`)
- Decision cycle → Tenant-isolated database: reads and writes decisions (evidence: `platform/policy/cycle.py`)
- Scenario simulation → Optimizer: uses optimizer
- Agent orchestration → Telemetry stream: consumes decision events (evidence: `platform/agent/worker.py`)
- Agent orchestration → Evidence assembly: assembles evidence (evidence: `platform/agent/worker.py`)
- Agent orchestration → Specialist agents: dispatches agents (evidence: `platform/agent/worker.py`)
- Evidence assembly → Canonical domain model: reads domain records (evidence: `platform/agent/context.py`)
- Specialist agents → Model gateway: requests structured output (evidence: `platform/agent/agents/optimisation_reviewer.py`)
- Model gateway → Platform settings: loads provider settings (evidence: `platform/packages/reo_common/reo_common/model_gateway.py`)
- Model gateway → Model guardrails: uses circuit breaker (evidence: `platform/packages/reo_common/reo_common/model_gateway.py`)
- Governance and policy → Canonical domain model: manages policies
- Export worker → Tenant-isolated database: reads export data (evidence: `platform/output/export-worker/worker.py`)
- Export worker → Telemetry stream: uses event bus (evidence: `platform/output/export-worker/worker.py`)
- Audit records → Canonical domain model: records domain events (evidence: `platform/output/audit.py`)
- Backend API → Governance and policy: registers routes (evidence: `platform/backend/app/main.py`)
- Backend API → Tenant-isolated database: configures sessions
