Industrial-grade open-source edge gateway for secure, AI-optimized Battery Energy Storage System (BESS) management.
Self-evolving arbitrage intelligence · IEC 62443 · IEC 61850 · IEEE 2030.5 · NTSyCS Chile
Documentation · Quick Start · Discord · BEP Proposals · Roadmap
BESSAI is a production-ready edge computing platform that sits between your Battery Energy Storage System hardware and cloud infrastructure. It handles:
- Real-time telemetry collection from inverters and BMS (Modbus TCP, IEC 61850, IEEE 2030.5)
- AI-powered dispatch decisions via a DRL arbitrage agent (ONNX inference, no cloud required)
- Autonomous self-improvement via BESSAIEvolve — an AlphaEvolve-inspired weekly evolution loop
- Safety enforcement with IEC 62443 SL-1 compliant guardrails
- Multi-cloud publishing to GCP Pub/Sub, MQTT, OpenTelemetry
Reference deployment: 200kWh / 100kW Huawei SUN2000 BESS, Santiago Chile — arbitraging the Chilean SEN spot market (CMg) in production since 2025.
graph TB
subgraph Hardware["⚡ BESS Hardware"]
INV[Inverter<br/>Huawei · SMA · Victron · BYD · Tesla]
BMS[BMS / Battery Pack]
end
subgraph Edge["🖥️ Edge Gateway (BESSAI)"]
DRV[Protocol Drivers<br/>Modbus TCP · IEC 61850 · IEEE 2030.5]
SG[SafetyGuard<br/>IEC 62443 SL-1]
AI[AI Engine]
subgraph AI["🤖 AI Engine"]
IDS[AI-IDS<br/>IsolationForest]
DRL[DRL Agent<br/>PPO ONNX]
EVO[BESSAIEvolve<br/>Weekly μ+λ Evolution]
end
TEL[Telemetry Layer<br/>Prometheus · OpenTelemetry · MQTT]
end
subgraph Cloud["☁️ Cloud"]
GCP[GCP Pub/Sub]
PROM[Prometheus + Grafana]
OT[Cloud Trace]
end
subgraph Market["📈 Market"]
CMG[CEN Chile CMg API<br/>Real-time spot price]
end
INV -->|Modbus TCP| DRV
BMS -->|RS485 / TCP| DRV
DRV --> SG
SG --> AI
CMG -->|30-day history| EVO
AI --> TEL
TEL --> GCP
TEL --> PROM
TEL --> OT
sequenceDiagram
participant HW as BESS Hardware
participant DRV as Driver
participant SG as SafetyGuard
participant DRL as DRL Agent (ONNX)
participant MKT as CMg Market
participant PUB as Publishers
HW->>DRV: Poll telemetry (5s)
DRV->>SG: BatteryState {soc, temp, power}
SG-->>DRL: ✅ Safe to dispatch
MKT-->>DRL: CMg price forecast
DRL->>SG: Proposed setpoint p_pu ∈ [-1, 1]
SG->>SG: Validate SOC bounds + thermal limits
alt safe
SG->>HW: Write power setpoint
else violation
SG->>HW: Hold (0 kW)
SG->>PUB: safety_violation alert
end
SG->>PUB: Telemetry + metrics
PUB->>PUB: Prometheus / GCP / MQTT / OTel
graph LR
subgraph Inverters
HW[Huawei SUN2000<br/>✅ Production]
SMA[SMA Sunny Tripower<br/>✅ Tested]
VIC[Victron MultiPlus<br/>✅ Tested]
FRO[Fronius Symo<br/>✅ Tested]
SE[SolarEdge StorEdge<br/>✅ Tested]
end
subgraph Batteries
BYD[BYD Battery Box<br/>✅ Tested]
TES[Tesla Powerwall<br/>✅ Tested]
end
subgraph Pending["🔵 Roadmap (BEP-0202)"]
ABB[ABB PCS100]
SCH[Schneider Conext]
GE[GE Grid Solutions]
end
DRIV[BESSAI Protocol Drivers]
HW & SMA & VIC & FRO & SE & BYD & TES -->|Modbus TCP| DRIV
Note to contributors: the screenshots/GIFs below are placeholders. We welcome PRs that add real captures.
See docs/CONTRIBUTING_MEDIA.md for recording guidelines.
| # | What to capture | Tool | Priority |
|---|---|---|---|
| 1 | docker compose up boot sequence — all services healthy |
asciinema | 🔴 High |
| 2 | Grafana dashboard: SOC curve + CMg price overlay | Screen recording → GIF | 🔴 High |
| 3 | make simulate running with live telemetry output |
asciinema | 🟡 Medium |
| 4 | BESSAIEvolve GitHub Actions run + auto-PR creation | Screenshot | 🟡 Medium |
| 5 | Raspberry Pi 4 running BESSAI (htop + make health) |
Photo + terminal | 🟢 Nice |
| 6 | IEEE 2030.5 DERControl endpoint responding to curl | asciinema | 🟢 Nice |
¿Quieres desplegar BESSAI en una instalación real?
| Quiero... | Recurso |
|---|---|
| 🗺️ Elegir mi camino de adopción | ADOPTER_HUB.md |
| ⚡ Demo en 5 min (sin hardware) | tutorials/quickstart_5min.md |
| 📅 Roadmap Día 0 → Producción | ONBOARDING_7DAYS.md |
| ❓ FAQ técnica (hw, mercados, licencia) | FAQ.md |
| 🛡️ Programa Early Adopters (soporte prioritario) | early_adopters.md |
| 🆘 Soporte durante el onboarding | Abrir issue |
git clone https://github.com/bess-solutions/open-bess-edge.git
cd open-bess-edge
bash scripts/setup.sh # 5 preguntas → genera config/.env listomake dev # instala dependencias + pre-commit hooks
bash scripts/setup.sh # genera config/.env
make simulate # arranca con simulador integrado
make health # verifica que todo está activogit clone https://github.com/bess-solutions/open-bess-edge.git
cd open-bess-edge
bash scripts/setup.sh # genera config/.env con parámetros de tu sitio
docker compose -f infrastructure/docker/docker-compose.yml --profile simulator --profile monitoring up -dGrafana → http://localhost:3000 (credenciales: ver GF_SECURITY_ADMIN_PASSWORD en config/.env)
Metrics → http://localhost:8000/metrics
Health → http://localhost:8000/health
# On the Pi (arm64):
docker pull ghcr.io/bess-solutions/open-bess-edge:latest
docker run -d \
--name bessai \
--env-file .env \
-p 8000:8000 \
ghcr.io/bess-solutions/open-bess-edge:latestFull Raspberry Pi guide: docs/quickstart_rpi.md
Open in VS Code → Reopen in Container — all dependencies, pre-commit hooks, and the simulator start automatically.
| Feature | Description | BEP |
|---|---|---|
| Multi-protocol drivers | Modbus TCP, IEC 61850, IEEE 2030.5 / SEP 2.0 | BEP-0100 |
| Hardware profiles | 7 certified profiles (Huawei, SMA, Victron, BYD, Tesla…) | – |
| SafetyGuard | SOC/thermal/power bounds — blocks unsafe commands | – |
| AI-IDS | Real-time anomaly detection (IsolationForest + z-score) | – |
| DRL Arbitrage Agent | PPO + 8 CEN ONNX models — <0.1ms, no cloud required | BEP-0200 |
| BESSAIEvolve | AlphaEvolve-inspired weekly self-improvement loop | BEP-0303 |
| VPP Fleet Manager | Multi-site VPP: FleetOrchestrator + DRL per-site | BEP-0500 |
| SENMarketFeed | Live CEN prices: DuckDB → HTTP → Duck Curve fallback (TTL 15min) | BEP-0500 |
| FL Coordinator | Federated Learning FedAvg (capacity-weighted), L2 convergence | BEP-0600 |
| HVDC Scheduler | Inter-regional DC power flow arbitrage (500MW, 1.8% losses) | BEP-0700 |
| CMg Live Feed | Real-time Chilean SEN spot price ingestion | BEP-0302 |
| Explainable AI (XAI) | SHAP-based decision explanations | BEP-0301 |
| OpenTelemetry | Distributed traces + metrics to GCP / Datadog / Grafana | – |
| Global Market Adapters | CAISO · ERCOT · ENTSO-E · SEN · COES · XM · CENACE | – |
| Multi-arch Docker | amd64 + arm64 (Raspberry Pi 4/5 native) | – |
| IEC 62443 SL-1/2 | Full control mapping — SL-2 compliant | – |
| Standard | Status | Evidence |
|---|---|---|
| IEC 62443 SL-1 | ✅ Compliant | iec62443_mapping.md |
| IEC 62443 SL-2 | ✅ Compliant | SL2SecurityGate — RBAC + HMAC-SHA256 |
| NTSyCS Cap. 4.2 | ✅ GAP-001 | Ramp rate ≤10%/min (SafetyGuard) |
| NTSyCS Cap. 4.3 | ✅ GAP-002 | PFR droop < 2s (FrequencyResponseAgent) |
| NTSyCS Cap. 4.4 | ✅ GAP-011 | Q/V droop (ReactiveController) |
| NTSyCS Cap. 6.1 | ✅ GAP-003 | mTLS telemetría CEN (CENPublisher) |
| NTSyCS Cap. 6.2 | ✅ GAP-004 | SCADA IEC 60870-5-104 (IEC104Driver) |
| NTCSE | ✅ GAP-010 | THD/Flicker gate (PowerQualityMonitor) |
| Decreto 88/2023 | ✅ GAP-007 | Anti-arbitrage PMGD (PMGDComplianceEngine) |
| Ley 21.185 | ✅ GAP-008 | CER para CNE (ERNCRegistry) |
| Ley 21.663/2024 | ✅ | CSIRT ≤3h (SecurityNotifier) |
| IEEE 2030.5 / SEP 2.0 | ✅ 10 endpoints | BEP-0100 |
| Apache 2.0 SPDX | ✅ All source files | LICENSE |
| Status | What | Version |
|---|---|---|
| ✅ Done | IEC 62443 SL-1/2 · OpenSSF · BEPs 0100–0303 · BESSAIEvolve v1 | v2.10.0–v2.12.0 |
| ✅ Done | 8 CEN DRL ONNX models · PPO trainer · Global Market Adapters (CAISO, ERCOT, ENTSO-E) | v2.14.0 |
| ✅ Done | VPP Fleet Manager (BEP-0500) · SENMarketFeed CEN live · Multi-site ONNX DRL dispatch | v2.15.0 |
| ✅ Done | FL Coordinator (BEP-0600) · FedAvg capacity-weighted · L2 convergence · 799 CI tests | v2.16.0 |
| ✅ Done | HVDC Scheduler (BEP-0700) · DC power flow · 500MW · inter-regional price arbitrage | v2.16.0 |
| 🔵 Planned | Flower (flwr) integration for FL · gRPC + mTLS FL protocol | v2.17.0 |
| 🔵 Planned | VPP HTTP real dispatch (mTLS SiteProxy) · HVDC TSO integration | v2.18.0 |
| 🔵 Planned | P2P Energy Trading · LCA Engine · Carbon Dashboard | 2027 |
See full roadmap: docs/ROADMAP.md
BESSAI autonomously improves its arbitrage policy every week using an evolutionary algorithm inspired by AlphaEvolve (DeepMind, 2025):
Every Monday 00:00 UTC:
1. Fetch **39 months / 111,100 datapoints** of real CMg price data (4 SEN nodes — CEN Chile API + DuckDB)
2. Generate 10 policy candidates (Gaussian mutation)
3. Evaluate each in a 8,640-step sandbox (30 days × 288 timesteps)
4. Select parents via tournament → produce next generation
5. Repeat for 5 generations → if best > +5% + 0 safety violations
6. Open a PR automatically for human approval
→ Full explanation: docs/BESSAI_EVOLVE.md · Spec: BEP-0303
open-bess-edge/ ← PUBLIC (Apache 2.0)
├── src/core/
│ ├── safety_guard.py # IEC 62443 SL-1/2 SOC/thermal guardrail
│ ├── compliance_stack.py # 11 GAPs NTSyCS
│ ├── vpp_fleet_manager.py # BEP-0500: VPP multi-site + ONNX DRL dispatch
│ ├── sen_market_feed.py # BEP-0500 P2: CEN live price (DuckDB → duck-curve)
│ ├── fl_coordinator.py # BEP-0600: Federated Learning FedAvg coordinator
│ ├── hvdc_scheduler.py # BEP-0700: HVDC inter-regional DC power flow
│ ├── market_adapter.py # 7 global markets (SEN, CAISO, ERCOT, ENTSO-E…)
│ └── ... # SafetyGuard, AI-IDS, BESSAIEvolve, XAI…
├── tests/ # 799 tests (pytest) · 0 failures · CI/CD
├── docs/bep/ # BEP-0001 → BEP-0700 (10 proposals)
├── docs/compliance/ # IEC 62443, NTSyCS, IEEE 2030.5
├── .github/workflows/ # CI/CD + weekly BESSAIEvolve
├── infrastructure/ # Terraform GCP (18 resources)
└── CHANGELOG.md
bess-solutions/bessai-core ← PRIVATE (Proprietary)
├── src/agents/ # 16 AI modules (MARL, MILP, DRL, evolution)
├── src/interfaces/ # fl_client.py, fl_server.py (Federated Learning)
└── models/ # dispatch_policy.onnx (trained PPO)
Contributions are welcome. BESSAI follows the BEP process for significant changes.
git checkout -b feature/my-feature
make test # must pass before PR
make lint # ruff + mypy + bandit
git commit -m "feat(scope): clear description"
gh pr create- Good First Issues → docs/GOOD_FIRST_ISSUES.md
- Hardware profile contribution → docs/tutorials/hardware_profile_contribution.md
- Bug reports → GitHub Issues
- Security vulnerabilities → SECURITY.md (private disclosure)
- Design discussions → GitHub Discussions
| Channel | Purpose |
|---|---|
| Discord | Real-time chat, support, showcase |
| GitHub Discussions | RFCs, design decisions, Q&A |
| GitHub Issues | Bugs and feature requests |
Apache 2.0 — see LICENSE.
SPDX headers in all source files. Third-party attributions in NOTICE.
🇨🇱 Versión en Español
Gateway industrial de código abierto para gestión segura y optimizada de activos BESS.
BESSAI es una plataforma de computación en el borde (edge) que conecta tu sistema de almacenamiento de energía (BESS) con la infraestructura cloud. Sus capacidades principales:
- Drivers industriales: Modbus TCP, IEC 61850, IEEE 2030.5 / SEP 2.0
- IA en el borde: Agente DRL (PPO) para arbitraje en el mercado spot chileno (CMg)
- Auto-mejora: BESSAIEvolve — bucle evolutivo semanal inspirado en AlphaEvolve (DeepMind)
- Seguridad industria: SafetyGuard compatible IEC 62443 SL-1 + NTSyCS CEN Chile
- Observabilidad: Prometheus, Grafana, OpenTelemetry, GCP Pub/Sub
Despliegue de referencia: BESS 200kWh / 100kW Huawei SUN2000, Santiago de Chile — en producción desde 2025.
git clone https://github.com/bess-solutions/open-bess-edge.git
cd open-bess-edge
make dev
make simulate- Inicio rápido (5 min)
- Raspberry Pi 4/5
- BESSAIEvolve — IA que se mejora sola
- Cumplimiento IEC 62443
- Cumplimiento NTSyCS CEN Chile
- Discord en español — canal
#español - Reportar un bug
- Proponer mejora (BEP)