AI Town
Open-source starter kit for a town of chatting AI characters

- Best for
- Developers who want working code for a simulation where many LLM-driven characters move, talk and remember
- Makes
- A browser-based 2D pixel-art world of AI characters that you can rename, restyle and extend
- Made by
- a16z (a16z-infra)
- Where you use it
- Web
- Engines
- Web
- Pricing
- Free and open source (MIT); you pay for any hosting and cloud model use, or run models locally with Ollama
- Free plan
- Yes
- Open source
- Yes (MIT)
- Export
- You own the code and can deploy it to Convex cloud, a self-hosted Convex backend in Docker, or Fly.io
- Status
- Available
AI Town is an open-source starter kit published by a16z-infra on GitHub for building a small virtual town whose residents are AI characters that wander, hold conversations and form relationships. The README credits the 2023 research paper Generative Agents: Interactive Simulacra of Human Behavior as its inspiration and says the project is written in JavaScript and TypeScript because most comparable simulators use Python.
Convex provides the backend: shared game state, the simulation loop, the database and the vector search behind each character's memory. PixiJS draws the 2D world in the browser. Out of the box, chat and embeddings run on your own machine through Ollama with Llama 3, and the README shows how to point it at OpenAI, Together.ai or another OpenAI-compatible API instead. Players can step into the world as a character through an Interact button.
To make it your own, you edit character backstories and sprite sheets in a data file and draw a new map in the Tiled editor, then convert it with a bundled script. Background music from MusicGen via Replicate and sign-in through Clerk are optional.
The code is MIT-licensed and free; what you spend depends on hosting and model choices. It suits developers prototyping AI NPCs or social simulations who want a working multi-agent loop to build on, not an engine plugin. A live demo is hosted on Convex's site. AIGamer has not tested it.
Limitation: Built around the Convex backend; the README says the simulation pauses after 5 minutes of idle browser time and that changing character data means wiping and reloading the database
FAQ
Is AI Town free?
Yes. The code is MIT-licensed on GitHub. You can run it locally with Ollama at no model cost, or pay for cloud hosting and API models if you choose them.
What does AI Town need to run?
Node.js and a Convex backend, either Convex's cloud (which needs a free account) or a self-hosted Convex container via Docker Compose, plus a language model through Ollama or an OpenAI-compatible API, per the README.
Can I use AI Town characters in Unity or Godot?
Not directly. AI Town is a self-contained web app built on Convex and PixiJS. Its code shows one way to give characters memory and conversations, which you would have to port to another engine yourself.
Sources
Compiled by AIGamer from AI Town's own pages and the sources below, checked 2 November 2026. We haven't tested AI Town hands-on.
- AI Town on GitHub: README
- AI Town on GitHub: License (MIT)
- AI Town on GitHub: InteractButton.tsx (join the world)
- Convex: AI Town live demo
- arXiv: Generative Agents: Interactive Simulacra of Human Behavior
Image: a16z-infra / AI Town
Written in our own words; quotes are marked and credited. How we report