We modeled three Pakistan-relevant zones:
- Jhimpir–Thatta: wind generation and battery storage.
- Karachi industrial cluster: rooftop solar, industrial demand, flexible load, and grid supply.
- Central Punjab load center: high evening demand, solar, grid imports, and higher-cost thermal generation.
The simulation includes local demand, weather-dependent renewable output, generator availability, marginal cost, battery state of charge, simplified transmission limits, and transfer-loss factors. All demonstration values are explicitly labeled simulated.
Forecast agents estimate short-term demand and renewable availability. Local optimization agents then rank resources according to delivered cost:
$$ c_{i,g,t}^{\text{delivered}} =c_{i,g,t}^{\text{generation}} +c_{i,g,t}^{\text{loss}} +c_{i,g,t}^{\text{congestion}} +c_{i,g,t}^{\text{storage}}. $$
The national coordinator minimizes total generation cost, modeled losses, renewable curtailment, unserved demand, and storage degradation:
$$ \min \sum_t \left[ \sum_{i,g} c_{i,g,t}P_{i,g,t} +\lambda_L L_{i,t} +\lambda_C C_{i,t} +\lambda_U U_{i,t} +\lambda_B B_{i,t} \right]. $$
The solution must satisfy supply-demand balance, generator capacity and ramp limits, battery state-of-charge limits, transmission-corridor limits, transformer capacity, and reserve requirements.
We also designed an operator dashboard that displays national balance, delivered cost, renewable share, regional surplus and deficit, recommended transfers, corridor utilization, forecast confidence, and a chronological agent-decision feed. Operators can approve, reject, cap, or revert recommendations.
Challenges we ran into
The first challenge was access to realistic data. Live smart-meter, plant, market, and transmission data is not generally available for a public hackathon. We addressed this with transparent synthetic datasets modeled around plausible operating conditions and clearly separated simulated results from real statistics.
The second challenge was understanding the difference between installed capacity, available capacity, actual energy output, and transferable surplus. A power plant may exist but be unavailable, uneconomic, constrained, or unable to deliver electricity to a particular load center.
Another challenge was balancing local and national objectives. A local agent may reduce its own cost by importing power, but every area cannot import simultaneously. On the other hand, forcing every area to be self-sufficient can waste cheaper energy elsewhere. This led to our two-level architecture.
Safety was also a major challenge. Power infrastructure cannot depend on an unconstrained language model. We separated probabilistic tasks—forecasting, anomaly detection, and explanation—from deterministic optimization and safety rules. Constraint violations are blocked, uncertain decisions are escalated, and operators remain in control.
Finally, we had to compare energy resources fairly. Renewable energy can have a low operating cost, but its value depends on availability, location, storage, curtailment, and the network. We therefore optimize delivered cost instead of assuming that one resource is always cheapest.
Accomplishments that we're proud of
- Turning a broad energy idea into a clear two-level multi-agent architecture.
- Combining forecasting, local dispatch, battery storage, flexible demand, inter-area transfers, and network limits in one workflow.
- Designing for both local responsiveness and national efficiency.
- Building an explainable decision process instead of producing unexplained optimizer outputs.
- Correcting simplistic assumptions about geography and renewable availability by using measured and forecast conditions.
- Treating reliability, safety constraints, and human approval as core product features rather than future additions.
- Creating a realistic path from a hackathon simulation to a controlled microgrid or utility pilot.
What we learned
The most important lesson was that Pakistan's energy challenge is not only about producing more electricity. It is also about coordinating existing assets, moving electricity through a constrained network, and reacting intelligently to distributed resources.
We learned that the cheapest generator is not necessarily the cheapest delivered source. A resource's true value depends on network losses, congestion, location, availability, storage, and reliability.
We also learned that agentic systems work best when each agent has a narrow responsibility and a clear contract. Forecast agents estimate uncertain future conditions, local agents optimize their own areas, the coordination agent solves the system-wide allocation, and the safety layer validates every proposed action.
Most importantly, we learned that AI should support infrastructure operators, not bypass them. Language models are useful for explanation and interaction, but deterministic solvers and electrical constraints must decide whether a schedule is feasible.
What's next for Roshan Grid
Our next step is to validate Roshan Grid inside a controlled environment where operating boundaries and data access are realistic. We plan to progress through:
- A university or hospital microgrid.
- An industrial estate or special economic zone.
- A DISCO feeder cluster with distributed solar and storage.
- A regional digital-twin pilot with a utility or system operator.
Future versions will add probabilistic and contingency-aware optimization, detailed network models, secure telemetry integration, battery degradation models, demand-response contracts, and continuous learning from operator feedback.
Our long-term vision is to create a trusted coordination layer that helps Pakistan reduce delivered electricity costs, use more renewable energy, lower curtailment and losses, and improve reliability—without compromising safety or operator control.
Built With
- canva
- docker
- fastapi
- figma
- github
- langgraph
- machine-learning
- mathematical-optimization
- multi-agent
- next.js
- numpy
- openai
- pandas
- postgresql
- pulp
- python
- react
- sickit-learn
- tailwind-css
- typescript
- websockets
Log in or sign up for Devpost to join the conversation.