LibreAI / AI Agents / generative_agents
// agents · joonspk-research/generative_agents

generative_agents

Stanford's Generative Agents simulation - 25 AI characters living in a virtual town

★ 22.2k stars⑂ 3.1k forksApache-2.0updated 2024-08
▦ visual — this project's README ships no embeddable screenshot,
so here's a placeholder. The guide below is complete regardless.
// project facts

Project facts

generative_agents is an open-source ai agents project by joonspk-research (joonspk-research/generative_agents on GitHub). It has 22,200 GitHub stars and 3,112 forks, is released under the Apache-2.0 license, and was last updated on GitHub on 5 August 2024.

GitHub stars
22,200
Forks
3,112
License
Apache-2.0
Last updated on GitHub
5 August 2024
Category
AI Agents
Listing
Full install guide
// how it works

How it works

  1. Understand the setup

    Read the paper summary and decide whether you want to replay a demo or run a live simulation.

  2. Clone the simulation

    Get the repository, which contains the environment front-end and the simulation server.

  3. Configure your API key

    Create the utils file with your OpenAI API key, then install the Python requirements.

  4. Run your first simulation

    Start the environment server and the simulation server, then watch or replay the agents' day.

// features

Why people love it

Believable agent architecture

Implements the paper's memory stream, retrieval, reflection and planning loop for each agent.

A living town simulation

Runs 25 agents in the Smallville environment ('the Ville') with daily routines and emergent social behavior.

Save and replay

Simulations can be saved, replayed and demoed, so experiments are reproducible.

Customizable histories

Author and load agent history files to change what agents remember.

New base simulations

Create your own base simulations with different agents and starting states.

Interactive front end

Watch agents move and interact through the web-based environment server.

Advertisement
// run it

Run it yourself

  1. Clone the repository

    Get the source code from GitHub and enter the project directory.

    git clone https://github.com/joonspk-research/generative_agents.git
    cd generative_agents
  2. Install requirements

    After creating the utils file with your OpenAI API key (README Step 1), install the Python dependencies.

    pip install -r requirements.txt # see README for the exact path
  3. Start the servers

    The README walks through starting the environment server, then the simulation server, then running or replaying a simulation.

    # Start the environment (frontend) server, then the simulation server
    # per README 'Running a Simulation' steps 1-2
// use cases

What you can build

Advertisement
// faq

Questions, answered

Who maintains this project?

It is maintained by the paper's authors (Joon Sung Park and collaborators, Stanford) as research code on GitHub.

Is it free to use?

Yes - the code is Apache-2.0 licensed and free to use under that license.

Does it need a paid API key?

Yes, for live simulations you need your own OpenAI API key, and a town full of agents making LLM calls can consume meaningful API credit; replaying saved simulations avoids most of that cost.

How does it compare to alternatives?

Compared with agent frameworks like LangChain, this is not a toolkit for building your own agent app - it is a complete, paper-faithful social simulation you run, replay and modify.

How do I get started?

Clone the repo, add your OpenAI key in the utils file, install requirements.txt, and follow the README's two-server run instructions.

// keep exploring

Similar tools

Agents

eventcatalog

Living architecture documentation that both your team and AI agents can read.

★ 2.9k starsCustom
View guide →
Agents

webgradients

180 free gradients for CSS, Figma, and Sketch, plus a dataset for AI agents.

★ 2.5k starsMIT
View guide →
AI Agents

babysitter

Babysitter enforces the process: deterministic, quality-gated orchestration for fleets of coding agents.

★ 1.8k starsMIT
View guide →
AI Agents

nullhub

Management console for installing and monitoring AI agents and pipelines.

★ 1.8k starsMIT
View guide →
AI Agents

ktx

Context layer so AI agents query your analytics databases accurately.

★ 1.6k starsApache-2.0
View guide →
AI Agents

paritok-4b-v1

Compression gateway that cuts AI coding agents' token bills up to 85%.

★ 1.5k starsApache-2.0
View guide →
// alternatives

Alternatives in AI Agents

The most-starred other AI Agents projects in the LibreAI catalogue — the realistic shortlist if generative_agents is not the right fit.

Get generative_agents

Free and open — grab the source, star the repo, and start creating.