Skip to main content

AgentSims

A Python framework for time-stepped multi-agent simulations with role cards, agent memory, replaceable LLM backends, adaptive retrieval, SQLite persistence, and terminal replay. Requires Python 3.10 or later.

Source: https://github.com/muyuhuatang/agentsims · Website: https://agentsims.agentsnet.org

Install

python -m pip install agentsims

Optional extras:

python -m pip install "agentsims[demo]"        # FastAPI and Uvicorn for the demo API
python -m pip install "agentsims[notebooks]"   # JupyterLab and Matplotlib
python -m pip install "agentsims[retriever]"   # DuckDuckGo search via ddgs

Example

from agentsims import RoleCard, Scenario, Simulation, Tier

scenario = Scenario(
    name="Policy discussion",
    ticks=3,
    initial_metrics={"tension_level": 0.3},
    agents=[
        RoleCard(name="Council", type="institution", tier=Tier.FULL,
                 goals=["Agree on a shared resource plan"]),
        RoleCard(name="Observers", type="public", tier=Tier.RULE),
    ],
)
results = Simulation(scenario, db_path="agentsims.db").run()
try:
    results.report()
finally:
    results.db.close()

The default backend calls the Anthropic API and needs ANTHROPIC_API_KEY; live calls are billed by the provider. Subclass BaseLLM to run with another backend, or offline with a scripted one.

Examples, scenarios, and notebooks

This package contains only the library. The repository also has an offline example that needs no API key, four scenario scripts, four notebooks, a cookbook, and a read-only FastAPI demo. To use them, install from a source checkout:

git clone https://github.com/muyuhuatang/agentsims.git
cd agentsims
python -m pip install -e ./packages/agentsims
python examples/offline_simulation.py

The examples are synthetic simulations, not forecasts. Cost figures in the source come from a static price table and are estimates.

MIT license; see LICENSE.

Metadata

Release files for agentsims 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agentsims 0.1.1
File Size Uploaded Provenance Actions
agentsims-0.1.1.tar.gz 30.3 kB Without provenance Details for agentsims-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agentsims 0.1.1
File Interpreter ABI Platform Actions
agentsims-0.1.1-py3-none-any.whl Python 3 none any Details for agentsims-0.1.1-py3-none-any.whl

Total release size: 70.5 kB

Release files / agentsims-0.1.1.tar.gz

Download URL agentsims-0.1.1.tar.gz
Size 30.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3f524dd5f5e5fc8c21be1d5559ef3f6f29854d625c9e2c0ea2047813e91d0f9e
BLAKE2b-256 checksum
How to use checksums
d6f933d82531c52cdc22296e0c2b4bcea62b25d997f129bddcd8efd61e9b62b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / agentsims-0.1.1-py3-none-any.whl

Download URL agentsims-0.1.1-py3-none-any.whl
Size 40.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aea6aba8a6e2a44772b680cb8585c1b622918a551e71e35245ab625c0189d3e3
BLAKE2b-256 checksum
How to use checksums
7a77f2806300b86e48ee3d5166b6cfb2217a663d8a610746a7618b2489aafada
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for agentsims 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page