Skip to main content

Open Agents Social Interaction Simulations on a Large Scale

Project description


OASIS: Open Agent Social Interaction Simulations with One Million Agents

Discord X Reddit Wechat Wechat Hugging Face Star Package License

Community | Paper | Examples | Dataset | Citation | Contributing | CAMEL-AI


🏝️ OASIS is a scalable, open-source social media simulator that integrates large language models with rule-based agents to realistically mimic the behavior of up to one million users on platforms like Twitter and Reddit. It's designed to facilitate the study of complex social phenomena such as information spread, group polarization, and herd behavior, offering a versatile tool for exploring diverse social dynamics and user interactions in digital environments.


🌟 Star OASIS on GitHub and be instantly notified of new releases.

Star

✨ Key Features

📈 Scalability

OASIS supports simulations of up to one million agents, enabling studies of social media dynamics at a scale comparable to real-world platforms.

📲 Dynamic Environments

Adapts to real-time changes in social networks and content, mirroring the fluid dynamics of platforms like Twitter and Reddit for authentic simulation experiences.

👍🏼 Diverse Action Spaces

Agents can perform 23 actions, such as following, commenting, and reposting, allowing for rich, multi-faceted interactions.

🔥 Integrated Recommendation Systems

Features interest-based and hot-score-based recommendation algorithms, simulating how users discover content and interact within social media platforms.


📺 Demo Video

Introducing OASIS: Open Agent Social Interaction Simulations with One Million Agents

https://github.com/user-attachments/assets/3bd2553c-d25d-4d8c-a739-1af51354b15a


For more showcaes:


🎯 Usecase

⚙️ Quick Start

  1. Install the OASIS package:

Installing OASIS is a breeze thanks to its availability on PyPI. Simply open your terminal and run:

pip install camel-oasis
  1. Set up your OpenAI API key:
# For Bash shell (Linux, macOS, Git Bash on Windows):
export OPENAI_API_KEY=<insert your OpenAI API key>

# For Windows Command Prompt:
set OPENAI_API_KEY=<insert your OpenAI API key>
  1. Prepare the agent profile file:

Create the profile you want to assign to the agent. As an example, you can download user_data_36.json and place it in your local ./data/reddit folder.

  1. Run the following Python code:
import asyncio
import os

from camel.models import ModelFactory
from camel.types import ModelPlatformType, ModelType

import oasis
from oasis import ActionType, EnvAction, SingleAction


async def main():
  # Define the model for the agents
  openai_model = ModelFactory.create(
      model_platform=ModelPlatformType.OPENAI,
      model_type=ModelType.GPT_4O_MINI,
  )

  # Define the available actions for the agents
  available_actions = [
      ActionType.LIKE_POST,
      ActionType.CREATE_POST,
      ActionType.CREATE_COMMENT,
      ActionType.FOLLOW
  ]

  # Make the environment
  env = oasis.make(
      platform=oasis.DefaultPlatformType.REDDIT,
      database_path="reddit_simulation.db",
      agent_profile_path="./data/reddit/user_data_36.json",
      agent_models=openai_model,
      available_actions=available_actions,
  )

  # Run the environment
  await env.reset()

  action = SingleAction(
    agent_id=0,
    action=ActionType.CREATE_POST,
    args={"content": "Welcome to the OASIS World!"}
  )

  env_actions = EnvAction(
    activate_agents=list(range(10)),  # activate the first 10 agents
    intervention=[action]
  )

  # Apply interventions to the environment, refresh the recommendation system, and LLM agent perform actions
  await env.step(env_actions)

  # Close the environment
  await env.close()

if __name__ == "__main__":
  asyncio.run(main())

[!TIP] For more detailed instructions and additional configuration options, check out the documentation(coming soon).

More Tutorials

To discover how to create profiles for large-scale users, as well as how to visualize and analyze social simulation data once your experiment concludes, please refer to More Tutorials for detailed guidance.

Tutorial Overview

📢 News

Upcoming Features & Contributions

We welcome community contributions! Join us in building these exciting features.

Latest Updates

  • Support OPENAI Embedding model for Twhin-Bert Recommendation System. - 📆 March 25, 2025
  • Updated social media links and QR codes in the README! Join OASIS & CAMEL on WeChat, X, Reddit, and Discord. - 📆 March 24, 2025
  • Add multi-threading support to speed up LLM inference by 13x - 📆 March 4, 2025
  • Slightly refactoring the database to add Quote Action and modify Repost Action - 📆 January 13, 2025
  • Added the demo video and oasis's star history in the README - 📆 January 5, 2025
  • Introduced an Electronic Mall on the Reddit platform - 📆 December 5, 2024
  • OASIS initially released on arXiv - 📆 November 19, 2024
  • OASIS GitHub repository initially launched - 📆 November 19, 2024

🥂 Contributing to OASIS🏝️

We greatly appreciate your interest in contributing to our open-source initiative. To ensure a smooth collaboration and the success of contributions, we adhere to a set of contributing guidelines similar to those established by CAMEL. For a comprehensive understanding of the steps involved in contributing to our project, please refer to the CAMEL contributing guidelines. 🤝🚀

An essential part of contributing involves not only submitting new features with accompanying tests (and, ideally, examples) but also ensuring that these contributions pass our automated pytest suite. This approach helps us maintain the project's quality and reliability by verifying compatibility and functionality.

📬 Community & Contact

If you're keen on exploring new research opportunities or discoveries with our platform and wish to dive deeper or suggest new features, we're here to talk. Feel free to get in touch for more details at camel.ai.team@gmail.com.


  • Join us (Discord or WeChat) in pushing the boundaries of finding the scaling laws of agents.

  • Join WechatGroup for further discussions!

WeChat Group QR Code

🌟 Star History

Star History Chart

🔗 Citation

@misc{yang2024oasisopenagentsocial,
      title={OASIS: Open Agent Social Interaction Simulations with One Million Agents},
      author={Ziyi Yang and Zaibin Zhang and Zirui Zheng and Yuxian Jiang and Ziyue Gan and Zhiyu Wang and Zijian Ling and Jinsong Chen and Martz Ma and Bowen Dong and Prateek Gupta and Shuyue Hu and Zhenfei Yin and Guohao Li and Xu Jia and Lijun Wang and Bernard Ghanem and Huchuan Lu and Chaochao Lu and Wanli Ouyang and Yu Qiao and Philip Torr and Jing Shao},
      year={2024},
      eprint={2411.11581},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2411.11581},
}

🙌 Acknowledgment

We would like to thank Douglas for designing the logo of our project.

🖺 License

The source code is licensed under Apache 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

camel_oasis-0.1.0.tar.gz (48.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

camel_oasis-0.1.0-py3-none-any.whl (69.3 kB view details)

Uploaded Python 3

File details

Details for the file camel_oasis-0.1.0.tar.gz.

File metadata

  • Download URL: camel_oasis-0.1.0.tar.gz
  • Upload date:
  • Size: 48.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.8 Windows/10

File hashes

Hashes for camel_oasis-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9d98117f10e15ab10b2866e8d127e70901732548e7a10f3b3e67d77a0e9089fd
MD5 f069a0d512ed01f91c7d65fcb021d0b7
BLAKE2b-256 a0035c9f7c9a016148fca9008046bf5c5766f3323306892df7e0f3a2005cc62d

See more details on using hashes here.

File details

Details for the file camel_oasis-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: camel_oasis-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 69.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.8 Windows/10

File hashes

Hashes for camel_oasis-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d1d330a28e92071d8a1f71f5ae2559135329201a20fa4122f60956a21468e0de
MD5 35a2c61b52af678fd8c007df8070a40b
BLAKE2b-256 939b9207920e88c8bba0bd8bbe37409a1584f04c528c46b731becdc0857fe490

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page