SkillAgentSearch skills...

Oasis

🏝️ OASIS: Open Agent Social Interaction Simulations with One Million Agents.

Install / Use

/learn @camel-ai/Oasis

README

<div align="center"> <a href="https://www.camel-ai.org/"> <img src="assets/banner.png" alt=banner> </a> </div> </br> <div align="center"> <h1> OASIS: Open Agent Social Interaction Simulations with One Million Agents </h1>

[![Documentation][docs-image]][docs-url] [![Discord][discord-image]][discord-url] [![X][x-image]][x-url] [![Reddit][reddit-image]][reddit-url] [![Wechat][wechat-image]][wechat-url] [![Wechat][oasis-image]][oasis-url] [![Hugging Face][huggingface-image]][huggingface-url] [![Star][star-image]][star-url] [![Package License][package-license-image]][package-license-url]

<h4 align="center">

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

</h4> </div> <br> <p align="left"> <img src='assets/intro.png'>

🏝️ OASIS is a scalable, open-source social media simulator that incorporates large language model 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.

</p> <br> <div align="center"> 🌟 Star OASIS on GitHub and be instantly notified of new releases. </div> <br> <div align="center"> <img src="assets/star.gif" alt="Star" width="196" height="52"> </a> </div> <br>

✨ 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.

<br>

πŸ“Ί Demo Video

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

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

<br>

For more showcaes:

<br>

🎯 Usecase

<div align="left"> <img src="assets/research_simulation.png" alt=usecase1> <img src="assets/interaction.png" alt=usecase2> <a href="http://www.matrix.eigent.ai"> <img src="assets/content_creation.png" alt=usecase3> </a> <img src="assets/prediction.png" alt=usecase4> </div>

βš™οΈ 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, LLMAction, ManualAction,
                   generate_reddit_agent_graph)


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.DISLIKE_POST,
        ActionType.CREATE_POST,
        ActionType.CREATE_COMMENT,
        ActionType.LIKE_COMMENT,
        ActionType.DISLIKE_COMMENT,
        ActionType.SEARCH_POSTS,
        ActionType.SEARCH_USER,
        ActionType.TREND,
        ActionType.REFRESH,
        ActionType.DO_NOTHING,
        ActionType.FOLLOW,
        ActionType.MUTE,
    ]

    agent_graph = await generate_reddit_agent_graph(
        profile_path="./data/reddit/user_data_36.json",
        model=openai_model,
        available_actions=available_actions,
    )

    # Define the path to the database
    db_path = "./data/reddit_simulation.db"

    # Delete the old database
    if os.path.exists(db_path):
        os.remove(db_path)

    # Make the environment
    env = oasis.make(
        agent_graph=agent_graph,
        platform=oasis.DefaultPlatformType.REDDIT,
        database_path=db_path,
    )

    # Run the environment
    await env.reset()

    actions_1 = {}
    actions_1[env.agent_graph.get_agent(0)] = [
        ManualAction(action_type=ActionType.CREATE_POST,
                     action_args={"content": "Hello, world!"}),
        ManualAction(action_type=ActionType.CREATE_COMMENT,
                     action_args={
                         "post_id": "1",
                         "content": "Welcome to the OASIS World!"
                     })
    ]
    actions_1[env.agent_graph.get_agent(1)] = ManualAction(
        action_type=ActionType.CREATE_COMMENT,
        action_args={
            "post_id": "1",
            "content": "I like the OASIS world."
        })
    await env.step(actions_1)

    actions_2 = {
        agent: LLMAction()
        for _, agent in env.agent_graph.get_agents()
    }

    # Perform the actions
    await env.step(actions_2)

    # Close the environment
    await env.close()


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

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

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.

<div align="center"> <img src="assets/tutorial.png" alt="Tutorial Overview"> </div>

πŸ“’ News

Upcoming Features & Contributions

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

<!-- - Public release of our dataset on Hugging Face (November 05, 2024) -->

Latest Updates

πŸ“’ Update the camel-ai version to 0.2.78 and update the dataset HuggingFace link. - πŸ“† December 4, 2025

  • Add the report post action to mark inappropriate content. - πŸ“† June 8, 2025
  • Add features for creating group chats, sending messages in group chats, and leaving group chats. - πŸ“† June 6, 2025
  • Support Interview Action for asking agents specific questions and getting answers. - πŸ“† June 2, 2025
  • Support customization of each agent's models, tools, and prompts; refactor the interface to follow the PettingZoo style. - πŸ“† May 22, 2025
  • Refactor into the OASIS environment, publish camel-oasis on PyPI, and release the documentation. - πŸ“† April 24, 2025
  • Support OPENAI Embedding model for Twhin-Bert Recommendation System. - πŸ“† March 25, 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

πŸ”Ž Follow-up Research

  • MultiAgent4Collusion: multi-agent collusion simulation framework in social systems
  • CUBE: dynamic simulations in customized unity3D-based environments
  • MultiAgent4Fraud: financial fraud risks by collaborative LLM agents on social platforms
  • More to come...

If your research is based on OASIS, we'd be happy to feature your work hereβ€”feel free to reach out or submit a pull request to add it to the README!

πŸ₯‚ 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 OASIS 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

View on GitHub
GitHub Stars4.1k
CategoryEducation
Updated1h ago
Forks441

Languages

Python

Security Score

100/100

Audited on Apr 6, 2026

No findings