darwinian-evolver

Evolve prompts, regex, SQL, and code snippets using an LLM-driven evolutionary search loop.

Updated Sep 10, 2026
One-click install
npx skills add https://github.com/loteiron/ZeusAgent --skill darwinian-evolver-loteiron
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: darwinian-evolver
Source: https://github.com/loteiron/ZeusAgent/tree/main/optional-skills/research/darwinian-evolver
Command: npx skills add https://github.com/loteiron/ZeusAgent --skill darwinian-evolver-loteiron

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires openai, jinja2, darwinian_evolver, and includes scripts (resource) components.

What problem does it solve? Manually iterating on prompts, regex patterns, SQL queries, or small code snippets is slow and unsystematic. This Skill automates that search by running Imbue's darwinian_evolver loop, which mutates candidates with an LLM, scores them against a fitness function, and keeps the best performers across iterations. ## Core Features & Use Cases - LLM-Driven Evolution: Define an Organism (the artifact), an Evaluator (scorer with trainable and holdout failure cases), and a Mutator (LLM proposer), then let the loop optimize the artifact over many iterations. - Provider Flexibility: Ships an OpenRouter-based driver so any model on OpenRouter works, plus support for the upstream Anthropic-based CLI. - Result Inspection: Includes a snapshot viewer that ranks evolved organisms by score and a lineage visualizer for exploring the evolutionary tree. - Use Case: You have a prompt template that only scores 0.0 on verbatim phrase repetition. Run the parrot example for a few iterations and get back ranked templates scoring 0.6-0.8, then adapt the custom problem template to evolve your own regex or SQL. ## Quick Start Ask the agent to install the darwinian-evolver skill and run the parrot OpenRouter example with your OPENROUTER_API_KEY for three iterations.

Frequently Asked Questions about darwinian-evolver

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize a prompt with evolutionary search?▼

Define an Organism holding your prompt template, an Evaluator that scores outputs against expected results, and a Mutator that asks an LLM to propose improvements from failure cases. Then run the EvolveProblemLoop for several iterations and inspect the ranked snapshots.

How to evolve a regex or SQL query automatically with an LLM?▼

Copy the shipped custom_problem_template.py and replace the artifact field with your regex_pattern or sql_query. Implement the run method to execute the pattern against test inputs, then score matches in the Evaluator and let the mutator propose fixes.

Can I use darwinian-evolver with OpenRouter instead of Anthropic?▼

Yes, the skill ships scripts/parrot_openrouter.py which routes LLM calls through OpenRouter using the OpenAI SDK, so any OpenRouter model works. The upstream CLI itself is hardcoded to Anthropic and requires ANTHROPIC_API_KEY.

Why does my evolution run fail with HTTP 400 errors?▼

Provider content filters, especially Azure-backed OpenRouter models, reject phrases like ignore previous instructions. Wrap the LLM call in try/except and return an error marker string so the evolver scores that organism zero and continues.

When should I not use evolutionary prompt optimization?▼

Avoid it when the optimization target is differentiable, where gradient descent or DSPy fits better, or when you only need two or three variants that you can write by hand. It also fails when the fitness signal is purely subjective with no measurable criterion.

How many LLM calls does a typical evolution run cost?▼

A typical run uses 50 to 500 LLM calls depending on iterations, parents per iteration, and concurrency settings. On gpt-4o-mini that costs pennies, while Claude Sonnet runs can cost a few dollars.