Description
The ExperimentLearner extracts knowledge from completed solutions (experiment logs) and adds it to the wiki. This is the "backward pass" - learning from experience to improve future builds.
Location: src/knowledge/learners/experiment_learner.py
Goal
Implement the full experiment learning pipeline that:
- Analyzes completed SolutionResult objects
- Extracts patterns from successes and failures
- Creates wiki pages capturing learnings
What to Extract
- Goal and constraints → Problem definition pages
- Successful approaches → Workflow/heuristic pages
- Failed approaches → Heuristic pages (what to avoid)
- Final solution patterns → Implementation pages
- Error patterns → Heuristic pages
Input Format
SolutionResult object with:
- goal: str
- experiment_logs: List[str]
- code_path: str
- metadata: dict
Implementation Steps
- Parse SolutionResult object
- Analyze experiment logs for patterns
- Identify successful vs failed approaches
- Extract code patterns from final solution
- Create heuristic pages for learnings
- Link to related concepts in wiki
- Index into knowledge graph
Key Value
This learner enables the "reinforcement" step where the Expert learns from its own experiments. Over time, it builds tribal knowledge about:
- What approaches work for what problems
- Common pitfalls to avoid
- Effective patterns and techniques
Deliverable
- Full implementation of
ExperimentLearner.learn() method
- Pattern extraction from experiment logs
- Heuristic page generation
- Linking to existing wiki knowledge
Test
- Run
expert.build(goal="...") to generate a SolutionResult
- Call
expert.learn(Source.Solution(solution))
- Verify heuristic pages created in wiki
- Verify learnings indexed and retrievable
References
src/knowledge/learners/experiment_learner.py - Current implementation
src/knowledge/learners/base.py - Base class and KnowledgeChunk
src/execution/solution.py - SolutionResult class
src/knowledge/wiki_structure/extension_of_product.md - Wiki page structure (Heuristic node type)
Dependencies
Description
The
ExperimentLearnerextracts knowledge from completed solutions (experiment logs) and adds it to the wiki. This is the "backward pass" - learning from experience to improve future builds.Location:
src/knowledge/learners/experiment_learner.pyGoal
Implement the full experiment learning pipeline that:
What to Extract
Input Format
Implementation Steps
Key Value
This learner enables the "reinforcement" step where the Expert learns from its own experiments. Over time, it builds tribal knowledge about:
Deliverable
ExperimentLearner.learn()methodTest
expert.build(goal="...")to generate a SolutionResultexpert.learn(Source.Solution(solution))References
src/knowledge/learners/experiment_learner.py- Current implementationsrc/knowledge/learners/base.py- Base class and KnowledgeChunksrc/execution/solution.py- SolutionResult classsrc/knowledge/wiki_structure/extension_of_product.md- Wiki page structure (Heuristic node type)Dependencies