Simulacra
Paste a policy and watch a pixel-art city of AI agents react to it.
- Top committer; Phaser city, round engine
- 3 people
- YHack Spring 2026 — Best Use of K2 Think V2 (IFM), winner
- Python, FastAPI, LangGraph, asyncio, Socket.IO, React, Phaser 3, K2 Think V2
What it is
You give it a policy document. A town of up to 100 AI agents (the population is configurable per run), each with a job, an income and a political lean, lives with that policy round by round. You watch them talk in a pixel-art city, open any one of them to ask what they think and read the economic report at the end.
What I built
- Top committer: 109 of 196 commits.
- During the hackathon, the Phaser front end: a procedural city generator, NPC movement and events, multi-tile cars that stay on roads, and the economic effects (bankruptcies, money, phase flashes, emotion bubbles).

Detail A resident reacting to the policy. - After the hackathon, the two-phase round: initiators act first, and reactors see those events in memory. Also a relationship graph built from profession overlap, income parity, political alignment and grid distance, and retries for the model’s JSON output.
Technical notes
- Every agent in a round runs in parallel with asyncio, through a perceive, retrieve, reflect, plan, act loop in LangGraph.
- An agent reflects once the summed importance of its new memories crosses 25.
- Opinions move by Deffuant bounded confidence and Baumann controversy amplification: an agent keeps its view, compromises or adopts the other’s.
- Results stream over Socket.IO to a React front end. An event bridge keeps the data layer separate from the Phaser 3 world.
- Population and round count are set per run, as parameters of the simulation request rather than constants in the code. Runs go up to 100 agents.




