GreenO
Orchestrate your energy
The problem GreenO solves
GreenO solves a critical challenge facing modern manufacturing: how to maximize renewable energy utilization while optimizing operational costs and minimizing carbon footprint in real-time.
For factory operators and energy managers:
- Real-time Energy Routing: Intelligently directs solar power to HVAC systems, essential machinery, and battery storage based on instantaneous grid prices and carbon intensity
- Automated Optimization: Eliminates manual energy scheduling guesswork with RL-driven agents that continuously learn and adapt to operational patterns
- Cost Savings: Arbitrage opportunities between battery storage and grid pricing can reduce energy costs by 20-30%
- Carbon Accountability: Tracks grid carbon intensity and prioritizes renewable consumption, supporting ESG reporting and regulatory compliance
- Subscription-Protected Analytics: Enterprise-grade analytics dashboards with real-time SSE streaming, protected subscription verification, and audit trails for compliance
Without GreenO: Factories either overspend on grid energy, underutilize solar capacity, or rely on static rule-based systems that can't adapt to market changes. With GreenO, energy decisions become intelligent, data-driven, event-driven, and continuous.
Challenges we ran into
Challenge 1: RL Model Training for Time Series Data & Data Leakage Prevention
Problem: Training RL agents on factory energy time series introduced critical data leakage:
- Future Information Leakage: Agents saw future grid prices and solar output, making decisions unrealistically perfect
- Temporal Dependencies: During training the timeseries data is continues in timestamp but in our system the infranceing of RL agent is uneven.
- Distribution Shift: Training on 2023 data vs. 2026 production patterns with different renewable penetration
- Episode Boundaries: Day/night cycles and factory operating hours were ignored
Solution: Strict temporal validation framework:
-
Time-Aware Data Splitting:
- Training: Jan-Aug 2023 | Validation: Sep-Oct 2023 | Test: Nov-Dec 2023 (sine of temporal features)
- Temporal boundaries enforced in
greeno_orchestrator.onnx
-
Causal Windowing:
- Agent observes only current window
- Future features (solar_forecast, grid_price) explicitly excluded
- Realistic 3-5 ms action latency
-
Episode Segmentation:
- Split trajectories at midnight (reset battery assumptions)
- Separate training for peak (06:00-22:00) vs. off-peak (22:00-06:00) hours
- Stratified sampling across seasons
-
Distribution Shift Mitigation:
norm_stats.npzstores 2023 mean/std with monthly retraining triggers- Novelty detection for out-of-distribution states (>80% solar penetration)
-
Validation Metrics:
- Leakage detector: Evaluate on shuffled future timesteps (performance should drop)
- Causality check: Mask future features and measure reward degradation
- Production sim: Test on 2026 data with distribution shifts
Challenge 2: Real-time RL Orchestration with Event-Driven Architecture
Problem: Integrating ONNX-based RL models with real-time decision-making across a distributed event bus required careful orchestration. The RL agent needed to:
- Process streaming telemetry data without blocking
- Generate optimized decisions within <100ms
- Propagate decisions through Kafka for async consumption
- Handle variable input states (weather, grid prices, battery SOC)
Solution: Implemented an event-driven orchestration pipeline:
- Telemetry events trigger RL inference via FastAPI
- Decision events published to Kafka topic
- Express backend consumes decisions from Kafka consumer group
- Real-time decision streaming to frontend via SSE
Used ONNX Runtime for sub-10ms inference and normalized state preprocessing (SB3 epsilon clipping) to handle edge cases.
Challenge 3: Kafka Integration for Decision Propagation
Problem: Kafka consumer lag and exactly-once semantics were critical since energy decisions can't be missed or duplicated.
Solution: Implemented consumer groups with offset management:
- Each RL decision assigned unique monotonic timestamp
- DuckDB stores decision outcomes for idempotency checks
- Graceful handling of late-arriving events (within 5-minute window)
- Monitoring dashboard tracks Kafka lag across producers/consumers
This ensured 100% decision delivery without duplication across concurrent streams.
Tracks Applied (1)
