Train, deploy, and evaluate Social AI agents with Sotopia
Features
Why Sotopia?
Sotopia aims at pushing the boundary of artificial social intelligence through simulating realistic social interaction, supporting human-AI interaction, and evaluating the performance of social agents in a unified way.
Unlike other multi-agent frameworks (CrewAI (opens in a new tab), CAMEL-AI (opens in a new tab), AutoGen (opens in a new tab), and swarm (opens in a new tab)), Sotopia provides a wide range of social tasks and characters with different backgrounds and personalities, and creates a asynchronous and information-imperfect social interaction environment.
Installation
This package supports Python 3.10 and above. There are two ways to setup the package: automatic installation with an interactive installer and manual installation from source.
Interactive Installer
pip install sotopia
sotopia install
export REDIS_OM_URL="redis://localhost:6379"
Or if you want to install from source
Clone the repo and install the package
git clone git@github.com:sotopia-lab/sotopia.git;
pip install -e .
Set up Redis stack
Redis stack is a required dependency for using Sotopia. There are two ways to set up Redis stack:
sotopia install
or manual setup:
Quick Start
You can view an episode demo with default parameters with the following:
import asyncio
from sotopia.samplers import UniformSampler
from sotopia.server import run_async_server
asyncio.run(
run_async_server(
model_dict={
"env": "gpt-4",
"agent1": "gpt-4o-mini",
"agent2": "gpt-4o-mini",
},
sampler=UniformSampler(),
)
)
or if you have cloned the repo, run
python examples/minimalist_demo.py