Nous Research open-sources GEPA engine for self-evolving AI agent prompts

Hermes Agent Self-Evolution lets agents rewrite their own prompts via reflective evolutionary search — 35× less data than RL, 20% better results, no GPU needed.

cpaua4 min388

Nous Research has released NousResearch/hermes-agent-self-evolutiongithub.com/NousResearch/hermes-agent-self-evolution, an open-source framework that lets AI agents evolve their own prompts, skill files, and tool descriptions through a reflective evolutionary loop. The core engine, GEPA (Genetic-Pareto Prompt Evolution), was accepted as an Oral presentation at ICLR 2026. According to the repository, GEPA achieves 20% higher performance while using 35 times less data than reinforcement-learning approaches. The entire process runs via API calls — no GPU training required — and costs roughly $2–10 per optimization run.

How the evolutionary loop works

GEPA reads execution traces to understand why a skill or prompt failed, not just that it failed. It then proposes targeted mutations, evaluates candidates against a generated or real-world dataset, and passes the best variant through a series of constraint gates before opening a pull request against the upstream hermes-agent repository. The pipeline is illustrated in the repository as a flow from reading the current skill through dataset generation, GEPA optimization, evaluation, constraint checks, and finally a PR.

code
Read current skill/prompt/tool ──► Generate eval dataset
 │
 ▼
 GEPA Optimizer ◄── Execution traces
 │ ▲
 ▼ │
 Candidate variants ──► Evaluate
 │
 Constraint gates (tests, size limits, benchmarks)
 │
 ▼
 Best variant ──► PR against hermes-agent

Because the optimizer works on text — prompts, tool descriptions, system-prompt sections — it can be applied to any agent that exposes its skills as markdown or code files. The repository currently targets Hermes Agent, but the pattern is portable.

Quick start: evolving a skill

Clone the repository, install the editable package with development dependencies, and point the HERMES_AGENT_REPO environment variable at a local copy of hermes-agent. Two evaluation sources are supported: synthetic data generated on the fly, or real session history pulled from Claude Code, Copilot, or Hermes itself.

shellscript
# Install
git clone https://github.com/NousResearch/hermes-agent-self-evolution.git
cd hermes-agent-self-evolution
pip install -e ".[dev]"

# Point at your hermes-agent repo
export HERMES_AGENT_REPO=~/.hermes/hermes-agent

# Evolve a skill (synthetic eval data)
python -m evolution.skills.evolve_skill \
 --skill github-code-review \
 --iterations 10 \
 --eval-source synthetic

# Or use real session history from Claude Code, Copilot, and Hermes
python -m evolution.skills.evolve_skill \
 --skill github-code-review \
 --iterations 10 \
 --eval-source sessiondb

The --iterations flag controls how many evolutionary generations run. Each iteration mutates the prompt, evaluates the candidates, and keeps the Pareto-optimal set.

Optimization roadmap: five phases

The project defines a phased plan. Phase 1 — skill files (SKILL.md) — is implemented and driven by DSPy + GEPA. Phases 2 and 3 target tool descriptions and system-prompt sections respectively, also using DSPy + GEPA. Phase 4 will evolve tool implementation code via the Darwinian Evolver, an external CLI licensed AGPL v3. Phase 5 envisions a continuous improvement loop that runs automatically. The full architecture, evaluation-data strategy, constraints, and benchmark integration are documented in PLAN.md.

Two engines, different licenses

The reflective prompt engine combines DSPy with GEPA, both MIT-licensed. The code-evolution engine wraps Darwinian Evolver, which is AGPL v3 and invoked only as an external CLI. This separation keeps the core repository MIT while allowing the more restrictive license to stay at the boundary.

Guardrails that every variant must pass

Before a mutated skill or prompt can be merged, it must clear five gates: the full pytest tests/ -q suite must pass at 100%; skill files are capped at 15 KB and tool descriptions at 500 characters; caching compatibility is enforced so no mid-conversation changes occur; semantic preservation checks prevent drift from the original purpose; and every change goes through human PR review — no direct commits. These constraints are designed to keep the evolutionary process safe for production agents.

The repository carries 5,706 stars and 703 forks as of the last update on 2026-06-17, with 131 open issues tracking feature work and bug reports. Development is active under the MIT license, copyright 2026 Nous Research.

Related reading

Sources

NousResearch/hermes-agent-self-evolutiongithub.com/NousResearch/hermes-agent-self-evolution
Share

Author

cpaua

VibeCode blog admin. Writing about vibe coding, AI and open source.

Related news

Comments

To leave a comment, log in
Loading...

Weekly digest

The best of vibe coding, AI agents and open source — once a week, no spam.