AI Town screenshot

AI Town

Author Avatar Theme by A16z infra
Updated: 13 Feb 2025
8437 Stars

A MIT-licensed, deployable starter kit for building and customizing your own version of AI town - a virtual town where AI characters live, chat and socialize.

Categories

Overview:

AI Town is a virtual town where AI characters interact with each other. It is a deployable starter kit that allows users to build and customize their own version of AI Town. The project is inspired by the research paper “Generative Agents: Interactive Simulacra of Human Behavior.” The primary goal of AI Town is to provide a platform that can be extended and customized easily. The back-end of AI Town supports shared global state, transactions, and a simulation engine, making it suitable for both simple projects and scalable, multi-player games. Additionally, it offers a JavaScript/TypeScript framework, making it accessible to developers familiar with these languages.

Features:

  • Virtual town where AI characters live, chat, and socialize
  • Deployable starter kit for building and customizing your own version of AI Town
  • Back-end supports shared global state, transactions, and a simulation engine
  • Suitable for both simple projects and scalable, multi-player games
  • JavaScript/TypeScript framework available
  • Inspired by the research paper “Generative Agents: Interactive Simulacra of Human Behavior”
  • Fun and interactive project to work on
  • Provides a strong foundation for customization and extension

Installation:

  1. Clone the repository and install the required packages.
  2. Set up Clerk by going to https://dashboard.clerk.com/ and creating a new application. Name your application and select the sign-in providers you want to offer users. Add the generated VITE_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY to your .env.local file.
  3. Obtain your OpenAI API key from https://platform.openai.com/account/api-keys and set the OPENAI_API_KEY environment variable in your Convex deployment.
  4. If you want to use the Replicate API for daily background music generation, create an account with Replicate and obtain an API token from your profile’s API Token page. Add the token as REPLICATE_API_TOKEN in your Convex environment variables.
  5. Configure the environment variables for the Convex backend through the dashboard settings. Add the required environment variables, including the CLERK_ISSUER_URL.
  6. Run the code using npm run dev command. The application will be accessible at http://localhost:5173.

Summary:

AI Town is a deployable starter kit for building and customizing a virtual town where AI characters interact with each other. It provides a strong foundation, supporting shared global state, transactions, and a simulation engine, making it suitable for various projects ranging from simple prototypes to scalable, multi-player games. The project is inspired by a research paper on generative agents and aims to provide a platform that can be extended and customized easily. With a JavaScript/TypeScript framework, AI Town is accessible to developers familiar with these languages. The installation process requires setting up Clerk, obtaining an OpenAI API key, and configuring environment variables for the Convex backend. Once installed, the application can be run locally for testing and development purposes.