The first application of Multi-Agent Transformer (MAT) architecture to real-time energy digital twins β enabling zero-shot cooperative dispatch across arbitrary grid topologies.
View the AlgoFest 2026 Presentation (Google Drive)
- Frontend Control Room: https://gridwala-nexusgrid-frontend.onrender.com
- Backend Health/API: https://gridwala-nexusgrid-backend.onrender.com/status
Share the frontend link with judges as the main experience. The backend link is included only for technical verification. On free Render, the first load after inactivity may take a short cold-start delay.
Modern energy grids are decaying under the weight of their own complexity. As we transition to distributed energy resources (DERs), energy supply has become volatile, decentralized, and entirely unpredictable.
Current industry tools fail catastrophically because:
- They rely on human-authored static heuristics that cannot scale.
- They depend on pre-trained machine learning models that instantly degrade during physical grid anomalies (data drift).
- They are blind to the underlying physical constraints of the grid.
The exact problem: The grid is no longer a predictable top-down utility; it is an infinitely complex mathematical graph, and we lack the dynamic intelligence to orchestrate it.
NEXUS GRID is a groundbreaking, mathematically advanced digital twin and autonomous control operating system.
We instantly generate a live topological twin of any city, inject real-world telemetry, and unleash a swarm of Non-Pretrained Reinforcement Learning Agents (specifically, Multi-Agent Transformers with QMIX value decomposition) to autonomously balance the gridβenabling emergent cooperative energy dispatch with zero-shot generalization to unseen grid configurations.
Our core innovation is Adaptive Multi-Agent Control, a topology-aware control framework that can shift coordination strategy as grid conditions change instead of binding the system to one static controller family. NexusGrid models the district as a Decentralized Partially Observable MDP (Dec-POMDP) over a dynamic graph
At the architectural level, this is compatible with Multi-Agent Transformer-style sequence coordination and QMIX-style monotonic value decomposition [1] [2], where local agent utilities can be composed into a globally aligned dispatch objective while preserving decentralized actionability. In practical terms, the system is designed to fall back or switch policy posture when the grid demands a different control regime, rather than forcing one brittle policy to operate across every market, weather, and topology state.
Mathematically, the control objective can be written as a constrained cooperative optimization:
with a reward shaped around cleaner dispatch, lower stress, and continuity of service:
Instantly maps any geographic coordinate into a structured, executable mathematical graph (nodes = buildings/DERs, edges = physical feeders) via NetworkX.
The twin is completely live β it independently ingests real-time carbon intensity, wholesale electricity pricing, and stochastic weather forecasts via robust API websockets.
The core autonomous engine. Each DER node is a token. Self-attention learns inter-agent dependencies. QMIX ensures decentralized execution with global optimality guarantees. No pre-training required.
Operators inject arbitrary shocks β EV load spikes, cascading feeder failures, heatwaves β and watch the MAT policy adapt and self-heal via emergent attention-based coordination.
An elite Next.js spatial interface with real-time WebSocket telemetry, glassmorphism, Framer Motion transitions, and an AI Rationale feed for deep observability into the policy's reasoning.
nexusgrid/
βββ agents/
β βββ mat_policy.py β Multi-Agent Transformer (primary policy)
β βββ qmix_mixer.py β QMIX monotonic value decomposition
β βββ baselines/
β βββ dqn_agent.py β Independent DQN (ablation baseline)
βββ core/
β βββ environment.py β NexusGridEnv (Dec-POMDP physics engine)
β βββ topology.py β Dynamic graph generation (NetworkX)
β βββ simulation_runner.py β Async simulation orchestrator
β βββ schema_loader.py β Grid topology schema parser
| Layer | Stack |
|---|---|
| Policy Architecture | Multi-Agent Transformer (MAT) + QMIX, PyTorch |
| Physics Simulation | FastAPI (Python 3.11+), Uvicorn, NetworkX, AsyncIO |
| Command & Control | Next.js 14, React 18, TypeScript, TailwindCSS |
| Real-Time Middleware | WebSockets (bi-directional JSON streams) |
| Visualization | Framer Motion, Recharts |
API Keys: The system hooks into Electricity Maps and EPEX SPOT for live telemetry, but you can leave
.envkeys blank β the backend falls back to its internal stochastic mock-data engine automatically.
If you only want to review the project, open:
https://gridwala-nexusgrid-frontend.onrender.com
Prerequisites: Python 3.11+ and Node.js 20+
Windows:
start.batMac/Linux:
chmod +x start.sh && ./start.shThe boot scripts automatically:
- create the backend virtual environment if needed
- install backend dependencies including
torch - install frontend dependencies
- start the backend on
http://localhost:8000 - start the frontend on
http://localhost:3000
Backend:
cd nexus-grid/backend
python -m venv venv
source venv/bin/activate # (or venv\Scripts\activate on Windows)
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8000Frontend:
cd nexus-grid/frontend
npm install && npm run dev- Wen et al., "Multi-Agent Reinforcement Learning is a Sequence Modeling Problem", NeurIPS 2022. arXiv:2205.14953
- Rashid et al., "Monotonic Value Function Factorisation for Deep Multi-Agent RL", ICML 2020. arXiv:2003.08839
- Yu et al., "The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games", NeurIPS 2022. arXiv:2103.01955
- Schulman et al., "Proximal Policy Optimization Algorithms", 2017. arXiv:1707.06347
| Document | Description |
|---|---|
| Execution Roadmap | Phase-by-phase engineering execution plan |
| Architecture Diagram | Full system architecture (Mermaid) |
| Deployment Guide | Render cloud deployment instructions |
MIT β Built for AlgoFest Hackathon 2026.