Skip to main content

Honest multi-agent research framework — engine + DSL/gates kits + LLM Protocols

Project description

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)

  1. Gate completeness is a type invariant — a result cannot classify as fruit without a complete GateRecord and execution_mode == "tool_executed".
  2. Single writercycle.run_cycle is the only forest-state mutator; deliberation and trajectory operators are pure (read-only on Forest).
  3. Different-model skepticmake_llm_skeptic refuses to run when its model family equals the gardener's.
  4. No fruit by lineage — trajectory mutate / crossover produce children with final_classification = None; sick parents are excluded.
  5. No silent fallback — LLM unavailability is always hard fail.

License

MIT. See ../LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rainforest_lab-0.1.0.tar.gz (65.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rainforest_lab-0.1.0-py3-none-any.whl (57.5 kB view details)

Uploaded Python 3

File details

Details for the file rainforest_lab-0.1.0.tar.gz.

File metadata

  • Download URL: rainforest_lab-0.1.0.tar.gz
  • Upload date:
  • Size: 65.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rainforest_lab-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3da7f97739e268e335a62bb4b463072ed3e901276df86f26c5b8ca57d915f289
MD5 09a74b2f5f6e6e842054b9600a36eeac
BLAKE2b-256 c6e6ef6253ffc06ebab7e0419a929d0eee76be55f1a9c86553440527c34a5da1

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainforest_lab-0.1.0.tar.gz:

Publisher: release.yml on KrakenP/rainforest-lab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rainforest_lab-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rainforest_lab-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 57.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rainforest_lab-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2ad5f72f9dc34b288024d4912f877fecee8b291ec7675f5858d285a65e2adf1
MD5 7d3a58b6eae51266f2009f93f04512ba
BLAKE2b-256 3a27f73d393fa86e88281b0c71387bff02dcf06908ca862db552c3b7997a13ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for rainforest_lab-0.1.0-py3-none-any.whl:

Publisher: release.yml on KrakenP/rainforest-lab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page