This repository extends the work of Generative Agents (GA) to create a more comprehensive and scalable simulation tool. Our project includes both an offline simulation module (based on GA) and an online simulation module. We are also developing a user-friendly interface for launching, displaying, and interacting with the simulation.
- Linux operating system (recommended)
- Git
- Internet connection
-
Install NVM:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
-
Restart your terminal or run:
source ~/.bashrc
-
Install and use the latest LTS version of Node.js:
nvm install --lts nvm use --lts
-
Verify the installation:
node --version npm --version
Install pnpm package manager: https://pnpm.io/installation
Navigate to the frontend directory and install dependencies:
cd frontend
pnpm install
We recommend using Miniconda to manage Python environments and avoid package conflicts.
-
Download the Miniconda installer:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
-
Run the installer:
bash Miniconda3-latest-Linux-x86_64.sh
-
Follow the prompts to complete the installation.
-
Restart your terminal or run:
source ~/.bashrc
-
Create a new conda environment:
conda create -n llm-sim python=3.12
-
Activate the environment:
conda activate llm-sim
-
Install PyTorch (adjust the command based on your CUDA version if using GPU): https://pytorch.org/get-started/locally/
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
-
Install other dependencies:
pip install -r requirements.txt
-
Copy
config.template.yaml
intoconfig.yaml
-
Modify
port1
,port2
, andport3
inconfig.yaml
to use available ports:
server_ip: <your server ip address>
front_port: <frontend port>
back_port: <backend port>
Copy config_template.py
to config.py
under reverie/backend_server/utils
. Use the following template and replace the placeholders with your actual API keys and preferences:
openai_api_base = "https://api.openai.com/v1"
openai_api_key = "<Your OpenAI API Key>"
override_model = "<Your Model Name>" # Set to non-empty string to override all API calls
google_api_key = "<Your Google API Key>"
google_api_cx = "c2ab1202fad094a87"
key_owner = "<Your Name>"
maze_assets_loc = "../api/static/assets"
env_matrix = f"{maze_assets_loc}/the_ville/matrix"
env_visuals = f"{maze_assets_loc}/the_ville/visuals"
storage_path = "../storage"
temp_storage_path = "../temp_storage"
collision_block_id = "32125"
debug = True
-
Ensure you're in the project root directory.
-
Start the system:
python start.py
Use python start.py --help
for additional options.
- If you want to run it directy in your terminal:
cd reverie/backend_server
python reverie.py
Set the LOG_LEVEL
environment variable to control logging verbosity:
export LOG_LEVEL=debug # Options: debug, info, warning, error, critical
python start.py
To save server logs, use the --save
argument:
python start.py --save
This will save logs to webpage.log
, frontend.log
, and backend.log
.
Press Ctrl+C
to shut down all services.
This project builds upon the work of Generative Agents (GA). We extend our gratitude to the original authors for their contributions to the field.