darwinian-evolver

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

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/vivekgoquest/hermes-agent-stable --skill darwinian-evolver-vivekgoquest
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: darwinian-evolver
Source: https://github.com/vivekgoquest/hermes-agent-stable/tree/main/optional-skills/research/darwinian-evolver
Command: npx skills add https://github.com/vivekgoquest/hermes-agent-stable --skill darwinian-evolver-vivekgoquest

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 code snippets to improve their performance is slow and unsystematic. This Skill automates that search by running an evolutionary loop that mutates candidates, scores them against a fitness function, and keeps the best performers. ## Core Features & Use Cases - LLM-Driven Evolution: Wraps Imbue's darwinian_evolver to iteratively mutate and evaluate an organism (prompt template, regex, SQL, or code) against a scored evaluator. - Custom Problem Definitions: Ships a template for defining your own Organism, Evaluator, and Mutator, with trainable and holdout failure cases to detect overfitting. - OpenRouter Driver: Includes a driver script that routes LLM calls through OpenRouter, so any provider model works instead of the upstream CLI's hardcoded Anthropic dependency. - Use Case: You have a prompt that only sometimes makes an LLM repeat a phrase verbatim. Define exact-match scoring, run 3 iterations, and get back a ranked population of improved prompt templates scoring 0.6-0.8 instead of 0.0. ## Quick Start Ask the agent to install the darwinian_evolver repo and run the parrot example with your OpenRouter key to evolve a better prompt template.

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 in [0, 1], and a Mutator that asks an LLM to fix failures. Then run the evolution loop for several iterations and inspect the ranked population in the output snapshots.

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

Copy the custom problem template, set the artifact field to your regex pattern or SQL query, implement a run method that tests it against labeled examples, and provide trainable and holdout failure cases. The mutator proposes improved versions based on observed failures.

Can I use darwinian_evolver with OpenRouter instead of Anthropic?▼

Yes, the upstream CLI is hardcoded to Anthropic, but the shipped parrot_openrouter.py driver routes LLM calls through OpenRouter using the OpenAI SDK. Set OPENROUTER_API_KEY and EVOLVER_MODEL to use any model on OpenRouter.

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 string so the evolver scores that organism 0 and continues instead of crashing.

When should I not use evolutionary prompt optimization?▼

Avoid it when the optimization target is differentiable (use gradient descent or DSPy), when you only need 2-3 variants you can write by hand, or when the fitness signal is purely subjective with no measurable criterion.

How many LLM calls does an evolution run cost?▼

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