darwinian-evolver

Evolve prompts, regexes, SQL queries, or code snippets toward higher fitness scores.

1|Updated May 16, 2026
One-click install
npx skills add https://github.com/devMoez/titan --skill darwinian-evolver
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: darwinian-evolver
Source: https://github.com/devMoez/titan/tree/main/optional-skills/research/darwinian-evolver
Command: npx skills add https://github.com/devMoez/titan --skill darwinian-evolver

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python>=3.11, openai, jinja2, pydantic, uv, git, and includes scripts (resource) components.

What problem does it solve?

It automates iterative optimization of an LLM prompt, regex, SQL query, or small code snippet by using an evolutionary search loop driven by a fitness score.

Core Features & Use Cases

  • Fitness-driven evolution: Improves a starting “organism” using an evaluator that scores outputs from measurable criteria.
  • Failure-case guided mutation: Uses trainable failure cases to prompt the mutator to propose better artifacts.
  • Overfitting detection: Supports holdout failure cases to catch solutions that only work on training inputs.
  • Common use cases: Optimize prompt instructions for reliability, evolve regex patterns for extraction, tune SQL queries for correctness, or refine small code snippets validated by tests or benchmarks.
  • Wrapper around upstream tool: Drives Imbue’s darwinian-evolver via CLI/subprocess so Titan does not import AGPL upstream code into its core.

Quick Start

Ask the skill to optimize a prompt by stating your target behavior, providing a scoring rule (or test cases), and giving a starting template like “Say {{ phrase }}”.

Frequently Asked Questions about darwinian-evolver

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

FAQPage Schema
How do I automate prompt engineering to improve LLM output reliability?

Evolutionary optimization automates iterative prompt engineering by mutating a starting template toward higher fitness under a user-defined evaluator. It uses trainable failure cases to guide mutations and holdout cases to detect overfitting, improving exact-output constraint reliability.

What is the best way to evolve regex patterns for data extraction?

Evolving regex patterns involves defining a runnable artifact and an evaluator that returns pass/fail scores in the range of zero to one. The evolutionary loop applies LLM-driven mutation guided by trainable failure cases to iteratively refine regex extraction correctness.

Can I optimize SQL queries for correctness using evolutionary search?

SQL query tuning is supported by treating the query as an organism and defining an evaluator that scores correctness from zero to one. The evolutionary loop mutates the SQL query based on trainable failure cases to improve fitness while detecting overfitting via holdout cases.

How does overfitting detection work during evolutionary optimization?

Overfitting detection uses holdout failure cases alongside trainable test cases to catch solutions that only work on training inputs. The evolutionary loop validates optimized artifacts against these holdout cases, ensuring the evolved prompt, regex, or code generalizes beyond training data.

Do I need Python to run the darwinian-evolver loop?

Python 3.11 or higher is required, along with OpenAI, Jinja2, Pydantic, UV, and Git dependencies. The evolutionary loop runs via CLI or subprocess, requiring you to define an Organism with a runnable artifact and Evaluator logic that safely handles provider failures.