Back to Articles

OASIS: Simulating a Million LLM-Powered Social Media Agents

[ View on GitHub ]

OASIS: Simulating a Million LLM-Powered Social Media Agents

Hook

What happens when you let a million AI agents loose on a simulated social network? OASIS makes this experiment not just possible, but surprisingly practical for researchers studying digital society at scale.

Context

Social media platforms shape everything from elections to public health, yet studying them rigorously remains extraordinarily difficult. Researchers face a dilemma: run experiments on real platforms (raising ethical concerns and platform policy violations), analyze historical data (limiting causal inference), or build simulations with traditional agent-based models (losing the nuance of human language and behavior). The emergence of large language models offers a third path—agents that can generate human-like text, make contextual decisions, and exhibit emergent social behaviors—but existing frameworks like Stanford’s Generative Agents cap out at dozens of agents in constrained environments.

OASIS, developed by the CAMEL-AI team, bridges this gap by providing a scalable framework specifically designed for social media simulation at population scale. Built to support up to one million LLM-powered agents interacting on platforms that mirror Twitter and Reddit, it transforms questions about information cascades, polarization dynamics, and viral content from theoretical exercises into testable hypotheses. The framework targets researchers studying computational social science, platform designers testing moderation policies, and anyone needing to understand how ideas propagate through networked communities without the ethical baggage of experimenting on real humans.

Technical Insight

Agents

batch actions

query for decision

action selection

23 action types

content feed

ranked content

read social graph

persist state

observations

Agent Graph

LLM-Powered Nodes

Platform Environment

Twitter/Reddit

Recommendation System

Interest & Hot Score

State Persistence

Database

Simulation Loop

Async Executor

LLM Backend

GPT-4o-mini

System architecture — auto-generated

OASIS’s architecture centers on an agent graph system where each node represents an autonomous agent backed by an LLM (typically GPT-4o-mini based on the examples). Unlike simple chatbot arrays, these agents maintain persistent profiles, social connections, and behavioral patterns across simulation steps. The framework provides 23 distinct action types spanning content creation (posts, comments), social network manipulation (following, muting), content discovery (search, trending feeds), and engagement (likes, dislikes, reposts). What makes this work at scale is the async/await execution model combined with action batching—agents don’t all query the LLM simultaneously, which would be prohibitively expensive.

Here’s how you initialize a basic simulation with multiple agents on Reddit:

import asyncio
from camel.models import ModelFactory
from camel.types import ModelPlatformType, ModelType
import oasis
from oasis import ActionType, generate_reddit_agent_graph

async def main():
    # Configure the LLM backing your agents
    model = ModelFactory.create(
        model_platform=ModelPlatformType.OPENAI,
        model_type=ModelType.GPT_4O_MINI,
    )
    
    # Define what agents can do
    available_actions = [
        ActionType.CREATE_POST,
        ActionType.CREATE_COMMENT,
        ActionType.LIKE_POST,
        ActionType.SEARCH_POSTS,
        ActionType.FOLLOW,
        ActionType.TREND,
    ]
    
    # Load agent profiles and create the graph
    agent_graph = await generate_reddit_agent_graph(
        profile_path="./data/reddit/user_data_36.json",
        model=model,
        available_actions=available_actions,
    )
    
    # Initialize environment with persistent database
    env = oasis.make(
        agent_graph=agent_graph,
        platform=oasis.DefaultPlatformType.REDDIT,
        database_path="./simulation.db",
    )
    
    await env.reset()

The agent profiles JSON file defines personalities, interests, and behavioral tendencies that guide LLM decision-making. This separation of agent identity from action logic is crucial—you can swap models, adjust prompts, or modify action spaces without regenerating entire agent populations.

OASIS supports two execution modes: manual actions (scripted behaviors for controlled experiments) and autonomous LLM-driven decisions. The framework includes integrated recommendation systems—interest-based matching that connects agents to relevant content, and hot-score algorithms that surface trending posts. These aren’t afterthoughts; they’re core to creating realistic platform dynamics. Real social media isn’t just agents shouting into the void; it’s algorithmic curation creating filter bubbles and viral moments.

The persistence layer deserves attention. Every action, post, comment, and relationship change writes to a SQLite database. This enables post-hoc analysis at scale—you can query interaction patterns and track behavioral changes across simulation steps without keeping everything in memory. For million-agent simulations, this database-first design is the difference between feasible and impossible.

The framework follows PettingZoo-style conventions for multi-agent environments, as noted in recent refactoring updates. Each simulation step involves: agents observing their local network state, the LLM generating action decisions based on agent profiles and current context, actions executing against the platform environment, and the environment updating social graph and content feeds. This loop continues for however many steps your research question (and API budget) demands.

Gotcha

Running OASIS at the scale it advertises requires confronting hard economic realities. A single agent action involving LLM inference costs fractions of a cent, but multiply that by thousands of agents taking multiple actions across hundreds of simulation steps, and costs can add up quickly. The README doesn’t provide specific cost estimates, but meaningful large-scale simulations require budget planning. Using GPT-4o-mini instead of more expensive models helps, but there’s no free lunch. Budget-conscious researchers need to carefully design experiments, potentially running smaller pilot studies before scaling up, or seek grant funding that accounts for API costs.

The realism ceiling is equally important to understand. OASIS agents are only as human-like as the underlying LLMs, which means they inherit all the known limitations: weak long-term memory coherence, difficulty with numerical reasoning, cultural biases baked into training data, and tendency toward verbose, overly polite text that doesn’t match actual social media discourse. If your research question depends on accurately modeling specific demographic groups, subcultures, or non-English speaking communities, current LLMs may not capture the behavioral nuances you need. The framework can simulate the mechanics of information spread, but whether agent decisions genuinely reflect human psychology remains an open question that varies by use case.

Multimodal support is under active development (tracked in the project’s GitHub issues), meaning current simulations are primarily text-based. If you’re studying platforms where images, videos, or memes dominate (Instagram, TikTok), OASIS isn’t ready for that yet. The Reddit and Twitter focus makes sense—these are text-heavy platforms—but it limits applicability. Similarly, while the framework supports customization of agent behaviors and platform rules, actually implementing novel social mechanisms requires diving into the codebase rather than just configuring parameters.

Verdict

Use OASIS if you’re conducting academic research on social dynamics that require population-scale agent interactions—studying how misinformation spreads through networks with realistic recommendation algorithms, testing platform design changes like altered engagement metrics or moderation policies, or exploring emergent behaviors like polarization that only appear at scale. It’s particularly valuable when your research question would be unethical or impractical to study on real platforms (for example, deliberately introducing divisive content to measure cascade effects). The framework excels at controlled experiments where you need reproducibility and the ability to manipulate variables impossible to isolate in the wild. Skip OASIS if you’re working with tight budgets and can’t absorb API costs—small agent counts (under 100) don’t justify the framework overhead compared to simpler tools. Also skip it if you need production-ready systems with real-time constraints; simulation speeds depend on LLM API latency and aren’t suitable for live applications. Finally, if your research requires capturing highly specific human behaviors or cultural contexts that current LLMs poorly model, traditional social science methods or human subject studies remain more appropriate despite their limitations.

// ADD TO YOUR README
[![Featured on Starlog](https://starlog.is/api/badge/ai-agents/camel-ai-oasis.svg)](https://starlog.is/api/badge-click/ai-agents/camel-ai-oasis)