Ai Town

screenshot of Ai Town
react
vite
tailwind

Ai Town

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.

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.

react
React

React is a widely used JavaScript library for building user interfaces and single-page applications. It follows a component-based architecture and uses a virtual DOM to efficiently update and render UI components

vite
Vite

Vite is a build tool that aims to provide a faster and leaner development experience for modern web projects

tailwind
Tailwind

Tailwind CSS is a utility-first CSS framework that provides pre-defined classes for building responsive and customizable user interfaces.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

postcss
Postcss

PostCSS is a popular open-source tool that enables web developers to transform CSS styles with JavaScript plugins. It allows for efficient processing of CSS styles, from applying vendor prefixes to improving browser compatibility, ultimately resulting in cleaner, faster, and more maintainable code.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.