What is the AI Town game?
AI Town is a small pixel-art town where AI characters live, chat and make friends on their own. You mostly watch. It is also free, open-source code that developers copy and change to make their own AI town game.
The GitHub README calls it “a deployable starter kit for easily building and customizing your own version of AI town.” So AI Town is two things. It is a demo that you can open in a browser. It is also a code base for developers.
Each AI character has a name, a short story and a sprite. A language model writes what each character says. The characters walk around the map, start conversations and remember earlier talks. The code also lets a human join the town and talk to the characters.
AI Town is not a finished game with goals, levels or a story to complete. It is a sandbox to watch and to build on. For finished games with AI people, read our guide to Game AI.
You read this on the LifeSim blog. We make LifeSim, a different game with AI people. We say where it fits near the end, and where it does not.
Who made AI Town?
A team from a16z (Andreessen Horowitz) and Convex made AI Town in 2023. The code is on GitHub under the a16z-infra account, and Convex runs the backend.
The Cognitive Revolution podcast talked to the team in September 2023. In that episode, Yoko Li, a partner at a16z, started the project. Martin Casado, a general partner at a16z, called it “actually a hobby project by Yoko.” James Cowling, the CTO of Convex, helped to build it. A Convex developer made the game engine on the server.
The idea came from an earlier companion app by Yoko Li. That app gave one AI character a memory and a personality. People then asked what happens when many AI characters meet. AI Town was the answer.
What does Convex do in AI Town?
Convex is the game engine, the database and the vector search, the README says. Convex keeps the state of the town and runs the simulation. The vector search finds old memories that match the current conversation.
The README also lists the rest of the stack. PixiJS draws the town. Ollama runs the default chat model, llama3, on your own computer. Clerk login is optional.
Is AI Town open source?
Yes. The license file in the repo is the MIT License, with the line “Copyright (c) 2023 a16z-infra.” You can copy, change and sell the code. Keep the license text in your copy.
Is AI Town based on the Stanford Smallville paper?
Yes. The README says AI Town is “inspired by” the paper “Generative Agents: Interactive Simulacra of Human Behavior.” That paper put 25 AI characters in a small town called Smallville.
Joon Sung Park and five other researchers wrote the paper. Four of them were at Stanford University. The other two were at Google Research and Google DeepMind. They put the first version on arXiv on April 7, 2023, and a revised version on August 6, 2023.
What happened in Smallville?
The paper calls Smallville “an interactive sandbox environment inspired by The Sims.” A person gave one character a single idea: to throw a Valentine’s Day party. The characters then spread the invitations, made new friends, asked each other on dates and came to the party together.
Nobody wrote that plan. The characters made it from three parts that the paper adds to a language model:
- Memory. A full record of what each character saw and did, in plain text.
- Reflection. Over time, the character turns many memories into a few general ideas about itself and others.
- Planning. The character finds the right memories and uses them to decide what to do next.
The researchers ran 25 characters for two full game days. The paper says this took “thousands of dollars in token credits” and “multiple days to complete.”
How is AI Town different from the paper’s code?
The Smallville code is also on GitHub, at joonspk-research/generative_agents, with the Apache-2.0 license. It is written in Python and needs an OpenAI API key. Its README warns that runs can cost a lot.
AI Town is a new code base in JavaScript and TypeScript. The README says that is on purpose, because most tools of this type are in Python. AI Town also adds a backend for many players and a default model that runs on your own computer.
For more on how game characters that think for themselves work, read apa arti NPC.
Can you play AI Town in a browser?
Yes. The live demo is at convex.dev/ai-town, and it loaded when we checked in November 2026. You can watch without an account. To join the town, you log in.
The help text in the AI Town code explains what you can do:
- Watch. “Click and drag to move around the town, and scroll in and out to zoom.” Click a character to read its chat history.
- Join. Log in and click the Interact button. Your character comes into the map with a highlighted circle under it.
- Talk. Click a character, then click “Start conversation.” The character walks to you, and then you talk. Characters can also ask you to talk.
The demo has limits. The help text says the town takes only a set number of humans at a time. If you do nothing for five minutes, the game removes you.
The v2 update on the Convex blog added more to the demo. You can invite nearby characters to chat, and they can invite you. Rumors also move from one character to the next and come back in later conversations.
Can you change the demo town?
No. The demo is a shared town that Convex runs. To change the characters, the map or the AI model, you run your own copy. The next section tells you how.
How do you run AI Town locally?
You clone the repo, install it, start it, and connect a language model. The README gives four ways to run it. This is a short version. Follow the README for the full steps.
- Standard setup. You develop on your computer or in the cloud with a free Convex account. The README calls this the easiest way.
- Docker Compose. You run the backend, the frontend and the dashboard in Docker. You do not need a Convex account.
- Pinokio. A community fork offers a one-click install. The README says it is for people who want to run AI Town but not change it.
- Fly.io. You put the app on Fly.io. The repo has a fly folder with the steps.
Step 1: Build and start the app
For the standard setup, the README gives these commands:
git clone https://github.com/a16z-infra/ai-town.git
cd ai-town
npm installThe install asks you to log in to Convex. Then start the app with npm run dev and open http://localhost:5173.
For Docker, the README starts with docker compose up --build -d. Then it tells you to make an admin key, add it to the .env.local file, and run npm run predev. The frontend runs on port 5173.
On Windows, the README tells you to install WSL2 with Ubuntu and Node.js 18 first. If you get a Node.js version error, the README says to use version 18.
Step 2: Connect a language model
By default, AI Town uses Ollama to run the model on your own computer. The README gives these steps:
- Download and install Ollama.
- Open the Ollama app, or run
ollama servein a terminal. - Run
ollama pull llama3to download the model. - Test it with
ollama run llama3.
You can use OpenAI, Together.ai or another API that works like the OpenAI API instead. For each one, you change one line in convex/util/llm.ts and set your API key with npx convex env set.
If you change the model provider or the embedding model later, delete your data and start again. The README says the memory search must match the embedding model.
Step 3: Make the town your own
All the characters and their stories are in data/characters.ts. You can make a new map in the Tiled editor and convert it with a script in the repo. After you change the characters, the README tells you to wipe the tables with npx convex run testing:wipeAllTables and run npm run dev again. That command deletes all your data.
How much does it cost to run AI Town?
The code is free. What you pay depends on where the language model runs and where the backend runs.
The language model
With the default setup, Ollama runs the model on your own computer. You send no calls to a paid model API. Your computer does all the work, so a slow computer makes slow characters.
With a cloud model, every line of talk is a paid API call. Providers such as Together AI price chat models per one million tokens, with one price for input and another for output. More characters and longer talks make more tokens.
The README gives two ways to keep the use down. The simulation pauses when the browser window is idle for five minutes. You can also stop the engine with npx convex run testing:stop and start it again with npx convex run testing:resume.
For scale, the Smallville paper ran 25 characters for two game days. That cost the researchers thousands of dollars in token credits.
The backend
Convex has a free plan for personal projects and prototypes. The Convex pricing page calls it “Free & Starter.” Use above the limits is billed per unit, and the paid plans add more. With Docker, you run the Convex backend on your own computer.
The optional extras cost money too. Background music uses Replicate, which needs an account and an API token.
What AI town games can you play now?
You can play the AI Town demo in a browser today. For a full game with AI people, you need a finished game, not a starter kit.
| Opsi | Apa itu | How you run it | Can you change the code? |
|---|---|---|---|
| AI Town demo | A shared town to watch or join | Browser, at convex.dev/ai-town | Tidak |
| AI Town, your own copy | A starter kit for developers | Your computer, Docker, Convex or Fly.io | Yes, MIT License |
| Smallville (Generative Agents) | The research code from the paper | Python, with an OpenAI API key | Yes, Apache-2.0 |
| LifeSim (game kami) | A finished life sim with AI people | Browser, iPhone app | Tidak |
LifeSim: a town of AI people, finished
LifeSim is our game, and it is free, with no ads and nothing to buy. You live one life, a day at a time, in a real city on a 3D map of Earth. The Orang AI answer in their own words. They mengingat apa yang kamu katakan and tell their friends. They also text you.
LifeSim is not open source. You cannot host it yourself, change its code or put in your own model. If you want to build or study an AI town, AI Town is the right pick.
For more games, read our list of game simulator kehidupan AI and our guide to game di mana kamu bisa berbicara dengan AI.
If you want to live in a town of AI people instead of building one, mainkan LifeSim secara gratis in your browser or on iPhone.
Panduan game lainnya
- 100 Years - Life Simulator
- Game simulator kehidupan 3D
- Game Lagos Life
- Game simulasi kehidupan 3DS terbaik
- Game Manusia atau AI
- Pembuat Game AI: Alat Gratis di Tahun 2026
- Virtual Families 3
- Game simulasi kehidupan terbaik di tahun 2026
- Game simulasi terbaik
- Simulasi kehidupan yang bisa kamu mainkan di browser
- game simulator kehidupan AI
- Simulator kehidupan AI untuk iPhone
- Game AI
- Game di mana kamu bisa berbicara dengan AI
- Roleplay AI
- Chatbot AI terbaik untuk roleplay
- Generator karakter AI
- Generator kepribadian acak
- Generator latar belakang acak
- Game cerita
- Game berbasis teks
- Game simulasi kencan
- Game di mana kamu menjalani hidup
- Game di mana kamu bisa melakukan apa saja
- Game untuk dimainkan saat bosan
- Buat game superhero-mu sendiri
- Game seperti The Sims
- Game seperti BitLife
- Lokasi file penyimpanan Stardew Valley
- editor penyimpanan Stardew Valley
- Game seperti Stardew Valley
- Game seperti Animal Crossing
- Game seperti Tomodachi Life
- Heartopia, dijelaskan
- Tomodachi Life
- Bagan kepribadian Tomodachi Life
- Generator jargon Tomodachi Life
- Generator nama pulau Tomodachi Life
- Apakah ada Tomodachi Life 2?
- Simulasi kehidupan terbaik di Switch dan Switch 2
- Apa arti NPC?
- Game seperti IMVU
- Game seperti Second Life
Sumber
- a16z-infra/ai-town on GitHub (README)
- AI Town license file (MIT)
- AI Town help text in src/App.tsx
- AI Town live demo on Convex
- Convex Stack: AI Town v2
- The Cognitive Revolution: Why a16z Built a Town for AI People
- Generative Agents: Interactive Simulacra of Human Behavior (arXiv abstract)
- Generative Agents: Interactive Simulacra of Human Behavior (arXiv full text)
- joonspk-research/generative_agents on GitHub
- Convex pricing
- Together AI pricing
