Skip to content

AdonaiVera/emergent_agentics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generative Agents Collaboratively Mission-Planning

Smallville

This repository explores emergent social behaviors in generative agents, building upon the paper "Generative Agents: Interactive Simulacra of Human Behavior." The project specifically focuses on simulating party environments to study complex social dynamics and emergent behaviors.


Index:

  1. Project Overview
  2. Setup
  3. Execution
  4. Cost-Tracking
  5. Customizing the Map
  6. Party Simulation

Project Overview

This project investigates how autonomous agents form social groups, share information, and adapt their plans within structured social environments. Key research areas include:

  • Formation of social groups based on memory and perception
  • Information diffusion in locally-constrained environments
  • Impact of limited memory retrieval on decision-making
  • Real-time plan adaptation
  • Emergent patterns in dynamic schedule adjustment

Simulation Types

  • Informal Get-together: Casual social interactions
  • Formal Networking Event: Professional networking dynamics

Quantifiable Metrics

  • Information Spread (with whisper function)
  • Social Clustering
  • Adaptation Rate
  • Interaction Density
  • Acceptance/Rejection Rate
  • Agent Mobility
  • Conversation Duration

Visualizing Metrics

The project includes a comprehensive visualization system to analyze emergent behaviors in the simulation. To generate visualizations:

  1. Install the required dependencies:
pip install matplotlib seaborn networkx pandas numpy
  1. Run the visualization script:
python reverie/backend_server/persona/insight/visualize_metrics.py

This will generate several visualizations in the visualizations directory:

  • Interaction Network: Shows the social network structure of agents with edge thickness representing interaction frequency
  • Interaction Heatmap: Displays the frequency of interactions between all pairs of agents
  • Information Spread: Visualizes how much information each agent has received
  • Acceptance/Rejection Rates: Shows the ratio of successful vs failed interactions
  • Zone Movements: Displays agent mobility patterns between different zones
  • Conversation Durations: Shows the distribution of conversation lengths

These visualizations help analyze:

  • Social network formation and dynamics
  • Information propagation patterns
  • Success rates of social interactions
  • Spatial behavior and movement patterns
  • Typical conversation characteristics

Party Simulation

Environment Structure

The party environment is modeled as a tree-structured space with distinct zones:

  • Bar area
  • Dance floor
  • Lounge
  • Entrance area

Agent Roles

  1. Host (1 agent)

    • Acts as a daemon influencing all agents
    • Rules and personality defined by the group
  2. Guests (4 agents)

    • 3 agents modeled as digital twins of group members
    • 1 agent with randomized traits

Agent Capabilities

  • Local perception within their zone
  • Memory stream storage (observations, reflections, plans)
  • Dynamic plan modification
  • Information sharing through whisper function
  • Team formation and coordination

Setting Up The Environment

Generate environment

To created the image in your environment run this code.

   python tools/generate_env_images.py

Step 1. Conda Env

Note: If you change the environment name from simulacra, you'll need to update the name in the upcoming bash scripts as well.

    conda create -n simulacra python=3.9.12 pip
    conda activate simulacra
    pip install -r requirements.txt

Download Famous People Images

To download images of famous people for testing purposes, run:

python tools/download_famous_people_images.py

Run Simulations

All of the following scripts accept two optional arguments to customize the conda setup:

  • --conda_path: Path to your conda activate script (default: /home/${USER}/anaconda3/bin/activate)
  • --env_name: Name of the conda environment to use (default: simulacra)

Example with custom conda setup:

./run_frontend.sh --conda_path /opt/anaconda3/bin/activate --env_name simulacra
./run_frontend.sh --env_name simulacra

Example:

   ./run_backend_automatic.sh --conda_path /opt/anaconda3/bin/activate --env_name simulacra -o base_party -t test_1 -s 400 --ui True

   # Example without UI
   ./run_backend_automatic.sh --env_name simulacra -o base_party -t party_experiment_1_whisper_2 -s 800 --ui True
   ./run_backend_automatic.sh --env_name simulacra -o base_party -t party_experiment_1_whisper_5 -s 800 --ui True
   ./run_backend_automatic.sh --env_name simulacra -o base_party -t medical_experiment_1_whisper_2 -s 800 --ui True
   ./run_backend_automatic.sh --env_name simulacra -o base_party -t medical_experiment_1_whisper_5 -s 800 --ui True

   # In case you want to continue a simulation, search for the latest simulation
   ./run_backend_automatic.sh --env_name simulacra -o party_experiment_1_whisper_1-s-3-599-799 -t party_experiment_1_whisper_1 -s 800 --ui True

   ./run_backend_automatic.sh --env_name simulacra -o party_experiment_1_whisper_2-s-3-599-799 -t party_experiment_1_whisper_2 -s 800 --ui True

   # Server 
   ./run_backend_automatic.sh --conda_path /home/gonzalaa/.miniconda3/bin/activate --env_name simulacra -o base_party -t party_experiment_1_whisper_50 -s 800 --ui None

   ./run_backend_automatic.sh --env_name simulacra -o medical_experiment_1_whisper_2-s-2-399-599 -t medical_experiment_1_whisper_2 -s 800 --ui True

   ./run_backend_automatic.sh --env_name simulacra -o party_experiment_1_whisper_5-s-1-199-399 -t party_experiment_1_whisper_5 -s 800 --ui True

   ./run_backend_automatic.sh --env_name simulacra -o base_party -t final_validation -s 100 --ui True
      
   ./run_backend_automatic.sh --conda_path /home/gonzalaa/.miniconda3/bin/activate --env_name simulacra -o base_party -t party_experiment_1_whisper_50 -s 800 --ui None
   
   # New test base on latest suggestions
   ./run_backend_automatic.sh --env_name simulacra -o base_party -t party_experiment_1_whisper_50 -s 800 --ui True

   ./run_backend_automatic.sh --env_name simulacra -o base_party -t party_experiment_os_1_whisper_50 -s 800 --ui True

   ./run_backend_automatic.sh --env_name simulacra -o base_party -t party_experiment_os_1_whisper_50_ilegal -s 800 --ui True


   # With past experiences
   ./run_backend_automatic.sh --env_name simulacra -o base_party -t crossmodality_plan_short7 -s 60 --ui True

   ./run_backend_automatic.sh --env_name simulacra -o base_party_memory -t new_crossmodality_0 -s 2400 --ui True

   ./run_backend_automatic.sh --env_name simulacra -o base_party -t new_crossmodality_0 -s 600 --ui True --scenario_index 5

   # 1800 + 600

Endpoint list

For a more detailed explanation see the original readme.

Running a Demo

To create a polished demo with proper character sprites:

  1. First, compress your simulation:

    • Open reverie/compress_sim_storage.py
    • Run the compress() function with your simulation name
    compress("your_simulation_name")
  2. View the demo in your browser:

    http://localhost:8000/demo/<simulation-name>/<starting-time-step>/<simulation-speed>
    

    Parameters:

    • simulation-name: Name of your simulation
    • starting-time-step: Where to begin the demo (e.g., 1)
    • simulation-speed: Speed from 1 (slowest) to 5 (fastest)

Example demo URL: http://localhost:8000/demo/test_1-s-0-0-186_good/1/3/

Authors

This project was developed as part of the Complex Systems course under the guidance of Professor Ali A. Minai.

Team Members

  • Adonai Vera
  • Carlos Hinojosa
  • Karen Sanchez
  • Prateek Kharangate
  • Haidar Bin Hamid

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published