Skip to content

About

Autonomous Dual-Process (System 1 TypeSafe Jev + System 2 Amazon Bedrock & LangGraph) Energy Grid & Power Plant Optimization Platform with Karpathy Self-Recurring Loop

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

14 Commits

Folders and files

Repository files navigation

HelioGrid-AI Hero Banner

⚑ HelioGrid-AI

Autonomous Dual-Process (System 1: TypeSafe Jev + System 2: Amazon Bedrock & LangGraph) Energy Grid & Power Factory Optimization Platform with Andrej Karpathy’s Self-Recurring Continual Learning Loop

Created & Engineered by Rishabh Patil (@MrRobotop)

CI Python 3.10+ PyTorch 2.x LangGraph System 1: TypeSafe Jev System 2: Amazon Bedrock Karpathy Loop Tests Docker Ready Code style: ruff License: MIT

About HelioGrid-AI Β· Control Room UI Showcase Β· System Requirements Β· 30-Second Quick Setup & API Keys Β· Pre-Trained Models & Benchmarks Β· System Architecture


🌐 About HelioGrid-AI

Modern electrical transmission grids and thermal power factories operate under unforgiving nonlinear physical lawsβ€”Kirchhoff's AC power flow equations ($Y_{\text{bus}} = G + jB$) and Brayton–Rankine combined-cycle thermodynamicsβ€”coupled with sub-second operational safety margins.

Existing approaches suffer from a fundamental dichotomy:

  • Legacy Operations-Research & SCADA Solvers optimize static snapshots but lack semantic root-cause awareness, cross-substation anomaly reasoning, and autonomous adaptation when ambient weather or load distributions shift.
  • Standard Generative LLMs ("System 2" token-by-token models) are too slow (2–8 seconds latency) and probabilistically uncalibrated for real-time control routing, and frequently hallucinate unphysical bus voltages or violate branch MVA thermal ratings when used without hard physics guardrails.

HelioGrid-AI solves this by uniting a rigorous Physics & Mathematical Optimization Core (System 0) with a Dual-Process Cognitive Architecture (System 1 TypeSafe Jev + System 2 Amazon Bedrock & LangGraph) and Andrej Karpathy's Self-Recurring Continual Learning Loop (autoresearch):

  1. System 0 β€” Physics Digital Twin, Hybrid ML & Constrained AC-OPF Core:
    • Built on 34,840 hours of real substation telemetry (ETTh1 + ETTh2), 9,568 hours of Combined Cycle Power Plant (UCI CCPP) operations, and a full Newton-Raphson AC Power Flow Digital Twin of the IEEE 14-Bus Hybrid Transmission Network (3 non-renewable CCPP gas/steam turbines, 4 utility solar/wind DERs, and 2 grid-scale BESS units).
    • Forecasts multi-horizon plant power output and nodal net load using a serialized Hybrid Stacking Ensemble (Second-Order Newton-Boosted Histogram Trees + PyTorch ResidualGridNet + Out-of-Sample Calibrated Ridge Meta-Learner) wrapped in Split-Conformal Prediction Intervals (P10 / P50 / P90) and Exact-Efficiency Shapley (SHAP) sensor attributions.
    • Solves constrained nonlinear AC Optimal Power Flow (AC-OPF) & BESS Arbitrage alongside CCPP Inlet Air Chilling & Condenser Vacuum Optimization via SciPy SLSQP.
  2. System 1 β€” Fast Calibrated Decision Engine (TypeSafe Jev Β· typesafe/jev-1.13):
    • Executes sub-200ms calibrated probabilistic decisions trained via Reinforcement Learning for Calibrated Decisions (RLCD) across three structured primitives: Noul (binary safety/contingency gates), Choice (workflow routing), and Score (calibrated $[0, 1]$ severity metrics).
    • Operates at three critical control points: Route-First Triage Controller (deciding whether to invoke heavy System 2 reasoning), Verify-Before-Act OPF Guardrail (blocking unsafe dispatch setpoints and detecting Jevons Paradox rebound risks), and Verify-After Anti-Hallucination Semantic Auditor.
  3. System 2 β€” Multi-Agent Analytical Mesh (Amazon Bedrock + LangGraph + LangChain):
    • Orchestrates a 7-node cyclic LangGraph StateGraph connecting specialist tool-calling agents (plant_thermodynamics_agent, grid_forecast_agent, optimal_dispatch_agent, karpathy_autoresearch_agent, and bedrock_executive_copilot) powered by Amazon Bedrock (Claude 3.5 Sonnet / Amazon Nova Pro) with automatic region extraction and zero-downtime failover to a Citation-Locked Physics Synthesizer.
  4. Continual Learning β€” Andrej Karpathy’s Self-Recurring Loop (autoresearch + Data Engine):
    • Governed by the declarative specification in program.md, HelioGrid-AI continuously ingests streaming grid and plant telemetry, proposes structural/hyperparameter mutations, backtests candidate models in shadow mode against the AC-OPF digital twin, and enforces a strict Keep / Discard Gateβ€”reducing composite grid inefficiency $\mathcal{J}_{\text{total}}$ by 42.65% as more data is observed.

πŸ–₯️ Interactive SCADA & AI Control Room Showcase

HelioGrid-AI ships with a real-time Dark-Obsidian Double-Bezel SCADA & AI Control Room (FastAPI + interactive SVG/HTML5 engine) designed with atmospheric minimalism, live animated AC power-flow current streams, interactive ambient weather stress-test sliders, and one-click Bring-Your-Own-Key (BYOK) hot-swapping.

Panel 1 & 2: IEEE 14-Bus Newton-Raphson AC Power Flow Map & System 1 (TypeSafe Jev) Decision Telemetry

IEEE 14-Bus Topology & TypeSafe Jev System 1 Panel
  • Left Panel β€” Live IEEE 14-Bus Hybrid Grid Topology: Visualizes all 14 buses, 20 AC transmission corridors with animated directional power flow and thermal loading percentages ($\rho_\ell$), nodal voltage magnitudes ($V_i \in [0.95, 1.05]\text{ p.u.}$), and optimized dispatch setpoints across CCPP gas/steam generators (Bus 1, Bus 2, Bus 6), solar/wind DERs (Bus 3, Bus 8, Bus 10, Bus 13), and utility BESS units (Bus 4, Bus 9).
  • Right Panel β€” System 1 (TypeSafe Jev) Fast Decision Engine: Displays real-time calibrated Noul, Choice, and Score probabilities across the Route-First Triage Controller, Verify-Before-Act OPF Safety Guardrail, and Verify-After Anti-Hallucination Auditor.

Panel 3 & 4: Non-Renewable CCPP Thermodynamic Twin (SHAP Attribution) & 48-Hour Conformal Telemetry

CCPP Thermodynamic Twin & 48-Hour Conformal Telemetry Panel
  • Left Panel β€” CCPP Power Factory Digital Twin & SHAP Waterfall: Monitors Brayton–Rankine Net Electrical Output ($P_{\text{CCPP}}\text{ MW}$), thermal efficiency ($\eta_{\text{th}}%$), heat rate ($\text{BTU/kWh}$), SLSQP inlet air chilling ($\Delta T_{\text{chill}}$) and condenser vacuum ($\Delta V_{\text{vac}}$) recommendations, plus Exact-Efficiency Shapley (SHAP) attributions quantifying how Ambient Temperature (AT), Exhaust Vacuum (V), Wet-Bulb Temperature (T_wb), and Relative Humidity (RH) drive plant output.
  • Right Panel β€” 48-Hour Grid Load, Renewable Generation & Split-Conformal P10–P90 Horizon: Plots multi-horizon forecasts from models/grid_load_forecaster_champion.pt with calibrated Split-Conformal P10–P90 uncertainty bands (89.11% empirical holdout coverage) alongside solar/wind generation and transformer oil temperature (OT Β°C).

Panel 5 & 6: Andrej Karpathy’s Self-Recurring Autoresearch Lab & System 2 (Amazon Bedrock + LangGraph) Copilot

Karpathy Autoresearch Lab & Amazon Bedrock Copilot Panel
  • Left Panel β€” Karpathy Self-Recurring Loop (autoresearch + Data Engine): Tracks the live monotonic decline of the composite objective $\mathcal{J}_{\text{total}}$ (1.0000 β†’ 0.5735, -42.65%) across streaming data stages (320h β†’ 1,040h) and logs every autonomous mutation trial (KEPT vs. DISCARDED) in a persistent ledger. Operators can trigger a new self-recurring experiment live from the UI via +1 Iteration.
  • Right Panel β€” System 2 (Amazon Bedrock + LangGraph) Executive Copilot: Visualizes the 7-node LangGraph execution pipeline (jev_system1_triage β†’ plant_thermodynamics_agent β†’ grid_forecast_agent β†’ optimal_dispatch_agent β†’ karpathy_autoresearch_agent β†’ bedrock_executive_copilot β†’ jev_system1_auditor) and produces citation-locked control room briefings grounded in exact physical telemetry.

πŸ’» System Requirements

HelioGrid-AI is engineered to run fast on standard developer laptops, workstations, and cloud instances without requiring a dedicated GPU.

Component Minimum Specification Recommended Specification Notes
Operating System macOS 12+, Ubuntu 20.04+ / Debian 11+, or Windows 10/11 (WSL2 / PowerShell) macOS 14+ (Apple Silicon M1/M2/M3/M4) or Linux x86_64 Fully POSIX & cross-platform compatible
Python Runtime Python 3.10 Python 3.11 or 3.12 Tested with PyTorch 2.x, SciPy, FastAPI, and LangGraph
CPU 2+ vCPU cores (x86_64 or ARM64) 4–8+ CPU cores (Apple M-series / Intel Core i5+ / AMD Ryzen 5+) Full 7-node cycle + AC-OPF executes in ~120–180 ms on CPU
Memory (RAM) 2 GB free RAM 4 GB+ free RAM Runtime footprint with pre-trained .pt models is ~280 MB
GPU (Optional) None required (CPU-first PyTorch execution) Apple Metal (MPS) or NVIDIA CUDA (optional) Full 9,568-hour model retraining takes ~4 seconds on CPU
Disk Space 350 MB free space 1 GB free space Includes datasets (ETTh1, ETTh2, ccpp.csv) & .pt checkpoints
Web Browser Chrome 110+, Safari 16+, Edge 110+, or Firefox 115+ Latest Chrome, Brave, Arc, or Safari Supports hardware-accelerated SVG animations & backdrop blur
API Keys / Network Optional (100% functional offline out-of-the-box) TYPESAFE_API_KEY + AWS Bedrock Key (Bearer or IAM) Automatic zero-downtime fallback when offline or unconfigured

πŸš€ 30-Second Quick Setup & Instant API Key Guide

HelioGrid-AI is designed so anyone cloning the repository can launch the live Control Room and plug in their own API keys in under 30 seconds.

Option 1: One-Command Automatic Setup & Launch (Recommended)

Run the included quickstart.sh script (or make open). It automatically creates .venv, installs dependencies, bootstraps .env, verifies the pre-trained .pt checkpoints in models/, and launches the Control Room at http://127.0.0.1:8000:

git clone https://github.com/MrRobotop/HelioGrid-AI.git
cd HelioGrid-AI

# One command: installs environment, verifies models, and opens http://127.0.0.1:8000
./quickstart.sh --open-browser

Or using make:

make open          # Setup + launch Control Room UI and open browser
make start         # Setup + launch Control Room UI on http://127.0.0.1:8000

Option 2: Manual Step-by-Step Virtual Environment Setup

git clone https://github.com/MrRobotop/HelioGrid-AI.git
cd HelioGrid-AI

python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -e ".[dev]"

# Launch the Control Room Server
python scripts/start_dashboard.py --open-browser

πŸ”‘ How to Plug In Your API Keys (3 Instant Methods)

HelioGrid-AI supports System 1 (TypeSafe Jev) and System 2 (Amazon Bedrock) credentials via three interchangeable methods:

Method A β€” Live In-Browser Hot-Swapping (Zero Restart Required)

  1. Start the server (./quickstart.sh) and open http://127.0.0.1:8000.
  2. Click the πŸ”‘ API Keys (BYOK) button in the top-right Floating Command Dock.
  3. Paste your TypeSafe Jev API Key and/or Amazon Bedrock Credentials, then click Save & Activate Keys. The status pills in the header immediately switch to live mode without restarting the server.

Method B β€” Via the .env File (Supports Both Bedrock Bearer Keys & AWS IAM Keys)

Copy .env.example to .env (done automatically by ./quickstart.sh) and add your keys:

# 1. System 1: TypeSafe Jev Fast Decision Engine (https://thejevai.com)
TYPESAFE_API_KEY=your_typesafe_jev_api_key_here
TYPESAFE_MODEL=typesafe/jev-1.13

# 2. System 2: Amazon Bedrock β€” Option I: Short-Term Bedrock Bearer API Key
#    (Region is automatically extracted from the presigned token!)
AWS_BEARER_TOKEN_BEDROCK=bedrock-api-key-YmVkcm9jay5hbWF6b25hd3MuY29tLz...

# 3. System 2: Amazon Bedrock β€” Option II: Standard AWS IAM Credentials
AWS_ACCESS_KEY_ID=AKIA...
AWS_SECRET_ACCESS_KEY=your_secret_access_key
AWS_SESSION_TOKEN=
AWS_REGION=us-east-1
BEDROCK_MODEL_ID=anthropic.claude-3-5-sonnet-20240620-v1:0

Note: .env is strictly git-ignored via .gitignore so your credentials are never accidentally committed.

Method C β€” Pass Keys Directly via CLI Flags on Launch

You can inject keys directly when launching scripts/start_dashboard.py or quickstart.sh:

# Launch with an Amazon Bedrock short-term Bearer key and TypeSafe Jev key
./quickstart.sh \
  --bedrock-bearer-key "bedrock-api-key-..." \
  --jev-key "jev_..." \
  --open-browser

# Or launch with standard AWS IAM credentials
python scripts/start_dashboard.py \
  --aws-access-key "AKIA..." \
  --aws-secret-key "..." \
  --aws-region "us-east-1" \
  --open-browser

Verify Live API Connectivity via CLI or Docker Deployment

To run a standalone end-to-end diagnostic verifying your .env credentials against live AWS Bedrock endpoints and the LangGraph workflow:

make verify-bedrock
# or: PYTHONPATH=src .venv/bin/python scripts/verify_bedrock_live.py

Option 3: One-Command Cloud & Container Deployment (Docker / Render / Railway)

HelioGrid-AI ships with a hardened multi-stage Dockerfile (non-root heliogrid operator account, pre-verified .pt checkpoints, /api/health readiness probe, and per-request X-* BYOK header isolation so multiple users can safely use their own keys on a shared cloud deployment), plus one-click cloud blueprints (render.yaml and railway.json):

docker compose up --build -d
# Control Room is now live at http://127.0.0.1:8000

🧠 Pre-Trained Production Models & Empirical Benchmarks

1. Pre-Trained .pt Production Model Checkpoints (models/)

Both hybrid forecasting ensembles (Newton-Boosted Histogram Trees + PyTorch ResidualGridNet + Out-of-Sample Calibrated Ridge Stack + Split-Conformal Quantiles) are pre-trained on a full 1-year multi-season chronicle (8,760 training hours) and evaluated on 808 unseen Year-2 holdout test hours (9,568 total hours):

Production Artifact Target Physical Variable Holdout RMSE Holdout MAE Holdout $R^2$ Conformal P10–P90 Coverage (Target $\ge 80%$) SHA-256 Prefix
models/ccpp_forecaster_champion.pt (118 KB) CCPP Net Electrical Output ($P_{\text{CCPP}}\text{ MW}$) 0.9794 MW 0.7927 MW 0.9864 93.44% 17fb1dc19866...
models/grid_load_forecaster_champion.pt (141 KB) IEEE 14-Bus Total Active Load ($P_{\text{load}}\text{ MW}$) 18.005 MW 14.021 MW 0.8520 89.11% d13895dbcf67...

Full training metadata, epoch loss curves, out-of-sample stacking weights, and SHA-256 checksums are recorded in models/training_manifest.json. Re-run training anytime with make train.


2. 168-Hour (7-Day) Closed-Loop Grid & Power Factory Optimization Benchmark

Reproducible via make benchmark (scripts/run_benchmarks.py) across the IEEE 14-Bus Hybrid Network driven by real ETTh1 + ETTh2 substation active/reactive loads and UCI CCPP gas/steam turbine thermodynamics:

Operational Metric Baseline (Uncoordinated Droop) HelioGrid-AI (SLSQP AC-OPF + CCPP Twin) Verified Improvement
Average Generation Cost $11,415.36 / hr $9,876.69 / hr -13.48% ($258,495.41 saved / week)
Transmission $I^2R$ Line Losses 13.238 MW 9.702 MW -26.71% (-3.536 MW continuous)
Carbon Emissions Avoided Baseline -2,262.22 tCO2 / week -11.03% $\text{CO}_2$ reduction
CCPP Plant Thermal Efficiency ($\eta_{\text{th}}$) 47.76% 48.30% +0.54% pts via inlet chilling & vacuum opt
Renewable Absorption Rate 84.00% 100.00% Zero clean energy curtailment
AC Voltage & Thermal Violations 0 0 $V_i \in [0.95, 1.05]\text{ p.u.}$, $\rho_\ell \le 100%$

3. Andrej Karpathy’s Self-Recurring Loop (autoresearch + Data Engine) Scaling Law

As streaming telemetry cohorts are ingested (320h β†’ 1,040h) and autonomous hypothesis mutations run under program.md, the Keep/Discard + Jev Noul safety gate promotes genuine improvements and reverts regressions:

Streaming Stage Training Rows Ingested Champion Composite Loss ($\mathcal{J}_{\text{total}}$) CCPP Output RMSE ($\text{MW}$) Grid Net-Load RMSE ($\text{MW}$) Cumulative Improvement
Stage 0 (Initial Baseline) 320 hrs 1.0000 2.050 MW 25.12 MW Baseline
Stage 1 (+180h Stream) 500 hrs 0.7145 1.465 MW 14.98 MW -28.55%
Stage 2 (+360h Stream) 680 hrs 0.6278 1.287 MW 11.00 MW -37.22%
Stage 3 (+540h Stream) 860 hrs 0.5902 1.210 MW 9.27 MW -40.98%
Stage 4 (+720h Stream) 1,040 hrs 0.5735 1.173 MW 8.52 MW -42.65% (6 KEPT / 2 DISCARDED)

πŸ—οΈ System Architecture

flowchart TB
    subgraph DATA["Layer 0: Real-World Datasets & Physics Digital Twin"]
        ETT["Real Substation Telemetry (ETTh1 & ETTh2 Β· 34,840 hrs)<br/>Active Loads (HUFL, MUFL, LUFL) Β· Reactive Loads (HULL, MULL, LULL)<br/>Transformer Oil Temperature (OT Β°C)"]
        CCPP["Non-Renewable Power Factory (UCI CCPP Β· 9,568 hrs)<br/>Ambient Temp (AT), Exhaust Vacuum (V), Pressure (AP), Humidity (RH)<br/>Net Output (PE MW), Heat Rate (BTU/kWh), Efficiency (Ξ·_th %)"]
        IEEE["IEEE 14-Bus Hybrid Transmission Network<br/>Newton-Raphson AC Power Flow (Y_bus = G + jB)<br/>3 CCPP Units Β· 4 Solar/Wind DERs Β· 2 Utility BESS Units"]
    end

    subgraph SYS1["Layer 1: System 1 Fast Decision Engine (TypeSafe Jev Β· <200ms)"]
        JEV_TRIAGE["Route-First Triage<br/>β€’ Noul: is_emergency_contingency<br/>β€’ Choice: primary_workflow_route<br/>β€’ Score: grid_stress_severity"]
        JEV_GUARD["Verify-Before-Act Guardrail<br/>β€’ Noul: is_safe_to_dispatch<br/>β€’ Noul: jevons_rebound_risk"]
        JEV_AUDIT["Verify-After Semantic Auditor<br/>β€’ Noul: is_physically_grounded<br/>β€’ Score: operator_actionability_score"]
    end

    subgraph SYS0["Layer 2: Awesome-ML Forecasting, SHAP & Constrained AC-OPF"]
        ENS["Pre-Trained Hybrid Forecasters (.pt Registry)<br/>Newton-Boosted Trees + PyTorch ResidualGridNet + Calibrated Ridge<br/>+ Split-Conformal P10/P50/P90 Intervals"]
        SHAP["Exact-Efficiency Shapley Explainer (SHAP)<br/>+ Mahalanobis & KS Drift Detector"]
        OPF["Constrained Economic Dispatch & AC-OPF (SciPy SLSQP)<br/>CCPP Inlet Chilling/Condenser Opt + BESS Arbitrage + IΒ²R Loss Min"]
    end

    subgraph SYS2["Layer 3: System 2 Multi-Agent Mesh (LangGraph + LangChain + Amazon Bedrock)"]
        GRAPH["7-Node LangGraph StateGraph<br/>plant_thermodynamics_agent β†’ grid_forecast_agent β†’ optimal_dispatch_agent<br/>β†’ karpathy_autoresearch_agent β†’ bedrock_executive_copilot"]
    end

    subgraph KARPATHY["Layer 4: Karpathy Self-Recurring Loop (Autoresearch + Data Engine)"]
        LOOP["Declarative Policy (program.md)<br/>Streaming Data Ingestion β†’ Propose Hypothesis β†’ Shadow Train & AC-OPF Backtest<br/>β†’ J_total + Jev Noul Keep/Discard Gate β†’ Persistent Ledger"]
    end

    subgraph UI["Layer 5: Dark-Obsidian Double-Bezel SCADA & AI Control Room (FastAPI + Web UI)"]
        DASH["Live IEEE-14 Topology SVG Β· Jev System 1 Gauges Β· CCPP Digital Twin & Sliders<br/>48h Conformal Telemetry Β· Karpathy Autoresearch Lab Β· Live BYOK Key Modal"]
    end

    DATA --> JEV_TRIAGE & ENS & SHAP
    JEV_TRIAGE --> GRAPH
    ENS & SHAP --> OPF
    GRAPH <--> OPF
    OPF --> JEV_GUARD --> IEEE
    GRAPH --> JEV_AUDIT --> DASH
    DATA --> LOOP --> ENS & OPF
    LOOP --> DASH
Loading

🧰 Scientific & Agentic Stack (awesome-machine-learning + Modern AI)

Layer Libraries & Frameworks Used Concrete Role in HelioGrid-AI
System 1 Fast Decision AI TypeSafe Jev (typesafe/jev-1.13) Sub-200ms calibrated Noul, Choice, and Score decisions for Route-First triage, OPF safety guardrails, and output auditing
System 2 Multi-Agent LLM Amazon Bedrock (boto3 Converse API), LangGraph, LangChain 7-node cyclic StateGraph coordinating specialist physics/ML agents and synthesizing citation-locked control briefings
Deep Learning & Boosting PyTorch (ResidualGridNet, .pt checkpoints), Newton-Boosted Histogram Trees Multi-horizon nonlinear residual forecasting with Karpathy Data-Engine recency & tail-event sample weighting
Econometrics & Statistics Statsmodels (STL), SciPy (scipy.stats.ks_2samp, Mahalanobis distance), NumPy, Pandas Seasonal-trend decomposition, finite-sample split-conformal intervals (P10/P50/P90), and covariate shift detection
Mathematical Optimization SciPy Optimize (SLSQP constrained nonlinear programming) CCPP inlet air chilling & condenser vacuum optimization + multi-bus Economic Dispatch & BESS arbitrage
Power Grid Topology & XAI NetworkX, Exact-Efficiency Shapley (SHAP), Newton-Raphson AC Power Flow Complex nodal admittance ($Y_{\text{bus}}$) power flow, electrical betweenness centrality, and sensor attribution waterfalls
Control Room Backend & UI FastAPI, Uvicorn, Pydantic, Double-Bezel SVG/HTML5 SCADA UI Real-time REST API, interactive IEEE-14 topology map, scenario simulator, Karpathy loop lab, and Bring-Your-Own-Key (BYOK) modal

πŸ›‘οΈ Anti-Hallucination & Grounding Resource Architecture

To guarantee that multi-agent workflows never hallucinate unphysical voltages, generator outputs, or non-existent bus IDs, HelioGrid-AI grounds every agent and solver in declarative resource files:


πŸ“‚ Repository Structure

HelioGrid-AI/
β”œβ”€β”€ .github/workflows/ci.yml               # GitHub Actions CI (Ruff + 20 phased pytest tests)
β”œβ”€β”€ assets/                                # High-resolution SVG product banners & UI panel showcases
β”‚   β”œβ”€β”€ hero_banner.svg                    # Product hero header & KPI showcase
β”‚   β”œβ”€β”€ panel_ieee14_topology_and_jev.svg  # IEEE 14-Bus AC topology & System 1 Jev telemetry
β”‚   β”œβ”€β”€ panel_ccpp_shap_and_telemetry.svg  # CCPP thermodynamic twin, SHAP & 48h conformal chart
β”‚   └── panel_karpathy_loop_and_copilot.svg# Karpathy autoresearch lab & System 2 Bedrock copilot
β”œβ”€β”€ docs/                                  # Comprehensive architecture, physics & benchmark docs
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ ETTh1.csv                          # Real Substation 1 active/reactive load & oil temp (17,420 hrs)
β”‚   β”œβ”€β”€ ETTh2.csv                          # Real Substation 2 active/reactive load & oil temp (17,420 hrs)
β”‚   β”œβ”€β”€ ccpp.csv                           # UCI Combined Cycle Power Plant thermodynamic dataset (9,568 hrs)
β”‚   └── benchmark_results.json             # Reproducible empirical benchmark artifacts
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ ccpp_forecaster_champion.pt        # Pre-trained CCPP Thermodynamic Ensemble + PyTorch checkpoint
β”‚   β”œβ”€β”€ grid_load_forecaster_champion.pt   # Pre-trained IEEE 14-Bus Net Load Ensemble + PyTorch checkpoint
β”‚   └── training_manifest.json             # SHA-256 checksums, loss curves, and Year-2 holdout test metrics
β”œβ”€β”€ resources/
β”‚   β”œβ”€β”€ grid_physics_constraints.json      # Immutable IEEE-14, CCPP, and BESS physical bounds
β”‚   └── agent_prompts_and_schemas.json     # Schema-locked Jev System 1 & Bedrock System 2 contracts
β”œβ”€β”€ src/heliogrid/
β”‚   β”œβ”€β”€ config.py                          # Runtime BYOK key manager & resource loaders
β”‚   β”œβ”€β”€ data/                              # ETT, CCPP, and IEEE 14-Bus Newton-Raphson AC power flow twin
β”‚   β”œβ”€β”€ ml/                                # Psychrometric/STL features, BoostedTrees + PyTorch + Registry
β”‚   β”œβ”€β”€ optimization/                      # SLSQP CCPP cooling/vacuum optimizer & constrained AC-OPF + BESS
β”‚   β”œβ”€β”€ decision/                          # TypeSafe Jev (`typesafe/jev-1.13`) Noul/Choice/Score engine
β”‚   β”œβ”€β”€ autoresearch/                      # Karpathy self-recurring loop & persistent experiment ledger
β”‚   β”œβ”€β”€ agents/                            # LangGraph 7-node StateGraph, LangChain @tools & Amazon Bedrock
β”‚   └── api/                               # FastAPI server & Dark-Obsidian Double-Bezel Control Room UI
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ start_dashboard.py                 # CLI & BYOK Control Room launcher (--open-browser, --jev-key, etc.)
β”‚   β”œβ”€β”€ train_models.py                    # Full 9,568-hour training & .pt checkpoint serialization pipeline
β”‚   β”œβ”€β”€ verify_bedrock_live.py             # Live AWS Bedrock & Jev connectivity diagnostic tool
β”‚   β”œβ”€β”€ run_benchmarks.py                  # Reproducible 168-hour AC-OPF & Karpathy loop benchmark suite
β”‚   └── run_autoresearch.py                # Standalone CLI for Karpathy continual learning loop
β”œβ”€β”€ tests/                                 # 7 Phased pytest verification suites (20/20 passing)
β”œβ”€β”€ quickstart.sh                          # One-command setup, model verification & UI launcher
β”œβ”€β”€ Makefile                               # Developer & operator shortcuts (make open, make test, etc.)
β”œβ”€β”€ program.md                             # Karpathy autoresearch declarative specification
β”œβ”€β”€ AGENTS.md                              # Engineering & anti-hallucination rules
└── pyproject.toml                         # Package metadata & dependencies

πŸ§ͺ Testing & Verification

Run the complete 7-phase test suite (20/20 tests covering real datasets, Newton-Raphson AC power flow, hybrid ensembles, SLSQP AC-OPF, TypeSafe Jev System 1 primitives, Karpathy self-recurring loop monotonic improvement, LangGraph + FastAPI endpoints, and .pt checkpoint SHA-256 integrity) and ruff linter:

make test
make lint

πŸ‘€ Author & License

Author: Rishabh Patil (@MrRobotop)
Repository: https://github.com/MrRobotop/HelioGrid-AI
License: Released under the MIT License. Copyright Β© 2026 Rishabh Patil.

About

Autonomous Dual-Process (System 1 TypeSafe Jev + System 2 Amazon Bedrock & LangGraph) Energy Grid & Power Plant Optimization Platform with Karpathy Self-Recurring Loop

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages