A tiny town where LLMs pretend to be people
It turns OpenAI’s API into a cast of LLM-driven agents who simulate believable human behavior in a shared, replayable world.

What it does
This is the code behind the Generative Agents paper. It runs a browser-based simulation, Smallville, where LLM-backed agents wander a 2D map, maintain a memory stream, and generate believable behaviors. You pick a starter scenario, let the clock run in ten-second steps, and watch the agents generate behaviors that you can later replay or compress into a demo.
The interesting bit
The agents don’t just roleplay in a vacuum; they carry authored history files—semicolon-separated memory records injected at boot—that populate their memory stream. The whole system is essentially a Django frontend bolted to a Python backend that repeatedly asks an LLM what a pixel person should do next.
Key highlights
- Ships with two base scenarios: a 25-agent town or a focused three-agent setup featuring Isabella, Maria, and Klaus.
- Agent histories are loaded via CSV files that inject semicolon-separated memory records into each agent’s
memory stream. - Raw replays are explicitly labeled as debugging aids where every sprite looks identical; proper demos require a separate compression step.
- Expanding the town or renaming characters means editing the map in the Tiled editor and authoring new base simulation folders.
Caveats
- OpenAI API rate limits can hang the simulation, forcing a restart; the authors note that running many agents was “somewhat costly” even in early 2023.
- Firefox may produce frontend glitches; Chrome or Safari are the recommended browsers.
- The README reads like a quickstart manual, so the deeper mechanics of memory retrieval and behavior generation are left to the paper.
Verdict
Worth cloning if you’re studying LLM-based human behavior simulation or need a reproducible baseline for multi-agent experiments. Avoid if you want a polished engine or anything that runs cheaply without an OpenAI key.
Frequently asked
- What is joonspk-research/generative_agents?
- It turns OpenAI’s API into a cast of LLM-driven agents who simulate believable human behavior in a shared, replayable world.
- Is generative_agents open source?
- Yes — joonspk-research/generative_agents is open source, released under the Apache-2.0 license.
- How popular is generative_agents?
- joonspk-research/generative_agents has 21.8k stars on GitHub and is currently holding steady.
- Where can I find generative_agents?
- joonspk-research/generative_agents is on GitHub at https://github.com/joonspk-research/generative_agents.