← all builds

From-Scratch Build · 06 · Civic Tech & Microservices

AI Policy Microservice Stack

Could a government make decisions the way an engineering team ships software — with data pipelines, simulations and dashboards instead of gut feel? This is a modular, open microservice stack for AI-enhanced policy making, rebuilt to learn how civic tech is architected.

MicroservicesData ingestionSimulation MetabaseDecision supportETL

What it is

Lego bricks for policy

This stack is a set of reusable microservices that together support evidence-based policy making: ingest data, simulate scenarios, run analytics, surface it on dashboards, and feed decision-support and strategy agents. The design philosophy is modularity — each capability is an independent module you can adopt on its own.

For me the draw isn't the politics; it's that this is a textbook example of service-oriented architecture aimed at a real domain — complete with the unglamorous-but-essential scaffolding that separates a hobby repo from a serious one: a code of conduct, contributing guide and security policy.

The core idea I wanted to learn: a "platform" is mostly a contract between small services. If ingestion, analytics and dashboards each do one thing and talk over an API, you can grow, swap or scale any one without rewriting the rest.

The stack

Modules & scaffolding

module

Monitor

Dashboards & reporting via Metabase, plus ETL jobs and telemetry — the window into everything else.

module

Ingestion

Pulls raw data in from sources and normalises it so the rest of the stack can use it.

module

Simulation

Models "what if we did X" so a policy can be tested before it touches the real world.

module

Analytics & Agents

Strategy agents and decision-support tools that turn analysed data into recommendations.

interface

API

The seam that lets the modules — and outside clients — talk to each other.

governance

Project hygiene

CONTRIBUTING, CODE_OF_CONDUCT, SECURITY, .env.example — the open-source paperwork that makes a stack reusable.

How it works

From raw data to recommendation

  1. Ingest

    Source data flows into the stack through the ingestion module and gets cleaned up.

  2. Simulate

    Scenario models project the likely effects of candidate policies.

  3. Analyse

    Analytics and strategy agents weigh the outcomes against goals.

  4. Visualise

    The Monitor module renders it all in Metabase dashboards for humans to read.

  5. Decide

    Decision-support tools turn the evidence into a recommendation a policymaker can act on.

Reflection

What rebuilding it taught me