Sotopia
An open-ended social learning environment for evaluating and fostering social intelligence in language agents.
- Source repo
- sotopia-lab/sotopia
- Stars
- ★ 342
- Last updated
- 10mo ago
- License
- MIT
- Primary language
- Python
- FA score
- 46/100 · Major gaps
At a glance
- How it runs
- Works with
- Portable with changesOpenAI API
- Cost
- Free software; you pay for model usage
- Setup effort
- Medium · a few setup steps
- You'll need
- Typical use
- Social-intelligence researchers comparing how different LLMs behave as agents in the same scenarios.
- Not a fit if
- Users wanting zero-config, no-key setup
- Teams seeking a production social product, not an eval environment
- Source review
- 46/100 · Major gaps
What does this agent do, and when should you use it?
Sotopia is the open-source environment behind an ICLR 2024 spotlight paper on interactive evaluation of social intelligence in language agents. It runs asynchronous social episodes in which an environment model and two agent models interact, configured per role through the run_async_server call. Episodes and data persist either to Redis (the default backend) or to local JSON under ~/.sotopia/data/, and the project ships a Hugging Face dataset and an online demo. It is distributed as an installable Python package with a minimal example script, under the MIT license. Running it requires your own OpenAI API key and paying for model usage.
The sotopia Python package exposes sotopia.server.run_async_server, which drives an asynchronous social episode; model_dict assigns models to env, agent1 and agent2 (for example gpt-4 for the environment and gpt-4o-mini for agents), while a sampler such as sotopia.samplers.UniformSampler picks scenarios. Output is persisted according to SOTOPIA_STORAGE_BACKEND — Redis via REDIS_OM_URL by default, or local JSON files when set to local. Setup is completed with uv run sotopia install, and examples/minimalist_demo.py gives a minimal runnable invocation. The accompanying paper defines evaluation metrics for social intelligence in language agents.
- Social-intelligence researchers comparing how different LLMs behave as agents in the same scenarios.
- RL and multi-agent experimenters treating open-ended social settings as an extensible environment for policies.
- Model developers pairing a strong environment model with cheaper role agents to inspect dialogue quality.
- Educators and demo builders showing multi-agent conversations using the hosted demo and example scripts.
- Engineers prototyping custom scenarios and characters against the quick local JSON backend.
How do you install or deploy this agent?
Create a virtual environment and install with uv:
pip install uv
uv sync --all-extras
uv run sotopia installIf you keep the default Redis backend, start Redis with Docker:
docker run -d -p 6379:6379 redis/redis-stack-server:latestCreate a .env file in the project root with your key and backend:
cat > .env << EOF
OPENAI_API_KEY=your_openai_key_here
SOTOPIA_STORAGE_BACKEND=local
# REDIS_OM_URL=redis://localhost:6379
EOFHow do you use this agent?
uv does not load .env automatically, so pass the file or export the variables. Run the minimal demo:
uv run --env-file .env python examples/minimalist_demo.pyOr call the async server directly with per-role models:
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(),
)
)The README warns that the server will not run locally without any datasets installed.
What are this agent's strengths and limitations?
- Backed by an ICLR 2024 spotlight paper and arXiv preprint, giving the evaluation a published methodology.
- Per-role model configuration (env, agent1, agent2) makes side-by-side LLM comparisons straightforward.
- Swappable storage backend: default Redis for production-style use, or dependency-free local JSON for quick testing.
- Usable as a Python library — run_async_server and samplers can be embedded in existing experiment code.
- Requires your own OPENAI_API_KEY and per-token model spending; no bundled model access.
- The default Redis backend needs a Redis server, and the README warns non-Docker installs are error-prone.
- Experimental framework features are unavailable with the local JSON backend, narrowing that path.
- README cautions that the documentation may be outdated relative to the code.
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Sotopia This agent | 46 · Major gaps | Library / SDKFree + model costs | ★ 342 | 10mo ago | Python | OpenAI API |
| Concordia: A Library for Generative Social Simulation | 62 · Some gaps | Library / SDKFree + model costs | ★ 1.9k | 4d ago | Python | — |
| MobileGym | 67 · Some gaps | CLIFree + model costs | ★ 856 | 1mo ago | Python | — |
| MiroFish Offline | 40 · Major gaps | Self-hosted serviceFree | ★ 2.7k | 7mo ago | Python | OpenAI API · Claude API |
How does FollowAgents rate this agent?
Why each dimension lost points
Trust is weak overall. Least privilege: code and UI default to a remote Modal endpoint and read OPENAI_API_KEY/REDIS_OM_URL with no scope or minimization guidance, deducted. User confirmation: install tests use destructive flags like --overwrite-existing-data and no product-side confirmation flow is documented, deducted. Data-flow transparency: README documents env vars and storage backends but not which third-party LLM services receive conversation/evaluation data, deducted. Sensitive data: social simulation involves personas and dialogues with no redaction or retention policy, deducted. Dependency security: a git-branch dependency (aact) and wide version ranges with no audit or lock guidance, deducted. External effects: writes to Redis/local data and calls external APIs with no rollback or isolation notes, deducted. Source attribution: README cites the paper, dataset and project page clearly, scored 2.
Self-consistency: server.py validates actions and retries once; tests use mocked LLMs and local backend, fairly consistent, scored 2. Dependency availability: aact pinned to git main, litellm unbounded, Redis required externally, weak reproducibility, deducted. Failure messages: some exceptions are swallowed via pass or print (ui/app.py update_database_callback, test cleanup), deducted.
Audience and scenarios: README covers install, sample server, UI and dev guide for researchers and developers, scored 2. Capability boundaries: no explicit statement of model limits, cost, or suitable/unsuitable use, deducted. Trigger precision: as a framework there is no clear invocation contract, deducted. Environment fit: supports Redis and local JSON backends and multi-OS CI, scored 2.
Information architecture: README is well structured with install, env vars, examples, scored 2. Install notes: uv install, Docker Redis, .env sample provided, fairly complete, scored 2. Naming stability: version 0.1.5 with git-branch dependency and no API stability promise, deducted. Examples and FAQ: minimal example and Colab present but no FAQ, deducted. Known limitations: only scattered warnings (datasets needed, docs may be outdated), no systematic list, deducted. License: full MIT text, scored 3. Versioning/changelog: version present but no CHANGELOG, deducted. Maintenance responsibility: no governance or maintainer responsibility statement and publisher unverified, deducted.
Output usability: runnable examples, UI and evaluation dimensions produce readable output, scored 2. Marginal value: clear research value as a social-intelligence evaluation environment, scored 2. Cost-benefit: requires LLM APIs and Redis with high setup and runtime cost not documented, deducted.
Claim traceability: README cites the ICLR paper and dataset, traceable, scored 2. Cross-source corroboration: only README and a few tests, little independent documentation, deducted. Fact/inference separation: docs do not clearly separate verified results from design intent, deducted.
- The UI defaults to a remote Modal endpoint; confirm data destination and API-key exposure before use.
- The install flow includes destructive options like --overwrite-existing-data; back up data first.
- The aact dependency points to git main, making builds non-reproducible; pin a commit.
- Social simulation data may contain personas and dialogues; assess privacy and retention yourself.
- Publisher identity is unverified; do not infer safety or quality from the brand.
Recent releases
Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.
-
v0.1.5 v0.1.5 Make redis optional
Release notes excerpt
* Feature/multi agent framework by @Keyu-He in https://github.com/sotopia-lab/sotopia/pull/329 * Fix custom/local model support bugs by @Keyu-He in https://github.com/sotopia-lab/sotopia/pull/338 * sotopia redis optional by @XuhuiZhou in https://github.com/sotopia-lab/sotopia/pull/341View on GitHub ↗ -
Release notes excerpt
What's Changed * Update langchain requirement from <0.3.0,>=0.2.5 to >=0.2.5,<0.4.0 by @dependabot in https://github.com/sotopia-lab/sotopia/pull/236 * [Automated] Merge release into main by @ProKil in https://github.com/sotopia-lab/sotopia/pull/235 * update macos test runner as macos-latest by @ProKil in https://github.com/sotopia-lab/sotopia/pull/238 * feat(exp_eval): support tag for combo iteration by @lwaekfjlk in https://github.com/sotopia-lab/sotopia/pull/245 …View on GitHub ↗ -
Release notes excerpt
What's Changed * UI update by @XuhuiZhou in https://github.com/sotopia-lab/sotopia/pull/273 Full Changelog: https://github.com/sotopia-lab/sotopia/compare/v0.1.2...v0.1.3View on GitHub ↗
FAQ
What credentials and services do I need for one episode?
Can it run offline or with local models?
How do I avoid installing Redis during development?
Why won't the local server start?
Thanks — we use this to improve the page.