rainforest-lab (Python package)
pip install rainforest-lab — the engine of the rainforest research framework.
This package implements the rainforest engine (v1 + v2.0 multi-agent deliberation + v2.1 trajectory
primitives), four LLM Protocols, a LiteLLM reference adapter, and two reusable kits (dsl, gates)
so each new domain plugin stays ~150 lines.
See the top-level README for the project vision; this README is package-level.
Install
pip install rainforest-lab
# Optional: LiteLLM reference adapter (~100 providers behind one interface)
pip install "rainforest-lab[litellm]"
30-second tour
from rainforest_lab import (
DemoDomain, Forest, run_cycle,
MockGardener, MockInspector, MockSkeptic,
DeliberationConfig, ParallelGardenersConfig,
)
# Build a Forest, then drive one cycle with mocked LLMs (replace with real ones in production).
# See examples/quick_start.py for a runnable end-to-end demo.
examples/quick_start.py— end-to-end demo with mocked LLMs.examples/bring_your_own_llm.py— plug your own LLM SDK in via the framework's builders.examples/write_your_own_domain.py— template for a new market plugin (~150 lines).
What's in here
| Module | What |
|---|---|
state · validate · classify |
Canonical state model + fail-loud validator + result classification |
weather · seeds · roles · events · handoff |
Per-cycle attention router, seed scoring/nursery, agent-attributed events, schema'd handoff protocol |
cycle · deliberation · trajectories |
The cycle driver, v2.0 multi-agent deliberation, v2.1 trajectory evolution primitives |
domain |
The ResearchDomain ABC + cache_dir() helper |
dsl.types · dsl.parser · dsl.evaluator · dsl.random_formula |
The DSL kit |
gates.factor_gates · gates.matched_random · gates.profiles |
The gates kit |
llm.protocols · llm.builders · llm.litellm_adapter · llm.mocks |
LLM-agnostic protocols + builders + reference adapter |
domains.demo |
Reference domain plugin using the kits |
Rigor invariants (test-guarded)
- Gate completeness is a type invariant — a result cannot classify as
fruitwithout a completeGateRecordandexecution_mode == "tool_executed". - Single writer —
cycle.run_cycleis the only forest-state mutator; deliberation and trajectory operators are pure (read-only onForest). - Different-model skeptic —
make_llm_skepticrefuses to run when its model family equals the gardener's. - No fruit by lineage — trajectory
mutate/crossoverproduce children withfinal_classification = None; sick parents are excluded. - No silent fallback — LLM unavailability is always hard fail.
License
MIT. See ../LICENSE.
Metadata
Release files for rainforest-lab 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rainforest_lab-0.1.0.tar.gz | 65.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rainforest_lab-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 123.2 kB
Release files / rainforest_lab-0.1.0.tar.gz
| Download URL | rainforest_lab-0.1.0.tar.gz |
|---|---|
| Size | 65.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3da7f97739e268e335a62bb4b463072ed3e901276df86f26c5b8ca57d915f289
|
|
BLAKE2b-256 checksum How to use checksums |
c6e6ef6253ffc06ebab7e0419a929d0eee76be55f1a9c86553440527c34a5da1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 28, 2026.
Transparency logRelease files / rainforest_lab-0.1.0-py3-none-any.whl
| Download URL | rainforest_lab-0.1.0-py3-none-any.whl |
|---|---|
| Size | 57.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f2ad5f72f9dc34b288024d4912f877fecee8b291ec7675f5858d285a65e2adf1
|
|
BLAKE2b-256 checksum How to use checksums |
3a27f73d393fa86e88281b0c71387bff02dcf06908ca862db552c3b7997a13ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 28, 2026.
Transparency log