@artale/pi-evolve
Evolutionary self-improvement for Pi. AlphaEvolve-inspired mutation, evaluation, and selection of prompts, skills, and extensions. Open-ended agent evolution.
Package details
Install @artale/pi-evolve from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@artale/pi-evolve- Package
@artale/pi-evolve- Version
1.0.0- Published
- Mar 14, 2026
- Downloads
- 38/mo · 6/wk
- Author
- artale
- License
- MIT
- Types
- extension
- Size
- 21.5 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"src/extension.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-evolve
Evolutionary self-improvement for Pi. Inspired by AlphaEvolve (DeepMind), Sakana AI's ShinkaEvolve, and the Darwin Gödel Machine.
Mutate → Evaluate → Select → Archive → Repeat.
Install
pi install npm:@artale/pi-evolve
What it does
Applies evolutionary algorithms to anything the agent works with:
- Skills (SKILL.md files) — compress, restructure, improve
- Prompts — evolve system prompts for better output
- Extensions — optimize code for size + quality
- Any text file — evolutionary improvement of anything
Commands
/evolve <file> — quick evolution (3 variants)
/evolve status — show evolution state
/evolve archive — list all variants with scores
/evolve restore <id> — restore a variant
/evolve compare <a> <b> — diff two variants
/mutate <file> [goal] — single mutation pass (3 strategies)
/darwin <file> [gens] [goal] — full evolutionary loop
Mutation strategies
| Strategy | What it does |
|---|---|
| compress | Reduce size 30-50% while preserving all functionality |
| quality | Improve effectiveness at similar length |
| hybrid | Both shorter AND better (Pareto optimization) |
| radical | Completely reimagine structure (divergent exploration) |
Darwin mode
Full evolutionary loop with multiple generations:
/darwin SKILL.md 10 optimize for token efficiency
This runs 10 generations, each producing 3 variants (compress, quality, radical), evaluating fitness, selecting the best, and using it as the parent for the next generation.
Results (from our GEPA predecessor)
Tested on real Pi skills:
canvas-design: −69% tokens, same qualitypptx: −60% tokens, same qualityxlsx: −63% tokens, same quality
Tools
evolve_archive— save a variant with fitness scoreevolve_status— show archive statsevolve_list— list all variantsevolve_restore— restore a variant to its file
Architecture
/darwin SKILL.md 5
│
├─ Gen 0: Archive original (baseline fitness 50)
│
├─ Gen 1: Mutate × 3 strategies → Evaluate → Select best
│ compress: 65/100 (−40% tokens)
│ quality: 58/100 (better structure)
│ radical: 42/100 (too divergent)
│ → Winner: compress (65)
│
├─ Gen 2: Mutate winner × 3 → Evaluate → Select
│ → Winner: hybrid (72)
│
└─ Gen 5: Converged at 78/100, −55% tokens
All variants archived with fitness scores, token counts, and lineage tracking.
Inspired by
- AlphaEvolve — DeepMind's Gemini-powered evolutionary coding agent
- ShinkaEvolve — Sakana AI's sample-efficient program evolution
- Darwin Gödel Machine — Self-improving coding agent via evolution
- OpenEvolve — Open-source AlphaEvolve reimplementation
Zero dependencies
Node.js built-ins only. The LLM itself is the mutation operator.
License
MIT