Skip to content

NousResearch/hermes-agent-self-evolution

⭐ 2,983  ·  Python  ·  GitHub Repo

⚒ Evolutionary self-improvement for Hermes Agent — optimize skills, prompts, and code using DSPy + GEPA

1-Sentence Summary

Automatically evolve and optimize AI agent skills, prompts, and code without manual tuning or GPUs.

🔥 Key Capabilities & USP

  • Evolutionary Self-Improvement: Automatically mutates and selects better versions of agent skills, prompts, and code through reflective evolutionary search. This eliminates the pain of manual prompt engineering and endless trial-and-error tuning.
  • Execution Trace Analysis: GEPA reads why things fail, not just that they failed, enabling targeted, intelligent improvements. This solves the "black box" problem of agent debugging.
  • Multi-Phase Optimization: Progressively optimizes skill files (Phase 1), tool descriptions (Phase 2), system prompts (Phase 3), and tool implementation code (Phase 4). This provides a structured, incremental path to full agent optimization.
  • Built-in Guardrails: Every evolved variant must pass test suites, size limits, caching compatibility checks, semantic preservation tests, and human PR review. This solves the "broken agent" risk that plagues automated optimization.
  • No GPU Required: All optimization runs via API calls, costing only $2-10 per run. This makes advanced agent optimization accessible to any developer with an API key, democratizing what previously required expensive hardware.

USP: The only open-source system that combines evolutionary search with execution trace analysis to automatically improve agent behavior end-to-end, backed by an ICLR 2026 Oral paper.

Technical Architecture

ComponentTechnologyRole
Optimization EngineDSPy + GEPAEvolutionary search with execution trace feedback
Code EvolutionDarwinian EvolverMutates and selects improved tool code
Evaluation SourcesSession history (Claude Code, Copilot, Hermes) + synthetic dataGenerates realistic eval datasets
Constraint GatesTest suites, size limits, benchmarks, semantic checksEnsures safety and quality of evolved variants
Output PipelinePR against hermes-agentIntegrates improvements via human review

Pipeline Flow: Read current skill/prompt/tool → Generate eval dataset → GEPA optimizer (with execution trace feedback) → Candidate variants → Constraint gates (tests, size limits, benchmarks) → Best variant → PR against hermes-agent

Quick Start Guide

bash
# 1. Clone and install
git clone https://github.com/NousResearch/hermes-agent-self-evolution.git
cd hermes-agent-self-evolution
pip install -e ".[dev]"

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

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

# 4. 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

Pros, Cons & Use Cases

Pros

  • No GPU required — runs entirely via API calls, saving thousands in hardware costs
  • Extremely low cost — $2-10 per optimization run
  • Automated evolution — eliminates manual prompt engineering and trial-and-error
  • Safety-first design — built-in guardrails prevent broken or degraded agents
  • Research-backed — ICLR 2026 Oral paper validates the approach
  • Multi-phase optimization — progressively improves all aspects of agent behavior

Cons

  • Only Phase 1 (skill files) is currently implemented — full multi-phase optimization is not yet available
  • Requires access to Hermes Agent repository — not a standalone tool
  • Relies on API calls — introduces latency and potential cost variability
  • All changes require human PR review — slower iteration compared to fully automated deployment

Who should NOT use this?

  • Developers without access to Hermes Agent — this tool is tightly coupled to the Hermes Agent ecosystem
  • Teams needing real-time agent optimization — the PR review cycle introduces significant latency
  • Projects with zero API budget — even at $2-10/run, costs accumulate with frequent iterations
  • Users expecting a fully automated, hands-off solution — human review is mandatory for all changes

Ideal Use Cases

  • Agent developers who want to automatically improve their Hermes Agent's skills and prompts without manual tuning
  • Research teams studying evolutionary optimization of AI agents and prompt engineering
  • Production teams maintaining Hermes Agent deployments who want continuous, low-cost optimization with safety guarantees
  • Organizations with limited GPU resources who still need to optimize complex agent behaviors

Community & Activity

With 2,983 stars and active development (last updated May 2026), this project has strong momentum in the AI agent community. The ICLR 2026 Oral paper adds significant academic credibility. While the project is still in early implementation phases (Phase 1 only), the architecture and research foundation are solid. The community is likely to grow rapidly as more phases are released and the tool matures.

Project data from GitHub API, updated in real-time