docs / environments-sdk / overviewgithub.com/Fareground/environments-sdk ↗

environments-sdk

Describe the world. Define its rules. Run the scenario.

The environments-sdk (fg-env) turns a JSON contract into a rounds-based simulation. Use it to model inventory, pricing, sales pipelines, capacity, negotiations, campaigns, or other interacting decisions. A human or an agent authors the contract; the engine executes it.

Build your first environment → · Authoring workflow · API reference

One contract, one engine

A contract describes people and organizations, products and resources, available actions, information, timing, constraints, and outcomes. Participants can use language models, Python callables, or declarative policies. Use the same engine locally or within a host application.

Start from one of twelve reusable behavioral engines—Market, Council, Dispute, Exchange, Legislature, Contest, Deliberation, Negotiation, Population, Network, Matching, or Strategy—then customize the participants, rules, information, and outcomes. Engines provide interaction mechanics, not finished scenarios. Games and physical, spatial, logistics, or disease models are outside this behavioral catalog.

You need to… Start here
Run a complete business example Quickstart
Translate a scenario brief into rules Authoring scenarios
Understand rounds, actions and state Core concepts
Add demand, lead times, capacity or networks Business modeling
Connect an agent or integrate a runner Participants and hosting
Compare decisions and inspect uncertainty Experiments and validation
Diagnose a failed or unfaithful simulation Troubleshooting
Look up an exact field or expression Contract reference

What makes a simulation useful

The engine enforces the rules you specify. Scenario quality also depends on choosing the right rules, realistic inputs, and meaningful tests. A contract that runs is not automatically a calibrated forecast. Keep assumptions explicit, compare against known outcomes, and report uncertainty.

Install and compatibility

Install the documented environments-sdk release from PyPI.

Python 3.11 or later. The core package depends on Pydantic; language-model clients are optional and supplied by the host.

python -m pip install --upgrade fg-env

Current documented release: 0.7.1. Check your installed version with python -c "import fg_env; print(fg_env.__version__)". Pin fg-env==0.7.1 in reproducible deployments. The migration guide explains the public rename and the older template API.

GitHub repository · PyPI

License

Apache-2.0

Released under the Apache License 2.0. Read the full license →