Inspiration

Policy that affects millions is decided by whichever story sells. Politicians are rewarded for emotional narratives that win votes — the anecdote, the villain, the slogan — and the policy is shaped to fit the narrative rather than the evidence. Predictive, data-driven insight either arrives after the decision is made or never enters the room at all.

Aviation has flight simulators. Finance has backtesting. Government is the last high-stakes sector that doesn't rehearse. We built GovSim as a "Flight Simulator for Governance" to crash-test policies in simulation before they fail in reality.

What it does

GovSim is a Society Digital Twin that lets policymakers run the policy before they run the country, simulating 10-year counterfactual outcomes in seconds.

  • The Core (Deterministic): Statistical models and microsimulations calculate hard fiscal impact, GDP metrics, and spatial assignment.
  • The Shell (Generative): Multi-agent LLM systems simulate parliamentary debate, media headlines, and public sentiment.
  • Devil's Advocate Engine: Automatically hunts for policy loopholes, perverse incentives, and political backlash under stress scenarios (e.g. recession).
  • Timeline Scrubber: A 10-year interactive slider that morphs a 3D geospatial city map in real time based on simulation outputs.

How we built it

  • Frontend: Next.js 14, TypeScript, deck.gl 9 (3D extruded footprints), and MapLibre.
  • Backend Engine: Multiple server processes, WSGI server, Render PaaS, Gunicorn WSGI process manager, Python 3.11 and FastAPI managing a local MongoDB layer for zero data export.
  • Databases: MongoDB Atlas Version: 8.0.29 myAtlasClusterEDU; Aiven PaaS, PostgreSQL Version: 18.4
  • Data & ML: PyTorch (LSTM models for horizon forecasting), scikit-learn (logistic regression, SVMs, isolation forests), and live OpenStreetMap/GTFS feeds.

  • Architecture Rule: LLMs parse policy and handle qualitative political "noise," but never generate a quantitative number.

Challenges we ran into

  • The Pivot Penalty: We burned our first 12 hours on a computer vision project. Nothing was wrong with it technically — it was simply a space that has been built out a hundred times over. We scrapped it mid-sprint for the harder bet: something genuinely new, that nobody had built, with the scale of impact to justify the risk.
  • Model Hierarchy: Our hardest engineering problem was stopping the language model from taking precedence over the ML prediction models. LLMs are fluent enough to sound authoritative about numbers they never computed, and left unconstrained they will happily overwrite a forecast with a plausible sentence. We had to structurally subordinate them: the ML layer cleans the data, runs the predictions, and emits strict JSON; the LLM is only ever allowed to read that JSON and narrate it. It sits outside the path that produces a number.
  • Data Normalization: Forcing unstructured real-world datasets into those strict JSON schemas — so every engine could ingest the same contract — was a massive bottleneck.
  • Timezone Relay: Coordinated four teammates across four timezones using "just-woke-up proof" handover docs to maintain a 24/7 dev loop.
  • AI Rigor: Enforced an Epistemic Framework tagging every output as Observed, Estimated, Simulated, or Generated to prevent hallucinated futures.

Accomplishments that we're proud of

  • Vertical Slice in 48 Hours: Shipped a working end-to-end simulation connected to interactive 3D visualizers.
  • Visual Identity: Built a high-precision Obsidian & Phosphor Green terminal interface.
  • Core/Shell Split: Decoupled LLM political reactions from quantitative economic signals.

What we learned

  • "Safe" is boring: Scrapping a comfortable, well-trodden project mid-sprint was painful, but hunting for genuine white space is the only reason GovSim exists.
  • Certainty is an illusion: Presenting a 100% confident 10-year forecast is flawed; honest engineering requires plotting the widening margin of error over time.
  • Asynchronous Discipline: Timezone gaps forced us to maintain rigorous documentation and clear system boundaries.

What's next for GovSim

  • Open-Source Core: Releasing our deterministic simulation engine for global academic review.
  • Government Pilots: Partnering with regional authorities on real-world housing, transit, and tax policies.
  • Expanded Data Fabric: Ingesting real-time census, environmental, and transit streams into our global policy ledger.

The simulation is ready. Are you?

Built With

  • 3d-geospatial-visualization
  • deck.gl
  • fastapi
  • gtfs
  • isolation-forest
  • json-schema
  • llm-orchestration
  • logistic-regression
  • lstm
  • maplibre
  • microsimulation
  • mongodb
  • multi-agent-systems
  • next.js
  • openstreetmap
  • overpass-api
  • python
  • pytorch
  • rest
  • scikit-learn
  • spatial-data
  • support-vector-machines
  • system-dynamics
  • time-series-forecasting
  • typescript
Share this project:

Updates