Skip to content

Conversation

@dtdannen
Copy link

@dtdannen dtdannen commented Oct 8, 2025

No description provided.

dtdannen and others added 3 commits October 6, 2025 15:21
Implements a global learnings aggregator that collects insights across all
iterations and islands, injecting them into prompts to help the LLM avoid
repeated mistakes and learn from successful patterns.

Features:
- Tracks common failures: syntax errors, runtime errors, performance regressions
- Optionally tracks successful patterns with improvement metrics
- Configurable aggregation window (default: last 50 iterations)
- Flexible injection (system/user prompts) with verbosity levels
- Full checkpoint save/load support
- Zero overhead when disabled (default: off)

Implementation Details:
- New GlobalLearningsConfig in config.py with 16+ configuration options
- GlobalLearnings class extracts patterns using regex on stderr/artifacts
- Pattern detection: NameError, IndexError, TypeError, SyntaxError, etc.
- Performance regression tracking (>10% metric decreases)
- Prompt integration via PromptSampler.build_prompt()
- ProcessParallelController passes learnings to workers and updates from results
- Checkpoint persistence to global_learnings.json

Configuration Example:
  global_learnings:
    enabled: true
    track_failures: true
    track_successes: false
    window_size: 50
    max_learnings: 5
    inject_in_system_prompt: true
    verbosity: "concise"

Output Format:
  ## Evolution Insights (Global Learnings)

  ### Common Pitfalls:
  ❌ Undefined variable: temp (seen 5x)
  ❌ IndexError: list index out of range (seen 3x)
  ⚠️  score decreased by 15.2% (seen 4x)

Bug Fixes:
- Fix worker process API key propagation by calling update_model_params()
  with overwrite=True after LLMConfig reconstruction

Files Changed:
- openevolve/config.py: Add GlobalLearningsConfig
- openevolve/global_learnings.py: New core implementation
- openevolve/controller.py: Initialize and checkpoint management
- openevolve/prompt/sampler.py: Inject learnings into prompts
- openevolve/process_parallel.py: Worker integration and updates
- examples/config_with_global_learnings.yaml: Example config
- GLOBAL_LEARNINGS_IMPLEMENTATION.md: Complete documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@dtdannen
Copy link
Author

dtdannen commented Oct 8, 2025

@claude can you review this?

@dtdannen dtdannen closed this Oct 8, 2025
@dtdannen
Copy link
Author

dtdannen commented Oct 8, 2025

sorry, accidentally opened this on the main repo, meant to just do this on my forked version for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants