본문으로 건너뛰기
Skillpedia
프롬프트 및 LLM260k · #549

darwinian-evolver

하는 일

이 스킬은 자동 시행착오와 선택 과정으로 여러 라운드에 걸쳐 프롬프트나 코드 조각을 더 좋게 만듭니다. 결과를 명확하게 점수 매길 방법이 있는 사람을 위한 것입니다.

사용하는 경우

  • ✓출력이 얼마나 좋은지 측정할 수 있는 프롬프트나 지침을 최적화하고 싶을 때.
  • ✓테스트 사례 집합에 맞춰 정규식이나 SQL 쿼리를 개선하고 싶을 때.
  • ✓시도할 변형이 몇 개뿐이라 손으로 쓰는 것이 더 간단할 때.

스킬 링크

https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/research/darwinian-evolver/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/research/darwinian-evolver/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 테스트 질문의 최소 90퍼센트에서 정답을 얻도록 이 프롬프트를 개선해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

스킬은 AI가 시작 버전, 점수 테스트, 수정 방법이 있는 문제 정의를 작성하도록 돕습니다. 그다음 많은 변형을 시도해 최선을 남기는 상위 진화 도구를 실행합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Darwinian Evolver

Run Imbue's darwinian_evolver — an LLM-driven evolutionary search loop — to optimize a prompt, regex, SQL query, or small code snippet against a fitness function.

Status: thin wrapper around the upstream tool. The skill installs it, walks the agent through writing a Problem definition (organism + evaluator + mutator), and drives the loop via the upstream CLI or a small custom Python driver.

License: the upstream tool is AGPL-3.0. The skill ONLY ever invokes it via the upstream CLI or a subprocess/uv run call (mere aggregation). Do NOT import upstream classes into Hermes itself.

When to Use

  • User says "optimize this prompt", "evolve a regex for X", "auto-improve this code/SQL", "search for a better instruction".
  • You have a scorer (exact match, regex pass-rate, unit test, LLM-judge, runtime metric) AND a starting candidate (organism). If you don't have a scorer, stop and define one first — that's the hard part.
  • Cost is OK: a typical run is 50–500 LLM calls. On gpt-4o-mini that's pennies; on Claude Sonnet it can be a few dollars.

Do not use this when:

  • The optimization target is differentiable (use gradient descent / DSPy).
  • You only need to try 2–3 variants — just write them by hand.
  • The fitness signal is purely subjective with no measurable criterion.

Prerequisites

  • Python ≥3.11
  • git, uv (or pip)
  • One of: OPENROUTER_API_KEY, ANTHROPIC_API_KEY, or OPENAI_API_KEY

The skill ships a small parrot_openrouter.py driver that uses OPENROUTER_API_KEY via the OpenAI SDK, so any model on OpenRouter works. The upstream CLI itself hardcodes Anthropic and needs ANTHROPIC_API_KEY.

Install (One-Time)

Run via the terminal tool:

mkdir -p ~/.hermes/cache/darwinian-evolver && cd ~/.hermes/cache/darwinian-evolver
[ -d darwinian_evolver ] || git clone --depth 1 https://github.com/imbue-ai/darwinian_evolver.git
cd darwinian_evolver && uv sync

Verify:

cd ~/.hermes/cache/darwinian-evolver/darwinian_evolver \
  && uv run darwinian_evolver --help | head -5

Quick Start — The Built-In Parrot Example

Tiny smoke test (requires ANTHROPIC_API_KEY):

cd ~/.hermes/cache/darwinian-evolver/darwinian_evolver
uv run darwinian_evolver parrot \
  --num_iterations 2 \
  --num_parents_per_iteration 2 \
  --mutator_concurrency 2 --evaluator_concurrency 2 \
  --output_dir ~/.hermes/cache/scratch/parrot_demo

Outputs:

  • ~/.hermes/cache/scratch/parrot_demo/snapshots/iteration_N.pkl — pickled population per iteration
  • ~/.hermes/cache/scratch/parrot_demo/<jsonl> — per-iteration JSON log (path printed at end)

Open ~/.hermes/cache/darwinian-evolver/darwinian_evolver/darwinian_evolver/lineage_visualizer.html in a browser and load the JSON log to see the evolutionary tree.

Quick Start — OpenRouter Driver (No Anthropic Key)

The skill ships scripts/parrot_openrouter.py — same parrot problem, but the LLM call goes through OpenRouter so any provider works.

# From wherever the skill is installed:
SKILL_DIR=~/.hermes/skills/research/darwinian-evolver
DE_DIR=~/.hermes/cache/darwinian-evolver/darwinian_evolver

cd "$DE_DIR" && \
  EVOLVER_MODEL='openai/gpt-4o-mini' \
  uv run --with openai python "$SKILL_DIR/scripts/parrot_openrouter.py" \
    --num_iterations 3 --num_parents_per_iteration 2 \
    --output_dir ~/.hermes/cache/scratch/parrot_or

Inspect the result with scripts/show_snapshot.py:

uv run --with openai python "$SKILL_DIR/scripts/show_snapshot.py" \
  ~/.hermes/cache/scratch/parrot_or/snapshots/iteration_3.pkl

Expected output: 7 evolved prompt templates ranked by score, with the best landing around 0.6–0.8 (the seed Say {{ phrase }} scored 0.000).

Defining a Custom Problem

The skill ships templates/custom_problem_template.py — copy, edit, run. Three things you must define:

  1. Organism — a Pydantic BaseModel subclass holding the artifact being evolved (prompt_template: str, regex_pattern: str, sql_query: str, code_block: str, etc.). Add a run(*args) method that exercises it.

  2. Evaluator — .evaluate(organism) -> EvaluationResult(score=..., trainable_failure_cases=[...], holdout_failure_cases=[...], is_viable=True).

    • score is in [0, 1]. Higher is better.
    • trainable_failure_cases — what the mutator sees. Include enough context (input, expected, actual) for the LLM t
자주 묻는 질문

실행 한 번에 AI 호출이 얼마나 드나요?

스킬은 일반적인 실행이 50에서 500회의 모델 호출이며, 모델에 따라 몇 센트에서 몇 달러가 들 수 있다고 말합니다.

점수 매기는 방법이 필요한가요?

네. 스킬은 점수 매기는 방법이 없으면 먼저 정의해야 하며, 그것이 가장 어려운 부분이라고 말합니다.

도구의 라이선스는 무엇인가요?

스킬은 상위 도구가 AGPL-3.0이며 명령줄이나 별도 프로세스를 통해서만 실행한다고 말합니다.

상세 정보

작성자의 원본 설명

Evolve prompts/regex/SQL/code with Imbue's evolution loop.

repo: NousResearch/hermes-agent

인기도

GitHub 스타
260k
순위
#549
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬