Inspiration
Growing cities and technological companies cannot be truly sustainable if the power grids are unreliable. As cities grow, they depend more on electricity for hospitals, transportation, communication, schools, and public services. When the grid fails, critical infrastructure is disrupted and these cities and companies are forced into reactive emergency responses. We built SmartGrid to explore how AI can help cities become more resilient before outages spread.
What it does
That is why I built SmartGrid, a simulation of the San Francisco power grid with an agent that autonomously reroutes energy during grid stress. Its goal is to preserve critical areas by inferring grid health, identifying vulnerable substations, and proactively redirecting power toward infrastructure marked as critical By reducing cascading outages and protecting essential services, SmartGrid helps cities function in a more sustainable and resilient way when power access is threatened. This agent assists the manual operators of today's power grid, and helps by giving them faster insight into grid risk, clearer rerouting recommendations, and explainable decisions before failures spread. This leads to a more sustainable city with less power cascading.
How we built it
We built SmartGrid as a Vercel-first Next.js app using React, TypeScript, Tailwind CSS, and Mapbox for the digital twin interface. To model the grid, we used San Francisco power-grid topology data built from public energy infrastructure sources, including California Energy Commission grid/substation datasets and PG&E-style distribution planning data. We also used CAISO-style demand signals and NOAA-style weather inputs to simulate grid stress from load, temperature, wind, and forecast changes. The app stores this data locally as JSON, with 29 substations and 259 feeder lines powering the simulation. Internal Next.js API routes handle grid nodes, feeder edges, risk signals, cascade simulation, and rerouting logic, while Backboard powers the AI copilot that explains grid decisions and sustainability impact.
Challenges we ran into
One of the biggest challenges was turning raw grid infrastructure data into something usable for an interactive simulation. The topology data had to be cleaned, converted into nodes and feeder edges, and structured so the map could render it clearly. We also had to simplify the architecture after realizing that a separate backend, MongoDB, Gemini, and Google Cloud added too much deployment risk for the hackathon. Moving everything into a Vercel-first Next.js app made the project more reliable, but required rebuilding the API routes, preserving the simulation logic, and making sure the full 29-node and 259-edge dataset still worked correctly. Another challenge was shifting the project toward sustainability without changing the core product too much
Accomplishments that we're proud of
I am proud that I managed to create a full digital twin of San Fransisco in the time that we were given. Additionally, I am happy that we used real world data from PG&E and real San Fransisco weather data.
What we learned
We learned that sustainability is not just about reducing energy use; it is also about making the systems that power cities more reliable and resilient. A city cannot support hospitals, transportation, schools, businesses, and electrification if its grid fails under stress. We also learned how important architecture decisions are in a hackathon. Simplifying SmartGrid into a Vercel-first app made the project more stable, easier to deploy, and easier to explain while still preserving the core grid simulation and AI copilot.
What's next for SmartGrid
Next, we want to make SmartGrid feel even closer to how a real city could use it. That means adding more detailed critical infrastructure data, improving the sustainability scoring, and making the rerouting recommendations more realistic. We also want to expand the simulation beyond San Francisco so other cities could test how prepared their grids are for climate stress, demand spikes, and outages. Long term, SmartGrid could become a decision-support tool that helps grid operators make faster, more explainable choices before small failures turn into city-wide problems.
Log in or sign up for Devpost to join the conversation.