# 1willshine/energy-intelligence-agent architecture

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

- Interactive diagram: https://gitdiagram.com/1willshine/energy-intelligence-agent
- Repository: https://github.com/1willshine/energy-intelligence-agent

## Overview

GridEdge Intelligence is a Streamlit energy-market intelligence platform. Its main workflow collects electricity, weather, gas, generation-mix, and news data; the app combines live signals with price forecasts and presents market analysis and procurement guidance. A separate real-time manager bootstraps and refreshes cached market data. AI-generated explanations are distinct from the quantitative risk decision. The README is empty, so capabilities are inferred from the sampled source; some app-to-subsystem calls and storage details are not visible and are shown only where documented or left unlinked.

Main entry points: [`app.py`](https://github.com/1willshine/energy-intelligence-agent/blob/main/app.py) (Market dashboard), [`pipeline.py`](https://github.com/1willshine/energy-intelligence-agent/blob/main/pipeline.py) (Historical data fetch), [`ingestion/realtime.py`](https://github.com/1willshine/energy-intelligence-agent/blob/main/ingestion/realtime.py) (Realtime data manager), [`forecasting/model.py`](https://github.com/1willshine/energy-intelligence-agent/blob/main/forecasting/model.py) (Price forecasting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Market experience"]
  node_app["Market dashboard<br/>[app.py]"]
end

subgraph group_data["Market data"]
  node_pipeline["Historical data fetch<br/>[pipeline.py]"]
end

subgraph group_analytics["Forecasts and decisions"]
  node_forecast["Price forecasting<br/>[model.py]"]
  node_signals["Risk decisions<br/>[models.py]"]
end

subgraph group_realtime["Real-time ingestion"]
  node_realtime_mgr["Realtime data manager<br/>[realtime.py]"]
  node_parquet[("Local parquet cache<br/>[realtime.py]")]
end

node_operator(("Energy analyst"))
node_ai["AI providers"]
node_caiso["CAISO OASIS"]
node_openmeteo["Open-Meteo"]
node_eia["EIA"]
node_newsapi["NewsAPI"]

node_operator -->|"uses dashboard"| node_app
node_app -->|"fetches market data"| node_pipeline
node_pipeline -->|"fetches prices"| node_caiso
node_pipeline -->|"fetches weather"| node_openmeteo
node_pipeline -->|"fetches gas data"| node_eia
node_pipeline -->|"fetches headlines"| node_newsapi
node_app -->|"builds price prediction"| node_forecast
node_app -.-> node_signals
node_app -->|"requests explanations"| node_ai
node_app -.-> node_realtime_mgr
node_realtime_mgr -->|"polls prices"| node_caiso
node_realtime_mgr -->|"fetches weather"| node_openmeteo
node_realtime_mgr -->|"fetches gas data"| node_eia
node_realtime_mgr -->|"caches market data"| node_parquet

click node_app "https://github.com/1willshine/energy-intelligence-agent/blob/main/app.py"
click node_pipeline "https://github.com/1willshine/energy-intelligence-agent/blob/main/pipeline.py"
click node_forecast "https://github.com/1willshine/energy-intelligence-agent/blob/main/forecasting/model.py"
click node_signals "https://github.com/1willshine/energy-intelligence-agent/blob/main/models.py"
click node_realtime_mgr "https://github.com/1willshine/energy-intelligence-agent/blob/main/ingestion/realtime.py"
click node_parquet "https://github.com/1willshine/energy-intelligence-agent/blob/main/ingestion/realtime.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_app toneBlue
class node_pipeline toneAmber
class node_forecast,node_signals,node_newsapi toneMint
class node_realtime_mgr,node_parquet toneRose
class node_operator,node_ai,node_caiso,node_openmeteo,node_eia toneIndigo
```

## Components

### Market experience

- [Market dashboard](https://github.com/1willshine/energy-intelligence-agent/blob/main/app.py): `app.py`

### Market data

- [Historical data fetch](https://github.com/1willshine/energy-intelligence-agent/blob/main/pipeline.py): `pipeline.py`

### Forecasts and decisions

- [Price forecasting](https://github.com/1willshine/energy-intelligence-agent/blob/main/forecasting/model.py): `forecasting/model.py`
- [Risk decisions](https://github.com/1willshine/energy-intelligence-agent/blob/main/models.py): `models.py`

### Real-time ingestion

- [Realtime data manager](https://github.com/1willshine/energy-intelligence-agent/blob/main/ingestion/realtime.py): `ingestion/realtime.py`
- [Local parquet cache](https://github.com/1willshine/energy-intelligence-agent/blob/main/ingestion/realtime.py): `ingestion/realtime.py`

### Other components

- **Energy analyst**
- **AI providers**
- **CAISO OASIS**
- **Open-Meteo**
- **EIA**
- **NewsAPI**

## Connections

- Energy analyst → Market dashboard: uses dashboard (evidence: `app.py`)
- Market dashboard → Historical data fetch: fetches market data (evidence: `app.py`)
- Historical data fetch → CAISO OASIS: fetches prices (evidence: `pipeline.py`)
- Historical data fetch → Open-Meteo: fetches weather (evidence: `pipeline.py`)
- Historical data fetch → EIA: fetches gas data (evidence: `pipeline.py`)
- Historical data fetch → NewsAPI: fetches headlines (evidence: `pipeline.py`)
- Market dashboard → Price forecasting: builds price prediction (evidence: `app.py`)
- Market dashboard → Risk decisions (evidence: `app.py`)
- Market dashboard → AI providers: requests explanations (evidence: `app.py`)
- Market dashboard → Realtime data manager (evidence: `app.py`)
- Realtime data manager → CAISO OASIS: polls prices (evidence: `ingestion/realtime.py`)
- Realtime data manager → Open-Meteo: fetches weather (evidence: `ingestion/realtime.py`)
- Realtime data manager → EIA: fetches gas data (evidence: `ingestion/realtime.py`)
- Realtime data manager → Local parquet cache: caches market data (evidence: `ingestion/realtime.py`)
