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.

open-sourceagent-frameworks
9.6k
Stars
+180
Stars/month
0
Releases (6m)

Star Growth

+35 (0.4%)
9.4k9.6k9.8kMar 27Apr 1

Overview

AI Town 是一个基于 MIT 许可证的可部署启动套件,用于构建虚拟城镇,其中 AI 角色可以生活、聊天和社交。该项目受到「生成式代理:人类行为的交互式模拟」研究论文的启发,提供了强大的技术基础,支持共享全局状态、事务处理和仿真引擎。与大多数基于 Python 的仿真器不同,AI Town 使用 JavaScript/TypeScript 构建,技术栈包括 Convex(游戏引擎、数据库、向量搜索)、可选的 Clerk 认证、PixiJS 渲染引擎。默认使用 llama3 模型和 mxbai-embed-large 嵌入,支持本地推理(Ollama)和云端 LLM(OpenAI、Together.ai)。该项目旨在从简单的实验项目扩展到多人游戏,为 AI 社交仿真提供了一个可定制的平台。

Deep Analysis

Key Differentiator

The only JavaScript/TypeScript-based AI town simulation with built-in infrastructure (Convex backend, real-time state, pixel rendering) — filling the gap where most agent simulators are Python-only and lack deployment-ready architecture

Capabilities

  • Deployable starter kit for virtual towns with autonomous AI characters that interact and socialize
  • Real-time simulation engine with shared global state, transactions, and pixel art rendering
  • Multi-agent interaction with memory systems and contextual decision-making
  • Background music generation and customizable environments via Tiled Map Editor
  • Built-in infrastructure via Convex backend with dashboard for data browsing

🔗 Integrations

Ollama (default LLM)OpenAITogether.aiAnthropicGroqConvex (backend/database)Clerk (auth)Replicate (art/music generation)PixiJS (rendering)Vercel

Best For

  • Developers building interactive AI character simulations or virtual worlds with JS/TS
  • Researchers exploring emergent multi-agent behavior in simulated environments

Not Ideal For

  • Production-ready game engines — use Unity or Unreal with AI plugins for commercial games
  • Python-first AI researchers — use generative_agents (Stanford) for Python-based simulation

Languages

TypeScriptJavaScript

Deployment

Convex Cloud (free tier)Docker Compose self-hostedFly.ioVercel (frontend)Pinokio one-click installerLocal development

Pricing Detail

Free: Free to start — Convex free tier with auto-scaling
Paid: Scales with Convex pricing as usage grows

Known Limitations

  • Simulation pauses after 5 minutes of browser inactivity
  • Changing LLM providers requires database wipe and restart
  • Windows users need WSL2 setup
  • Designed as a starter kit — production use requires significant customization

Pros

  • + 强大的技术架构,基于 Convex 提供共享状态、事务处理和仿真引擎支持
  • + 高度可配置,支持多种 LLM 提供商(本地 Ollama、OpenAI API、Together.ai)
  • + 活跃的开源社区,拥有 9,622 个 GitHub 星标和 Discord 社区支持

Cons

  • - 设置复杂,需要配置多个服务(Convex 后端、LLM 提供商、可选认证)
  • - 运行多个 AI 代理会消耗大量计算资源
  • - 仍处于实验性质,适合研究和探索而非生产环境

Use Cases

  • 研究 AI 代理行为和社交动态的学术项目
  • 构建多人 AI 驱动的仿真游戏
  • 探索 AI 社交互动的教育项目

Getting Started

1. 克隆仓库并安装依赖项 2. 设置 Convex 后端并配置 LLM 提供商(Ollama/OpenAI/Together.ai) 3. 本地部署或生产部署,配置 AI 角色参数

Compare ai-town