Skip to content

Implement Experiment Learner #9

@alirezamshi

Description

@alirezamshi

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:

  1. Analyzes completed SolutionResult objects
  2. Extracts patterns from successes and failures
  3. 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

  1. Parse SolutionResult object
  2. Analyze experiment logs for patterns
  3. Identify successful vs failed approaches
  4. Extract code patterns from final solution
  5. Create heuristic pages for learnings
  6. Link to related concepts in wiki
  7. 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

  1. Full implementation of ExperimentLearner.learn() method
  2. Pattern extraction from experiment logs
  3. Heuristic page generation
  4. Linking to existing wiki knowledge

Test

  1. Run expert.build(goal="...") to generate a SolutionResult
  2. Call expert.learn(Source.Solution(solution))
  3. Verify heuristic pages created in wiki
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Highest Priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions