Basic Environment Settings

OASIS provides a powerful simulation environment for social media platforms. This guide covers the basic configuration options for setting up your simulation environment.

Environment Initialization

To create a simulation environment, use the make function from OASIS:

import oasis
from oasis import DefaultPlatformType

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

Core Environment Parameters

When initializing the OASIS environment, you can configure the following core parameters:

ParameterTypeDescription
agent_graphAgentGraphAn AgentGraph instance that stores all the social agents in the simulation. For more details, see Agent Graph
platformDefaultPlatformType or PlatformThe platform type to use (TWITTER or REDDIT) or a custom Platform instance
database_pathstrPath to create a SQLite database (must end with .db)
semaphoreintLimit on concurrent LLM requests (default: 128)

For more details, see the Platform, Agent Profile, Model and Actions Module.

Environment Lifecycle

The OASIS environment has a simple lifecycle you can manage with these methods:

# Initialize the environment
await env.reset()

# Run simulation steps
for _ in range(n):
    await env.step(actions)

# Close the environment when done
await env.close()

For more action details, see Actions Module