oasis-demo / README.md
nguyenthanhasia's picture
Upload README.md with huggingface_hub
129baac verified

A newer version of the Gradio SDK is available: 5.45.0

Upgrade
metadata
title: OASIS Demo - Social Media Simulation
emoji: 🏝️
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 4.44.0
app_file: app.py
pinned: false
license: apache-2.0

🏝️ OASIS Demo: Open Agent Social Interaction Simulations

This is a simplified demonstration of OASIS - 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.

What is OASIS?

OASIS is designed to facilitate the study of complex social phenomena such as:

  • Information spread and viral content
  • Group polarization and echo chambers
  • Herd behavior and social influence
  • Content recommendation systems
  • Social network dynamics

Demo Features

This simplified demo showcases:

  • Multi-agent interactions: Create 2-5 AI agents with different personalities
  • Content generation: Agents create posts on various topics
  • Social engagement: Agents like, repost, and interact with content
  • Real-time simulation: Watch social dynamics unfold step by step

Key Capabilities of Full OASIS

πŸ“ˆ Scalability

  • Supports simulations of up to 1 million agents
  • Enables studies at scale comparable to real-world platforms

πŸ“² Dynamic Environments

  • Adapts to real-time changes in social networks
  • Mirrors fluid dynamics of Twitter and Reddit

πŸ‘πŸΌ Diverse Action Spaces

  • Agents can perform 23 different actions
  • Including following, commenting, reposting, searching, etc.

πŸ”₯ Integrated Recommendation Systems

  • Interest-based recommendation algorithms
  • Hot-score-based content discovery

Getting Started with Full OASIS

pip install camel-oasis
import asyncio
from camel.models import ModelFactory
from camel.types import ModelPlatformType, ModelType
import oasis
from oasis import ActionType, LLMAction, generate_reddit_agent_graph

# Set up your OpenAI API key
# export OPENAI_API_KEY=your_key_here

async def main():
    # Create model
    model = ModelFactory.create(
        model_platform=ModelPlatformType.OPENAI,
        model_type=ModelType.GPT_4O_MINI,
    )
    
    # Define available actions
    available_actions = [
        ActionType.LIKE_POST,
        ActionType.CREATE_POST,
        ActionType.CREATE_COMMENT,
        ActionType.FOLLOW,
        ActionType.DO_NOTHING,
    ]
    
    # Generate agent graph
    agent_graph = await generate_reddit_agent_graph(
        profile_path="./data/reddit/user_data_36.json",
        model=model,
        available_actions=available_actions,
    )
    
    # Create environment
    env = oasis.make(
        agent_graph=agent_graph,
        platform=oasis.DefaultPlatformType.REDDIT,
        database_path="./simulation.db",
    )
    
    # Run simulation
    await env.reset()
    actions = {agent: LLMAction() for _, agent in env.agent_graph.get_agents()}
    await env.step(actions)
    await env.close()

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

Research Applications

OASIS enables research in:

  • Information Dynamics: How news and misinformation spread
  • Social Psychology: Group behavior and influence patterns
  • Platform Design: Testing recommendation algorithms and policies
  • Crisis Response: Understanding information flow during emergencies
  • Political Science: Studying polarization and opinion formation

Links

License

Apache License 2.0


Note: This demo shows a simplified version of OASIS capabilities. The full framework supports much more complex simulations with real LLM-powered agents, sophisticated social networks, and detailed behavioral modeling.