A seeded, weather-guided research framework for AI agents.
面向 AI coding agent 的系统构建说明文档。
Rainforest Lab is a framework for managing open-ended AI research.
It helps an AI agent avoid over-focusing on a single promising direction by organizing research into a forest of directions, allocating research attention through a weather system, and creating new directions through a seed system.
This document is written for an AI coding agent that will start building the system from scratch.
The first implementation should be a minimal but extensible research framework, not a full production trading platform.
Rainforest Lab
A seeded, weather-guided research framework for AI agents.
Rainforest Lab treats research as an evolving forest:
- Research directions are trees.
- Hypotheses are branches.
- Successful validated results are fruits.
- Failed experiments are leaves.
- Valuable failures are golden leaves.
- New potential directions are seeds.
- Low-cost validation happens in a nursery.
- The weather system allocates attention and research budget.
- The forest grounding stage initializes the environment through user-guided brainstorming.
Build a system that helps AI agents:
- Maintain multiple research directions.
- Dynamically allocate research attention.
- Avoid over-digging one direction.
- Preserve useful failures.
- Generate and validate new research seeds.
- Keep research memory structured and reusable.
- Support quantitative research first, while remaining general enough for other research domains.
The first version should focus on a local, file-based framework that can run without cloud infrastructure.
Build these modules first:
- Forest Grounding
- Tree Registry
- Seed System
- Nursery
- Weather Router
- Research Task Planner
- Result Classifier
- Archive / Memory Store
- Basic CLI
- Config files
- Unit tests
Avoid these in the first version:
- Real brokerage integration
- Live trading
- Complex UI
- Distributed execution
- Full web app
- Vector database dependency
- Heavy workflow engine
- Automatic use of paid APIs by default
- Any claim that the system can generate profitable strategies
The MVP should prove the research orchestration loop:
User intent
→ Forest grounding
→ Initial trees and seeds
→ Weather allocation
→ Research tasks
→ Experiment results
→ Fruit / leaf classification
→ Memory update
→ Next cycle
The first version can use mock experiments or simple user-provided results. It does not need to implement a full backtesting engine internally.
Use a simple Python-first stack.
Language: Python 3.11+
Config: YAML
Storage: SQLite + local JSON/Markdown files
CLI: Typer or Click
Validation: Pydantic
Testing: pytest
Formatting: ruff + black
Optional notebooks: Jupyter
Recommended package layout:
rainforest_lab/
__init__.py
cli.py
config/
core/
grounding/
forest/
seeds/
weather/
nursery/
research/
archive/
shared_experts/
utils/
tests/
examples/
docs/
configs/
prompts/
Create this structure:
rainforest-lab/
├── README.md
├── pyproject.toml
├── configs/
│ ├── default.yaml
│ ├── quant_a_share.yaml
│ └── research_generic.yaml
├── docs/
│ ├── concept.md
│ ├── build_spec.md
│ ├── weather_system.md
│ ├── seed_system.md
│ ├── forest_grounding.md
│ └── examples.md
├── prompts/
│ ├── forest_grounding.md
│ ├── seed_generation.md
│ ├── tree_research.md
│ └── result_classification.md
├── examples/
│ ├── quant_mock_cycle/
│ └── generic_research_cycle/
├── rainforest_lab/
│ ├── __init__.py
│ ├── cli.py
│ ├── core/
│ │ ├── models.py
│ │ ├── enums.py
│ │ └── scoring.py
│ ├── grounding/
│ │ ├── interview.py
│ │ ├── mapper.py
│ │ └── templates.py
│ ├── forest/
│ │ ├── manager.py
│ │ ├── registry.py
│ │ └── profiles.py
│ ├── seeds/
│ │ ├── generator.py
│ │ ├── router.py
│ │ └── bank.py
│ ├── nursery/
│ │ ├── validator.py
│ │ └── promotion.py
│ ├── weather/
│ │ ├── router.py
│ │ ├── climate.py
│ │ └── allocation.py
│ ├── research/
│ │ ├── planner.py
│ │ ├── task.py
│ │ └── executor_stub.py
│ ├── archive/
│ │ ├── store.py
│ │ ├── sqlite_store.py
│ │ └── markdown_exporter.py
│ ├── shared_experts/
│ │ ├── base.py
│ │ ├── leakage.py
│ │ ├── cost.py
│ │ ├── correlation.py
│ │ └── robustness.py
│ └── utils/
│ ├── ids.py
│ ├── time.py
│ └── yaml_io.py
└── tests/
├── test_grounding.py
├── test_weather_router.py
├── test_seed_router.py
├── test_nursery.py
└── test_archive.py
Use Pydantic models for all core objects.
Create these enums in core/enums.py:
from enum import Enum
class TreeStatus(str, Enum):
SAPLING = "sapling"
YOUNG = "young"
MATURE = "mature"
DORMANT = "dormant"
PRUNED = "pruned"
class SeedStatus(str, Enum):
ACTIVE = "active"
DORMANT = "dormant"
REJECTED = "rejected"
PROMOTED = "promoted"
class SeedSourceType(str, Enum):
GENESIS = "genesis"
GOLDEN_LEAF = "golden_leaf"
CROSS_TREE = "cross_tree"
REGIME = "regime"
DATA_SOURCE = "data_source"
COUNTERFACTUAL = "counterfactual"
EXTERNAL = "external"
RANDOM = "random"
class ResultType(str, Enum):
FRUIT = "fruit"
GOLDEN_LEAF = "golden_leaf"
NORMAL_LEAF = "normal_leaf"
DEAD_LEAF = "dead_leaf"
SICK_LEAF = "sick_leaf"
class ClimateMode(str, Enum):
EXPLORATION = "exploration"
BALANCED = "balanced"
HARVEST = "harvest"
RESTORATION = "restoration"
DIVERSIFICATION = "diversification"
CRISIS = "crisis"
class WeatherType(str, Enum):
DRIZZLE = "drizzle"
RAIN = "rain"
HEAVY_RAIN = "heavy_rain"
DROUGHT = "drought"
WIND = "wind"
THUNDERSTORM = "thunderstorm"
FOG = "fog"
FROST = "frost"
HEATWAVE = "heatwave"
TYPHOON = "typhoon"Create in core/models.py:
from pydantic import BaseModel, Field
from typing import Any, Optional
from .enums import ClimateMode
class MarketProfile(BaseModel):
name: str
asset_class: str = "unknown"
universe: Optional[str] = None
benchmark: Optional[str] = None
rebalance_preference: Optional[str] = None
class TerrainProfile(BaseModel):
constraints: dict[str, Any] = Field(default_factory=dict)
notes: list[str] = Field(default_factory=list)
class DataSoilProfile(BaseModel):
price_volume: float = 0.0
fundamentals: float = 0.0
analyst_forecast: float = 0.0
fund_flow: float = 0.0
news_text: float = 0.0
alternative_data: float = 0.0
microstructure: float = 0.0
macro: float = 0.0
class RegimeProfile(BaseModel):
trend_strength: float = 0.5
volatility_level: float = 0.5
turnover_level: float = 0.5
style_rotation: float = 0.5
risk_appetite: float = 0.5
policy_intensity: float = 0.5
liquidity_condition: float = 0.5
class ClimateConfig(BaseModel):
mode: ClimateMode = ClimateMode.EXPLORATION
temperature: float = 1.2
min_rainfall: float = 0.15
seed_budget: float = 0.20
max_tree_share: float = 0.30
max_consecutive_depth: int = 2
novelty_weight: float = 0.35
balance_lambda: float = 0.25
overfit_penalty: float = 0.50
shared_expert_strictness: float = 0.50
class EnvironmentProfile(BaseModel):
market: MarketProfile
terrain: TerrainProfile = Field(default_factory=TerrainProfile)
data_soil: DataSoilProfile = Field(default_factory=DataSoilProfile)
current_regime: RegimeProfile = Field(default_factory=RegimeProfile)
climate: ClimateConfig = Field(default_factory=ClimateConfig)from pydantic import BaseModel, Field
from typing import Optional
from .enums import TreeStatus
class TreePriors(BaseModel):
terrain_fit: float = 0.5
regime_fit: float = 0.5
data_readiness: float = 0.5
logic_strength: float = 0.5
novelty_potential: float = 0.5
cross_pollination_potential: float = 0.5
class TreeSoil(BaseModel):
data_quality: float = 0.5
latency_risk: float = 0.5
transaction_cost_risk: float = 0.5
capacity_limit: float = 0.5
leakage_risk: float = 0.5
class TreeWeatherState(BaseModel):
moisture: float = 0.5
drought_need: float = 0.0
attention_prior: float = 0.0
recent_budget_share: float = 0.0
recent_success_rate: float = 0.0
dormancy: float = 0.0
overdigging: float = 0.0
redundancy: float = 0.0
overfit_risk: float = 0.0
golden_leaf_density: float = 0.0
class TreeProfile(BaseModel):
tree_id: str
name: str
core_logic: str
status: TreeStatus = TreeStatus.MATURE
priors: TreePriors = Field(default_factory=TreePriors)
soil: TreeSoil = Field(default_factory=TreeSoil)
weather: TreeWeatherState = Field(default_factory=TreeWeatherState)
max_initial_budget_share: float = 0.18
max_consecutive_depth: int = 2
notes: list[str] = Field(default_factory=list)from pydantic import BaseModel, Field
from typing import Optional
from .enums import SeedSourceType, SeedStatus
class Seed(BaseModel):
seed_id: str
source_type: SeedSourceType
idea: str
related_trees: list[str] = Field(default_factory=list)
financial_logic: Optional[str] = None
data_requirement: list[str] = Field(default_factory=list)
validation_plan: Optional[str] = None
novelty_score: float = 0.5
logic_strength: float = 0.5
data_availability: float = 0.5
regime_relevance: float = 0.5
cross_tree_potential: float = 0.5
validation_cost: float = 0.5
leakage_risk: float = 0.5
status: SeedStatus = SeedStatus.ACTIVE
priority: float = 0.5
notes: list[str] = Field(default_factory=list)from pydantic import BaseModel, Field
from typing import Any, Optional
from .enums import ResultType
class ResearchTask(BaseModel):
task_id: str
tree_id: str | None = None
seed_id: str | None = None
title: str
hypothesis: str
research_mode: str
budget: float
validation_plan: str
expected_output: str = "experiment_result"
class ExperimentResult(BaseModel):
experiment_id: str
task_id: str
tree_id: str | None = None
seed_id: str | None = None
hypothesis: str
metrics: dict[str, Any] = Field(default_factory=dict)
summary: str = ""
risks: list[str] = Field(default_factory=list)
result_type: ResultType | None = None
classification_reason: Optional[str] = None
revival_condition: Optional[str] = None
generated_seed_ideas: list[str] = Field(default_factory=list)Forest Grounding is the initialization phase.
It replaces the term “Genesis Interview”.
Forest Grounding converts user-friendly research intent into executable environment variables.
The user should not need to directly set abstract parameters such as temperature, moisture, soil penalty, rainfall, or drought.
Instead, the system asks normal questions and maps answers to configuration.
Implement a guided interview with these questions:
- What is your research goal?
- What market or domain are you studying?
- What data do you have?
- What are your cost, frequency, or implementation constraints?
- Which mistake are you most worried about?
- Which directions do you want to emphasize?
- Which directions should be avoided or deprioritized?
- How much should the AI ask for approval?
Implement mapping rules in grounding/mapper.py.
Broad exploration
→ climate_mode = exploration
→ temperature high
→ seed_budget high
→ max_tree_share low
→ novelty_weight high
Filter existing ideas
→ climate_mode = balanced
→ temperature medium
→ seed_budget medium
→ robustness medium
Validate candidates
→ climate_mode = harvest
→ temperature low
→ seed_budget low
→ robustness high
→ shared expert strictness high
Repair unstable results
→ climate_mode = restoration
→ overfit_penalty high
→ audit budget high
→ sick leaf sensitivity high
Fear missing new directions
→ seed_budget up
→ novelty_weight up
→ germination_threshold down
Fear overfitting
→ overfit_penalty up
→ promotion_threshold up
→ shared_expert_strictness up
Fear research too scattered
→ top_k down
→ seed_slots down
→ max_tree_share up
Fear drilling one direction too deeply
→ min_rainfall up
→ max_tree_share down
→ max_consecutive_depth down
Fear non-tradable results
→ transaction_cost_weight up
→ capacity_weight up
→ turnover_penalty up
Forest Grounding should generate:
configs/environment.generated.yaml
configs/tree_profiles.generated.yaml
configs/genesis_seeds.generated.yaml
After grounding, generate a plain-language summary:
Your forest will start in exploration mode.
The system will allocate more attention to seeds and cold directions.
Fund flow and industry rotation receive a small initial boost.
News sentiment is set to dormant due to data constraints.
The system will prevent any single tree from using more than 30% of early research budget.
The Weather System is the attention and research budget scheduler.
Use these system-level concepts:
| Concept | Meaning |
|---|---|
| Moisture | How much a tree deserves attention now |
| Drought Need | Whether a tree is overused or risky |
| Temperature | Exploration entropy |
| Rainfall | Research budget allocation |
| Wind | Cross-tree attention shift or regime revaluation |
| Cloud Density | Accumulated untested hypotheses |
| Humidity | Latent clue density |
| Heatwave | Overfitting or excessive excitement |
| Fog | Low confidence due to unclear evidence |
| Frost | Risk freeze |
Implement in core/scoring.py:
Moisture_i =
m1 * RegimeFit_i
+ m2 * GoldenLeafDensity_i
+ m3 * Dormancy_i
+ m4 * Uncertainty_i
+ m5 * NoveltyPotential_i
+ m6 * DataReadiness_i
+ m7 * CrossPollinationPotential_i
- n1 * RecentBudgetShare_i
- n2 * Redundancy_i
- n3 * OverfitRisk_i
- n4 * SoilPenalty_i
- n5 * CostPenalty_i
Use a simple default weighted average first. Make weights configurable.
DroughtNeed_i =
v1 * Overdigging_i
+ v2 * Redundancy_i
+ v3 * MarginalReturnDecay_i
+ v4 * OverfitRisk_i
+ v5 * Crowding_i
+ v6 * SamePatternGeneration_i
MVP can approximate unavailable fields with 0.0 and gradually improve.
Convert tree scores into allocation:
Attention_i = softmax(Moisture_i / Temperature)
Then apply constraints:
- Enforce
min_rainfall. - Enforce
max_tree_share. - Penalize high
drought_need. - Reserve
seed_budgetfor seeds. - Reserve optional budget for golden leaf revival.
- Normalize to 1.0.
For each tree:
High moisture + low drought → rain or heavy rain
Medium moisture → drizzle or rain
Low moisture + high dormancy → drizzle
High moisture + high drought → heatwave or drought
High fog signals → fog
High risk signals → frost
Regime shift → wind
System-level low novelty → thunderstorm
Every cycle must produce a weather log:
cycle_id: cycle_001
climate_mode: exploration
temperature: 1.2
allocations:
fund_flow: 0.18
industry_rotation: 0.16
fundamentals: 0.11
seed_budget: 0.20
weather_events:
- tree_id: fund_flow
weather: rain
reason: high regime fit and user interest, but capped by max_tree_share
- tree_id: news_sentiment
weather: drizzle
reason: dormant due to data constraintsThe Seed System creates new research directions.
Implement generation support for:
- Genesis seeds
- Golden leaf seeds
- Cross-tree seeds
- Regime seeds
- Data source seeds
- Counterfactual seeds
- External knowledge seeds
- Random mutation seeds
Implement in seeds/router.py:
SeedScore_j =
a1 * Novelty_j
+ a2 * LogicStrength_j
+ a3 * RegimeRelevance_j
+ a4 * CrossTreePotential_j
+ a5 * DataAvailability_j
+ a6 * FailureInsight_j
- b1 * ValidationCost_j
- b2 * Redundancy_j
- b3 * SpeculationRisk_j
- b4 * LeakageRisk_j
Rules:
SeedScore >= germination_threshold
→ active seed, send to nursery
Medium score with future value
→ dormant seed bank
Low score or high leakage risk
→ rejected archive
If user strongly favors a tree, generate counterfactual seeds for it.
Example:
User favors fund flow.
Generate:
- When is fund inflow actually distribution?
- When does fund flow fail due to high turnover?
- Which industries show false fund flow signals?
The Nursery is a low-cost validation layer for seeds.
Implement these checks:
- Is the hypothesis clear?
- Is required data available?
- Is there obvious leakage risk?
- Is it redundant with existing trees?
- Can it be validated cheaply?
- Is there at least one plausible local validity condition?
- Does it have a basic research plan?
Seed → Sprout → Sapling → Young Tree → Mature Tree
MVP should implement:
Seed → Sprout → Sapling
Later versions can implement Young Tree and Mature Tree promotion.
Seed to Sprout:
clear hypothesis
available data
not obviously leaking
not fully redundant
Sprout to Sapling:
some early evidence
clear next validation plan
not pure speculation
The task planner converts weather allocation into research tasks.
Tasks can come from:
- Active trees
- Active seeds
- Golden leaves
- Counterfactual checks
- Weather-triggered revaluation
- User-requested directions
explore_tree
validate_seed
revive_golden_leaf
counterfactual_test
cross_tree_pollination
robustness_check
prune_tree
summarize_memory
Each task should include:
task_id: task_001
type: validate_seed
tree_id: fund_flow
seed_id: seed_003
hypothesis: "High turnover weakens fund flow continuation."
budget: 0.05
validation_plan: "Run simple grouped backtest or request external evaluator."
expected_output: experiment_resultClassify every result.
A result becomes Fruit if:
It passes initial validation.
It is not obviously leaking.
It has useful signal or research value.
It is not highly redundant.
It has a next-step validation path.
For quant research, Fruit does not mean tradable. It means research candidate.
A failed result becomes Golden Leaf if:
It fails overall but works in a sub-regime.
It reveals a boundary condition.
It is low-correlation but weak.
It suggests a new seed.
It explains why a tree fails.
It can become valuable under future conditions.
Dead Leaf means:
Weak logic.
Weak evidence.
No useful boundary.
Low revival value.
Sick Leaf means:
Data leakage.
Future function.
Overfit pattern.
Invalid data handling.
Non-tradable artifact.
Spurious relationship.
Sick Leaves should be archived as warnings and should not be reused.
Use SQLite as the default local database.
Implement these tables:
CREATE TABLE trees (
tree_id TEXT PRIMARY KEY,
name TEXT NOT NULL,
core_logic TEXT,
status TEXT,
profile_json TEXT,
created_at TEXT,
updated_at TEXT
);
CREATE TABLE seeds (
seed_id TEXT PRIMARY KEY,
source_type TEXT,
idea TEXT NOT NULL,
status TEXT,
related_trees_json TEXT,
score REAL,
seed_json TEXT,
created_at TEXT,
updated_at TEXT
);
CREATE TABLE tasks (
task_id TEXT PRIMARY KEY,
task_type TEXT,
tree_id TEXT,
seed_id TEXT,
title TEXT,
hypothesis TEXT,
budget REAL,
task_json TEXT,
created_at TEXT,
updated_at TEXT
);
CREATE TABLE experiment_results (
experiment_id TEXT PRIMARY KEY,
task_id TEXT,
tree_id TEXT,
seed_id TEXT,
hypothesis TEXT,
result_type TEXT,
summary TEXT,
metrics_json TEXT,
result_json TEXT,
created_at TEXT,
updated_at TEXT
);
CREATE TABLE weather_logs (
cycle_id TEXT PRIMARY KEY,
climate_mode TEXT,
temperature REAL,
allocation_json TEXT,
weather_events_json TEXT,
created_at TEXT
);Implement export commands:
rainforest export forest
rainforest export seeds
rainforest export weather-log
rainforest export report
Exports should write Markdown reports to outputs/.
Implement a CLI entrypoint named rainforest.
rainforest init
rainforest ground
rainforest show forest
rainforest show seeds
rainforest cycle plan
rainforest cycle run-stub
rainforest result add
rainforest export report
rainforest init --project my-alpha-forest
cd my-alpha-forest
rainforest ground
rainforest show forest
rainforest cycle plan
rainforest cycle run-stub
rainforest export reportShould run Forest Grounding questions and generate configs.
Should:
- Load environment config.
- Load tree profiles.
- Load seeds.
- Run weather router.
- Generate research tasks.
- Write a cycle plan.
For MVP, this can generate mock results or ask the user to manually input results.
Do not pretend to run real research unless an executor exists.
Create prompt templates as Markdown files.
You are the Forest Grounding Agent for Rainforest Lab.
Your task is to convert a user's natural-language research intent into an initial research forest configuration.
Do not ask the user to set abstract parameters such as temperature, moisture, drought, soil penalty, or rainfall.
Ask user-friendly questions about goals, market, data, constraints, fears, preferred directions, avoided directions, and approval style.
Then output:
1. Environment profile
2. Initial climate
3. Initial tree profiles
4. Initial seeds
5. Bias guard rules
6. Human-readable summaryYou are the Seed Generator for Rainforest Lab.
Generate research seeds from:
- Golden leaves
- Cross-tree combinations
- Regime changes
- Data sources
- Counterfactual reasoning
- External knowledge
- Controlled mutation
Each seed must include:
- idea
- source_type
- related_trees
- logic
- data requirement
- validation plan
- novelty estimate
- risk estimateYou are the Result Classifier for Rainforest Lab.
Classify an experiment result as:
- Fruit
- Golden Leaf
- Normal Leaf
- Dead Leaf
- Sick Leaf
Explain:
- Why this label fits
- Whether this result should generate new seeds
- Whether it has a revival condition
- Whether it should be blocked from reuse
- Which tree memory should be updatedCreate configs/default.yaml:
project:
name: "rainforest-lab-demo"
climate:
mode: "exploration"
temperature: 1.2
min_rainfall: 0.15
seed_budget: 0.20
max_tree_share: 0.30
max_consecutive_depth: 2
novelty_weight: 0.35
balance_lambda: 0.25
overfit_penalty: 0.50
shared_expert_strictness: 0.50
routing:
germination_threshold: 0.60
promotion_threshold: 0.75
seed_slots: 5
golden_leaf_budget: 0.05
mutation_budget: 0.05
bias_guard:
max_user_boost_per_tree: 0.20
min_budget_for_unselected_trees: 0.08
require_counterfactual_for_favored_tree: true
storage:
backend: "sqlite"
path: "rainforest.db"Build in this exact order.
- Create package structure.
- Add
pyproject.toml. - Add basic CLI.
- Add YAML loading utilities.
- Add tests setup.
- Implement enums.
- Implement Pydantic models.
- Implement ID utilities.
- Add tests for serialization and validation.
- Implement guided interview.
- Implement mapping from answers to config.
- Generate environment, tree profiles, and genesis seeds.
- Add tests with mocked answers.
- Implement moisture scoring.
- Implement drought scoring.
- Implement allocation constraints.
- Generate weather log.
- Add tests for min rainfall, max tree share, and seed budget.
- Implement seed scoring.
- Implement active / dormant / rejected routing.
- Implement nursery validation stub.
- Implement basic promotion.
- Convert allocations into tasks.
- Generate task plan JSON and Markdown.
- Add task type support.
- Implement SQLite tables.
- Add insert / fetch / list methods.
- Add Markdown exports.
- Implement rule-based classifier first.
- Later allow LLM-assisted classification.
- Update archive and tree memory.
Create a demo:
examples/quant_mock_cycle/
It should show:
init → ground → plan cycle → add mock result → classify → update forest → export report
Must test:
- Config loading
- Pydantic model validation
- Forest grounding mapping
- Moisture score calculation
- Weather allocation constraints
- Seed score calculation
- Nursery routing
- Result classification
- Archive CRUD
Create these tests:
- No tree exceeds
max_tree_share. - Cold trees receive at least
min_rainfallwhen active. - Seed budget is preserved.
- High drought tree receives less allocation.
- High moisture, low drought tree receives rain.
- High moisture, high drought tree receives heatwave/drought, not heavy rain.
- Temperature changes allocation entropy.
Create tests for:
- Failed result with local validity becomes Golden Leaf.
- Leakage result becomes Sick Leaf.
- Weak result with no insight becomes Dead Leaf.
- Golden Leaf can generate seed.
Prefer clear rule-based implementation over complex ML.
Do not over-engineer.
Every routing decision should produce a reason.
Example:
{
"tree_id": "fund_flow",
"weather": "rain",
"allocation": 0.18,
"reason": "High regime fit and data readiness, capped by max_tree_share."
}18.3 No Hidden Decisions
All key parameters must come from config files or explicit defaults.
Do not hard-code quant-specific logic into core classes.
Put quant-specific examples and experts into configs or optional modules.
If a real evaluator is not available, use executor_stub.py and clearly label results as mock or manual.
Never claim real backtest or real trading performance unless actually computed by a valid evaluator.
After MVP:
- LLM provider abstraction
- Real quant backtest adapter
- Scientific research adapter
- Software benchmark adapter
- Web UI
- Vector memory
- Multi-agent tree experts
- Quality-Diversity archive
- Regime detector
- Automatic ablation engine
- GitHub issue/task integration
- Paper/report generator
The MVP is successful if it can:
- Initialize a research forest from user-friendly answers.
- Generate environment config, tree profiles, and seeds.
- Run a weather allocation cycle.
- Produce research tasks.
- Accept experiment results.
- Classify results into Fruit / Golden Leaf / Leaf types.
- Update forest memory.
- Export a readable research report.
- Demonstrate that weather routing prevents one tree from consuming all attention.
- Demonstrate that seeds can create new research directions.
Use this as the first instruction to the coding agent:
Build the MVP of Rainforest Lab, a seeded, weather-guided research framework for AI agents.
Start by creating a Python package with the directory structure specified in docs/build_spec.md.
Implement the system in this order:
1. Project skeleton and CLI
2. Core Pydantic models and enums
3. YAML config loading
4. Forest Grounding guided interview and mapper
5. Weather Router with moisture, drought, and allocation constraints
6. Seed Router and Nursery stubs
7. Research Task Planner
8. SQLite archive store
9. Result Classifier
10. End-to-end mock demo
Keep the implementation local-first, inspectable, and rule-based.
Do not build trading integrations, web UI, or paid API dependencies.
Every routing decision must include a human-readable reason.
Add pytest tests for all core scoring and routing logic.
Use these names consistently:
Project name: Rainforest Lab
Core architecture: Research Forest
Initialization phase: Forest Grounding
Scheduling layer: Weather System
New direction layer: Seed System
Validation layer: Nursery
Useful failure memory: Golden Leaf Pool
Storage layer: Archive
Quality control layer: Shared Experts
Rainforest Lab should be built as a framework for managing research exploration, not as a black-box alpha generator.
The framework's value comes from structured exploration, transparent routing, useful failure memory, and controlled generation of new research directions.
The first version should be small, testable, and easy for another AI agent or human developer to extend.