Agentopia 中文 | 英文 | 日文 | 韩文 Agentopia 是一个用于在多代理社会中进行长期生命模拟的框架。Agentopia 可以模拟人类、机器人、动物、植物、病毒、微生物等各种代理的行为。
Agentopia 中文 | 英文 | 日文 | 韩文 Agentopia 是一个用于在多代理社会中进行长期生命模拟的框架。Agentopia 可以模拟人类、机器人、动物、植物、病毒、微生物等各种代理的行为。
Agentopia is a framework for long-term life simulation in multi-agent societies. Agentopia simulates human social life across years: In our experiments, 100 agents autonomously take part in social life over 10 simulated years. They set and pursue their own goals, develop and fulfill their needs, and interact with other agents to build relationships within the society.
It is built around two questions: can we build an AI agent society where agents effectively simulate human life, and can experience and rewards from such a society improve LLMs' capabilities? To the latter end, we define a life reward that mirrors human well-being — social standing, subjective fulfillment, and economic status — and use it to train large language models, improving their anthropomorphism and role-playing ability.
Agentopia simulates human social life at the scale of years. Each agent:
An environment model (a capable LLM) serves as the generative engine orchestrating the simulation — verifying agent responses, providing feedback, and scheduling events — without hard-coded rules.
…pip install -r requirements.txtcp config.example.json config.jsonEdit config.json:
world.name to the world you want to run (e.g. apartment, school)role_model and god_model to model names defined in modelsworld.time.n_year to control the length of the simulationfallback_model to a model used if the primary call fails (e.g., the response cannot be correctly parsed)max_concurrency to control the maximum number of parallel LLM requestspython scripts/run_world.pyTo override the world at runtime:
python scripts/run_world.py --world apartmentAgentopia supports multiple LLM backends. Configure them in config.json under models:
| Backend | Required fields |
|---|---|
| OpenAI-compatible (vLLM, local) | url, api_key, vllm_model_name |
| Anthropic (Claude) | api_key, anthropic_model_name |
| Google Gemini (Vertex AI) | credentials_file, project, location |
| Azure OpenAI | url, api_key, api_version |
For thinking-capable models served via vLLM, set "enable_thinking": true in the model config.
Each run gets its own directory under data/, named worldname_MMDDHHMM (e.g.
school_06031205). On start it is copied from the base world (e.g. data/school/),
then all simulation output is written into it. Data is append-only JSONL except for
profiles and config files.
…A primary goal of Agentopia is to improve the anthropomorphic role-playing
ability of LLMs through social simulation. To that end, scripts/build_rft_data.py
selects, from a finished simulation, the high-advantage trajectories (see Section 4
of the paper) and packages them into training data.
It measures agents' life-reward and calculates returns and advantages,
selects the highest-advantage trajectories, and collects their generation traces into a
training set.
python scripts/build_rft_data.py --data-dir school_06031205 --top 0.25 Key arguments:
--data-dir (required): a specific simulation run directory under data/, named
worldname_ (e.g. school_06031205) — not the base world name school.--top: fraction of top trajectories to keep per period (defaults to
world.reward.rft_top_fraction in config.json).--n-year: restrict selection to the first N simulated years.Outputs (under rft_data/):
rft_data/_YW.jsonl — training samplesrft_data/_YW.md — statistics report on the selected training samplesrft_data/god__YW.jsonl — sampled environment-model
generation data (only if data//god/ exists)The repo ships a set of Claude Code skills under
.claude/skills/ for inspecting a finished run. When working in Claude Code, invoke a
skill by name (e.g. analyze run school_06031205); each skill also lists trigger
phrases in its SKILL.md frontmatter.
| Skill | What it does |
|---|---|
analyze-run |
Qualitative deep-dive into a run — agent experiences, inner journey, personality growth — producing system-level and per-agent reports under data//run_analysis/. |
run-metrics |
Quantitative metrics for a run (tokens, contacts, activities, spending, skills, fulfillment, social eval). Wraps scripts/compute_metrics.py; writes analysis/results/_metrics.json. |
analyze-activity |
Checks whether agents' activity-phase utterances read like a real human, against the criteria in analyze-activity/PRINCIPLES.md. Uses scripts/extract_activity_dialogues.py. |
time-analysis |
Reports per-week wall-clock time consumed by a run, parsed from logs//world.log. Wraps scripts/time_analysis.py. |
These skills are optional analysis helpers; they are not required to run a simulation.
This project is released under the MIT License.
暂无开放 Issues,或尚未同步最近议题。