Agent simulation research tool using LLMs for social science
Top 71.3% on sourcepulse
This project provides a Python framework for creating and interacting with "generative agents" that simulate human behavior and attitudes. It leverages large language models (LLMs) to process qualitative interview data, enabling researchers to study individual and collective behavior through agent-based simulations. The primary benefit is a novel method for generating realistic agent responses based on rich, personal data.
How It Works
The core of the system is the GenerativeAgent
class, which uses LLMs (GPT-4 or GPT-3.5-turbo) to generate responses. Agents maintain a "scratchpad" for personal attributes and a "memory stream" for past experiences. They can recall, reflect on, and use this information to inform their responses to various stimuli, including categorical, numerical, and open-ended questions. This approach allows for nuanced, context-aware agent behavior that goes beyond simple rule-based systems.
Quick Start & Requirements
pip install -r requirements.txt
simulation_engine/settings.py
with OPENAI_API_KEY
, KEY_OWNER
, and other parameters.agent_bank/populations/single_agent
.Highlighted Details
Maintenance & Community
The project originates from research at Stanford University. Contributions are welcomed via standard GitHub pull requests. Contact: Joon Sung Park (joonspk@stanford.edu).
Licensing & Compatibility
Licensed under the MIT License. This permissive license allows for commercial use and integration into closed-source projects.
Limitations & Caveats
The full dataset of 1,000 interview-based agents is not yet publicly available, with access planned via a restricted API requiring a review process. The current codebase focuses on the simulation engine and agent creation, with broader data access still under development.
8 months ago
Inactive