Hermes Agent Comprehensive Research Report
Contents · 19
- TL;DR
- Part I: What Hermes Does Differently
- 1. Conceptual Naming: The Vocabulary Hermes Uses to Describe Itself
- 2. Distinctive Design Choices
- 3. Distinctive Engineering Techniques
- 4. Product Stance: Why Hermes Is Built This Way
- 5. Hermes Naming Reference Table (Quick Lookup)
- Part II: Self-Evolution Deep Dive
- 6. What Self-Evolution Means in the Hermes Context
- 7. How the Official Docs Describe It: Quotes + Analysis
- 8. Where the Idea Came From: Five Underlying Motivations
- 9. Implementation Design: The Five Optimization Phases (Per PLAN.md)
- 10. How It Differs from Other “Self-Improvement” Approaches
- 11. PLAN vs. Code Reality: Seven Concrete Gaps + Code Walkthrough
- Conclusion: Seven Core Takeaways
- Appendix: Primary Source Index
- A. Hermes Main Repository (hermes-agent)
- B. Standalone Self-Evolution Repository (hermes-agent-self-evolution)
- C. External References
Based on mainline
hermes-agentv0.7.x (run_agent.pyat 9,439 lines) andhermes-agent-self-evolution(as of late April 2026, 7 commits). Official docs: hermes-agent.nousresearch.com/docs
TL;DR
This report is 1,400+ lines long; this section serves as a map of the entire piece. Each takeaway links to its corresponding section so you can jump straight to what matters before an interview. Wording stays as close to the primary sources as possible, and inferential judgments are explicitly marked.
One-Sentence Summary
Hermes is an agent framework built by Nous Research (an AI research lab), with its companion project described as “Evolutionary self-improvement for Hermes Agent” (README.md:3). This report has two parts: Part I catalogs what Hermes does differently compared with four other frameworks (Claude Code / Codex CLI / OpenClaw / Pi)—7 coined terms, 10 distinctive design choices, and 12 engineering techniques; Part II examines the GEPA optimization pipeline in the standalone hermes-agent-self-evolution repository and audits the gap between PLAN.md and the actual code.
Core Facts (Most Relevant for Interview Prep, Strictly Cited)
On the main Hermes repo:
run_agent.pyis 9,439 lines, with theAIAgentclass alone spanning lines 472–9223 (8,752 lines in a single class) [§4.4]- Supports 17 IM/platform adapters, including Discord, Slack, Telegram, Feishu, Signal, WhatsApp, and others [§2.1]
- Natively supports three LLM APIs side by side: OpenAI Chat Completions, OpenAI Codex Responses, and Anthropic Messages (
architecture.md:30-37: “3 API Modes: chat_compl. / codex_resp. / anthropic”) [§2.7] - Docs list 7 pluggable external memory providers: Honcho, OpenViking, Mem0, Hindsight, Holographic, RetainDB, and ByteRover (
overview.md:42) [§2.5]
On the standalone Self-Evolution repo:
- Uses DSPy + GEPA (Genetic-Pareto Prompt Evolution), described as “ICLR 2026 Oral, MIT licensed” (
README.md:26) [§6] - Stated cost: ”~$2-10 per optimization run”, “No GPU training required” (
README.md:7) [§7.3] - Stated positioning: “Lives in its own repo (
NousResearch/hermes-agent-self-evolution), operates ON hermes-agent — not part of it” (PLAN.md:5) [§7.1] - Three hard constraints (verbatim from
PLAN.md): no weight training (PLAN.md:17), “No evolved content is ever hot-swapped into an active conversation” (PLAN.md:694), and “All evolved changes go through a pull request” (PLAN.md:705-706) [§6] - Actual repository scale (as of late April 2026): 3,762 lines of Python, 7 git commits, 2 test files totaling 190 lines, and one 14.5 KB Phase 1 validation PDF [§11.1]
Quick Tour of What Makes Hermes Different (Jump to Sections to Drill Down)
7 Coined Terms (Part I §1):
| Hermes Term | One-Line Meaning | Section |
|---|---|---|
| Procedural Memory | Skills treated as a form of memory, dual to factual memory in MEMORY.md | §1.1 |
| MEMORY.md + USER.md | Factual memory split into environment notes (2,200 chars) + user profile (1,375 chars) | §1.2 |
| Durable Identity (SOUL.md) | Identity bound to the instance rather than a project, occupying slot #1 of the system prompt | §1.3 |
| Frozen Snapshot Pattern | Explicit name for the prompt-cache trade-off: mid-session memory edits stay out of the system prompt | §1.4 |
| Input vs Output Guardrails | Bidirectional safety boundary: filter external inputs coming in + gate agent actions going out | §1.5 |
| Subagents Know Nothing | Zero-knowledge subagent contract (the parent must pass context explicitly) | §1.6 |
| Shadow Git Checkpoint | Separate git repo under ~/.hermes/checkpoints/; the user project’s .git is never touched | §1.7 |
10 Distinctive Design Choices (Part I §2): Always-on multi-platform agent / Federated Skills Hub / Conditional Fallback Skills / Every Skill as a Slash Command / Pluggable Memory Providers / RL Trajectory Export (ShareGPT) / Three LLM API modes side by side / Context References @-expansion / Dedicated subagent terminals / Cross-channel identity binding via DM pairing codes
12 Engineering Techniques (Part I §3): Hard character caps on memory / Three parallel memory-write paths / 5-phase compression + 7-section summary / Orphan tool stub injection / Path-scoped tool concurrency / Five-hop fallback chain + synced context window / 3-tier progressive skill disclosure / Model-family-specific prompt blocks / coerce_tool_args type coercion / SubdirectoryHintTracker / Two-tier skill evolution pipeline (§3.11—bridges into Part II) / Streaming used as a connection health probe
Self-Evolution Section Guide (Part II)
| Section | Content | Who Should Read It |
|---|---|---|
| §6 | Exact definition: what self-evolution is and is not | Everyone—clears up terminology |
| §7 | 5 verbatim quotes from official docs + analysis (positioning, algorithm, cost, 4 tiers, zero-modification rule) | Anyone quoting official claims in interview questions |
| §8 | 5 underlying motivations (technical, structural, product, philosophical, practical) | Anyone asking “why build this?” |
| §9 | Five-phase implementation design (as laid out in PLAN.md) | Anyone asking about the roadmap |
| §10 | How it differs from RL, fine-tuning, runtime self-modification, and black-box optimizers | Anyone avoiding conceptual talking-past-each-other |
| §11 | PLAN vs. Code Reality: 7 Concrete Gaps + Code Walkthrough | Core credibility section for interviews |
§11 Summary: PLAN vs. Code (The Hardest Facts in This Report, Verified Against Source)
PLAN.md runs 782 lines and sketches a full five-phase automated optimization pipeline; the repo itself has 7 commits total, and only Phase 1 has a runnable implementation. Seven concrete gaps (each traceable to exact code locations):
- Fitness is actually a keyword-overlap heuristic, not the LLM-as-judge claimed in PLAN.
skill_fitness_metric()infitness.py:107-136computes(word_overlap × 0.7) + 0.3 baseline; theLLMJudgeclass exists but is never called [§11.3 Gap 1] - GEPA has a MIPROv2 fallback (
evolve_skill.py:156-177wraps GEPA intry/exceptand downgrades on error) [Gap 2] - The constraint gate has four checks, not five:
validate_all()only runssize/growth/non_empty/structure; semantic preservation and cache-compatibility checks do not exist in code; a pytest helper exists but does not run by default [Gap 3] benchmark_gate.pydoes not exist—the TBLite/YC-Bench gate described inPLAN.mdis absent in code [Gap 4]pr_builder.pydoes not exist—artifacts are written locally tooutput/<skill>/<timestamp>/, with no git branch creation and no PR opened [Gap 5]external_importers.pyis 785 lines (the largest file in the repo): mines sessions from Claude Code, Copilot, and Hermes—going beyond PLAN (which only called for mining Hermes’s own SessionDB) [Gap 6]- The CLI is not a
hermes evolvesubcommand, butpython -m evolution.skills.evolve_skill[Gap 7]
Phase implementation status: Phase 1 ✅ runnable / Phases 2–5 ⛔ all four directories contain only a 1-line empty __init__.py [§11.2]
This section is my direct audit of the code, not a conclusion taken from the source docs.
PLAN.mditself also states “we may stop at Phase 1 or 2 if the returns diminish — no obligation to do all five”—showing the Nous team anticipated a gap between roadmap and implementation.
Questions Worth Asking in an Interview (Distilled Strictly from the Material, Not Advice)
- Clarifying terminology: Does “self-evolution” refer strictly to the offline pipeline in [§6], or does it also encompass runtime nudges?
PLAN.mdexplicitly excludes weight training and hot-swapping - Status of the GEPA fallback: Is the
try/exceptfallback inevolve_skill.py:156-177temporary scaffolding or permanent design? How close is DSPy’s GEPA integration to stabilizing? - Evolution of the fitness function:
LLMJudgeis already written but unwired from the main loop—was that driven by API cost, scoring reliability, or simply unfinished wiring? - Infrastructure beyond PLAN:
external_importersmines Claude Code and Copilot sessions—does that point toward cross-agent skill optimization infrastructure? [§11.3 Gap 6] - Priorities for Phases 2–5: All four directories are currently empty, while
PLAN.mdlays out a 13–17 week schedule—do actual priorities still matchPLAN.md? - Relationship between roadmap and code: With 780+ lines of
PLAN.mdvs. 3,762 lines of Python, was writing a comprehensive design doc far ahead of implementation an intentional workflow? - Cross-framework skill ecosystem: What drove the decision to ship
openai/skillsandanthropics/skillsas default taps? Is Hermes actively pushingagentskills.io? [§2.2] - Methodology of naming things: Were terms like Procedural Memory, Durable Identity, and Frozen Snapshot coined up front during design, or distilled afterward when documenting the system? [§1]
- Trade-offs of a 9,400-line monolith: Has the team considered splitting
run_agent.py? Does an always-on personal agent naturally resist modularization? [§4.4]
Report Map
[Part I] What Hermes Does Differently
§1 Conceptual Naming ─── 7 coined terms (Procedural Memory, etc.)
§2 Design Choices ────── 10 product & architecture choices
§3 Engineering ───────── 12 implementation techniques (§3.11 bridges to Part II)
§4 Product Stance ────── Why it is built this way (lineage / user / ecosystem / monolith)
§5 Naming Table ──────── Quick reference lookup
[Part II] Self-Evolution Deep Dive
§6 Exact Definition ──── What it is / what it is not
§7 Official Claims ───── 5 PLAN.md quotes + analysis
§8 Motivations ───────── 5 drivers (inferred from PLAN.md)
§9 Five-Phase Design ─── Implementation design per PLAN.md
§10 Distinctions ─────── Not RL / not fine-tuning / not runtime / not black-box
§11 PLAN vs. Code ────── 7 concrete gaps + 10-step Phase 1 walkthrough ★ Hard facts
[Conclusion] 7 Core Observations
[Appendix] A. Main Repo Index / B. Self-Evolution Repo Index (Real Code vs. PLAN) / C. External Links
Part I: What Hermes Does Differently
1. Conceptual Naming: The Vocabulary Hermes Uses to Describe Itself
Hermes’s official docs and source code introduce a set of terms that other frameworks either lack or call by different names. These names are not marketing spin—each maps to concrete code paths and behavioral differences.
1.1 Skills = Procedural Memory
From the official Hermes docs (website/docs/user-guide/features/skills.md:235):
The agent can create, update, and delete its own skills via the
skill_managetool. This is the agent’s procedural memory — when it figures out a non-trivial workflow, it saves the approach as a skill for future reuse.
The tools reference (website/docs/reference/tools-reference.md:127) states the same thing directly:
skill_manage… Skills are your procedural memory — reusable approaches for recurring task types.
This cognitive framing is unique to Hermes. Compare how the other four frameworks position Skills:
| Framework | Term for Skills | Underlying Meaning |
|---|---|---|
| Claude Code | Skills | ”Instructional assets”—tell the agent how to perform a task |
| Codex CLI | Slash Commands / Prompts | ”Preset task entry points” |
| OpenClaw | Skills (via Gateway daemon) | “User- or developer-configured workflows” |
| Pi | No built-in Skills | Left entirely to Extensions |
| Hermes | Procedural Memory | A form of memory—dual to factual memory in MEMORY.md |
Hermes places Skills inside a taxonomy of memory: “how to do things” is one kind of memory (procedural), while “what is true” is another (declarative / semantic). MEMORY.md + USER.md hold the latter; SKILL.md holds the former.
That duality produces concrete behavioral consequences:
- When the agent works through a non-trivial workflow, it proactively saves it—just as it writes a memory entry
- Trigger conditions are spelled out in the docs (
skills.md:239-242): completing a task that took 5+ tool calls, recovering from errors into a working path, incorporating a user correction, or discovering a non-trivial workflow skill_manageandmemoryshare a parallel tool design—both let the agent manage its own memory
In the other four frameworks, Skills and Memory live on separate axes; only Hermes treats them as two halves of the same system.
1.2 Semantic Memory = Dual Files (MEMORY.md + USER.md)
Extending that memory taxonomy, Hermes splits factual memory into two files:
- MEMORY.md (2,200-character hard cap): project facts, environment setup, tool gotchas, learned conventions—“the agent’s personal notes”
- USER.md (1,375-character hard cap): user profile, communication preferences, pet peeves—“who the user is”
The official docs (memory.md:17-20) present these two files side by side with explicit character limits and roles. Compare how other frameworks structure memory:
| Framework | Memory Split |
|---|---|
| Claude Code | Multiple topic files under one directory (4 categories: user / project / feedback / reference) |
| Codex CLI | Single AGENTS.md file + two-stage pipeline |
| OpenClaw | Short-term daily journal → promoted into MEMORY.md |
| Pi | None built in |
| Hermes | MEMORY.md (environment/project facts) + USER.md (user profile) side by side |
Hermes gives the human user a dedicated file—coarser-grained than Claude Code’s four categories, but immediately legible. Combined with Skills as procedural memory, Hermes’s full memory taxonomy looks like this:
Hermes Memory Taxonomy
├── Semantic (Factual)
│ ├── MEMORY.md — Environment / tools / projects
│ └── USER.md — User profile
└── Procedural (How-to)
└── ~/.hermes/skills/*/SKILL.md — How to get tasks done
None of the other frameworks organize memory under a unified hierarchy like this.
1.3 SOUL.md = Durable Identity
From the official docs (personality.md:9):
SOUL.md is the primary identity — it’s the first thing in the system prompt and defines who the agent is.
Key design rules:
- Occupies slot #1 of the system prompt, replacing the hardcoded default identity
- Read exclusively from
HERMES_HOME(~/.hermes/), never from the current working directory—“personality belongs to the Hermes instance itself” (personality.md:47) - Auto-generates an initial
SOUL.mdon first launch and never overwrites an existing one - Layered separately from
/personalitypresets:SOUL.mdis durable identity, whereas a preset is a temporary session-level overlay
How other frameworks handle “who the agent is”:
| Framework | Identity Mechanism | Form |
|---|---|---|
| Claude Code | System Prompt (built-in) | Hardcoded constant |
| Codex CLI | System Prompt (built-in) | Hardcoded constant |
| OpenClaw | Persona (via Gateway config) | YAML config field |
| Pi | Default identity (overridable) | Passed via API parameter |
| Hermes | SOUL.md | User-editable standalone file bound to the instance, not the project |
Treating identity as a property of the agent instance rather than the project keeps Hermes consistent across monorepos and multi-project workflows. In other frameworks, identity is either baked into source code or overridden by project-level config files.
1.4 Frozen Snapshot Pattern
The official docs (memory.md:47) give this design an explicit name:
Frozen snapshot pattern: The system prompt injection is captured once at session start and never changes mid-session. This is intentional — it preserves the LLM’s prefix cache for performance. When the agent adds/removes memory entries during a session, the changes are persisted to disk immediately but won’t appear in the system prompt until the next session starts.
Every framework does some version of this in practice (Anthropic’s prompt caching practically forces it), but only Hermes names the pattern and spells out the trade-off in user docs.
It is equally direct about the cost: memory entries written mid-session will not appear in the system prompt until the next session starts (though tool responses immediately reflect the updated state on disk).
Naming a constraint and documenting its trade-offs is characteristic of Hermes—surfacing architectural choices to the user instead of burying them in implementation details.
1.5 Input Guardrails vs. Output Guardrails
In both its security docs and source comments, Hermes explicitly separates two safety boundaries:
- Output Guardrails: intercept what the agent is about to do (tool call approvals, dangerous command blocklists, sandbox boundaries)—every framework has these
- Input Guardrails: scan external content before it enters the agent’s context (context file scanning, memory-write scanning, skill upload scanning, log redaction)—only Hermes builds a full suite of these
Concrete source locations:
agent/prompt_builder.py:36-74— 10+ prompt-injection regexes scanning user instruction files (.hermes.md/AGENTS.md/CLAUDE.md)tools/memory_tool.py:60-76— ~15 threat regex categories checked before writing to memory (includingauthorized_keys/~/.ssh/.envdetection)tools/skills_guard.py:82-484— 120+ threat regexes checked before skill upload/installagent/redact.py— 50+ API key redaction patterns applied before log output
Here the naming is the architecture: splitting “blocking untrusted content coming in” from “gating actions going out” lets each side evolve independently.
1.6 Subagents Know Nothing
From the official docs (delegation.md:35, highlighted with a warning callout):
:::warning Critical: Subagents Know Nothing Subagents start with a completely fresh conversation. They have zero knowledge of the parent’s conversation history, prior tool calls, or anything discussed before delegation.
This is not an incidental limitation—it is a documented design contract. Its consequences:
- The parent agent must pack all required background into the
goal+contextarguments - When finished, the subagent returns only a summary, never its full transcript
- Parent and child contexts remain strictly isolated
Claude Code also has subagents (via the Task tool) but does not state a strict zero-knowledge contract—in practice, parent and child agents can still share state indirectly through memory files. By making zero-knowledge explicit, Hermes makes delegation behavior and failure modes predictable.
1.7 Shadow Git Checkpoint
From the official docs (checkpoints-and-rollback.md:12):
This safety net is powered by an internal Checkpoint Manager that keeps a separate shadow git repository under
~/.hermes/checkpoints/— your real project.gitis never touched.
Key mechanics:
- Separate git repository stored under
~/.hermes/checkpoints/<dir_hash>/—the user’s own.gitdirectory is never modified - Automatically triggered before
write_file/patch/rm/mv/sed -i/truncate/shred/> redirect/git reset|clean|checkout - Capped at one checkpoint per directory per turn (preventing snapshot spam during long sessions)
/rollback Nrestores files and rewinds the most recent conversation turn;/rollback diff Npreviews changes;/rollback N <file>restores a single file
Among the other four frameworks, either file-level rollback is absent (Pi / OpenClaw) or rollback relies on the user’s own git history (Claude Code / Codex CLI advising users to commit). Calling it “shadow git” captures the mechanism cleanly: instead of inventing a custom snapshot store, Hermes tucks away a private .git repo for its own safety net.
1.8 Summary: How Naming Shifts Perspective
| Hermes Term | Other Frameworks | Shift in Perspective |
|---|---|---|
| Procedural Memory (Skills) | Skills / Playbooks | Treats Skills as part of the memory system |
| Semantic Memory (MEMORY+USER) | Memory / Notes | Splits factual memory from a dedicated user profile |
| Durable Identity (SOUL.md) | System Prompt | Binds identity to the agent instance, not the project |
| Frozen Snapshot | Prompt Cache | Surfaces the cache vs. freshness trade-off to the user |
| Input Guardrails | — | Models inbound prompt-injection defense as its own layer |
| Subagents Know Nothing | Sub-agent | Puts a zero-knowledge contract into user docs |
| Shadow Git Checkpoint | — | Uses an isolated .git repo as a rollback safety net |
None of these are mere rhetoric—every term maps to real code and user-visible behavior.
2. Distinctive Design Choices
Beyond vocabulary, Hermes takes several architectural paths that peer frameworks do not.
2.1 Product Form: An Always-On, Multi-Platform Personal Agent
Hermes is neither a pure CLI tool nor an IDE plugin. Its default posture is an always-on daemon:
- 17 platform adapters (
gateway/platforms/*.py): Discord, Slack, Telegram, Feishu, Signal, WhatsApp, Matrix, Mattermost, DingTalk, WeCom, Email, SMS, Webhook, Home Assistant, Telegram Network, API Server - Cron jobs built directly into the Gateway process
- SessionDB (SQLite + FTS5) persisting every conversation
- The same agent can move seamlessly across mobile Telegram, desktop Slack, Web, and Email—sharing a single identity across channels
Comparison:
- Claude Code: CLI/IDE, single-user interactive REPL
- Codex CLI: CLI + Web (ChatGPT-bound), focused on software engineering tasks
- OpenClaw: 20+ messaging channels, positioned as a “personal AI gateway” with a 1:1 user-agent relationship
- Pi: developer SDK whose end-user product form is left to the builder
- Hermes: combines OpenClaw’s multi-channel presence with Claude Code’s heavy coding toolset—and builds it heavier than either
That product scope directly explains why run_agent.py is 9,439 lines: fitting 17 platform adapters, cron, browser automation, voice, TTS, vision, MCP, and RL trajectory export into one runtime dictates the shape of the codebase.
2.2 Skills Hub: A Federated Skill Ecosystem
The official docs (skills.md:259-356) list the skill sources Hermes connects to:
| Source | Example | Nature |
|---|---|---|
official | official/security/1password | Optional skills maintained in the official Hermes repo |
skills-sh | skills-sh/vercel-labs/agent-skills/... | Vercel’s public skills.sh directory |
well-known | well-known:https://mintlify.com/docs/... | Any website publishing /.well-known/skills/index.json |
github | openai/skills/k8s | Arbitrary GitHub repo/path |
clawhub | OpenClaw community repo | Cross-framework interoperability |
lobehub | LobeChat community | Cross-framework interoperability |
claude-marketplace | Official Anthropic marketplace | Cross-framework interoperability |
Default taps (skills.md:346-350):
openai/skillsanthropics/skillsVoltAgent/awesome-agent-skillsgarrytan/gstack
Hermes installs official skills published by OpenAI and Anthropic out of the box—rather than inventing a proprietary format, it aligns with the open agentskills.io specification. This is cross-framework interoperability in practice: skills stop being locked to one vendor’s harness and become portable documents.
2.3 Conditional Skill Activation
From the official docs (skills.md:110-120):
metadata:
hermes:
fallback_for_toolsets: [web] # Shown only when the web toolset is unavailable
requires_toolsets: [terminal] # Shown only when the terminal toolset is available
fallback_for_tools: [web_search] # Shown only when web_search is unavailable
requires_tools: [terminal] # Shown only when terminal is available
Plus platforms: [macos, linux] to restrict availability by OS.
No other framework has Fallback Skills—a free or local skill that surfaces only when a paid or primary tool is unavailable. Crucially, hidden skills do not merely stay unloaded; they disappear from the agent’s view entirely—omitted from the system prompt, excluded from skills_list(), and unregistered as slash commands.
This turns skill visibility into a dynamic runtime predicate—more granular than Claude Code’s binary always / ondemand or OpenClaw’s static plugin toggles.
2.4 Every Skill Is a Slash Command
From the official docs (skills.md:22-35):
Every installed skill is automatically available as a slash command.
/gif-search funny cats
/axolotl help me fine-tune Llama 3 on my dataset
/github-pr-workflow create a PR for the auth refactor
/plan design a rollout for migrating our auth provider
Installing a skill automatically registers a matching slash command with zero extra wiring. In Claude Code, skills (~/.claude/skills/) and slash commands (~/.claude/commands/) are separate mechanisms requiring separate files; Hermes unifies them.
Going one step further, skills can bind to persistent output conventions: running the plan skill saves its output under .hermes/plans/ (skills.md:35), turning a skill into both behavioral instructions and an artifact storage convention.
2.5 Pluggable Memory Providers
The official docs list 7 external memory providers (overview.md:42):
Plug in external memory backends (Honcho, OpenViking, Mem0, Hindsight, Holographic, RetainDB, ByteRover) for cross-session user modeling and personalization beyond the built-in memory system.
Each of these is an independent open-source or commercial AI memory project. Hermes’s built-in MEMORY.md + USER.md serve as the baseline, while plugging in an external provider layers on richer capabilities (Honcho’s user modeling, Mem0’s vector retrieval, Holographic’s distributed representations, etc.).
Nous Research is an AI lab, and this design shows its priorities: the agent harness is not just an end-user app, it is a testbed for memory research. Where Claude Code, Codex CLI, OpenClaw, and Pi each ship a single opinionated memory mechanism (or none), Hermes makes the memory layer pluggable.
2.6 RL Trajectory Export
rl_cli.py sits at the repository root alongside run_agent.py. From overview.md:45:
Generate trajectory data from agent sessions for reinforcement learning and model fine-tuning.
Trajectories export in ShareGPT format—the standard interchange format across open-weights post-training pipelines. Any session can be exported into training examples for SFT or RL.
That gives Hermes a dual role: both an agent application and a data collection pipeline. Nous Research uses it internally to generate post-training data for its own models and open-sources the same pipeline. Its lab lineage is unmistakable—Hermes was designed from day one to feed researchers.
2.7 Three LLM API Modes Side by Side
From architecture.md:30-37:
3 API Modes: chat_compl. / codex_resp. / anthropic
Hermes natively speaks three distinct LLM wire protocols:
- OpenAI Chat Completions
- OpenAI Codex Responses (
codex_responses) - Anthropic Messages
As a result, Hermes can exploit Anthropic’s prompt caching, OpenAI’s reasoning fields, and Codex’s response mode directly—capabilities that get flattened away in frameworks built around a single lowest-common-denominator adapter. The trade-off is maintaining three parallel protocol branches.
2.8 Context References: @-Expansion
From the official docs (overview.md:17):
Type
@followed by a reference to inject files, folders, git diffs, and URLs directly into your messages. Hermes expands the reference inline and appends the content automatically.
When a user writes @README.md or @https://example.com/doc in a message, Hermes expands the target and appends its contents to the prompt. It works as an explicit message-level reference syntax, not just IDE autocomplete.
Claude Code supports @file mentions tied to terminal/IDE UI, whereas Hermes implements @-expansion at the message-parsing layer—so it works identically across CLI, Slack, and Telegram.
2.9 Dedicated Terminal Sessions for Subagents
From delegation.md:9:
The
delegate_tasktool spawns child AIAgent instances with isolated context, restricted toolsets, and their own terminal sessions.
Every subagent gets its own shell process—parent and child environment variables, working directories, and command histories never pollute each other. In Claude Code’s Task tool, subagents share the parent environment more loosely; Hermes enforces stricter process-level isolation.
Paired with the zero-context “Subagents Know Nothing” contract, subagents behave like OS-level fork + exec subprocesses rather than in-process helper calls.
2.10 Cross-Channel Identity Binding (DM Pairing Codes)
gateway/pairing.py (11,468 bytes) implements DM pairing for cross-channel identity binding:
- A user messages the bot via IM DM for the first time
- Hermes replies with an 8-character pairing code (following OWASP/NIST guidelines)
- The user enters that code on an already-authenticated primary session (CLI/Web)
- Hermes binds the IM platform account to the user’s primary identity
Once paired, permissions, memory, and approval history carry across channels—an action approved in Slack is remembered when you follow up on Telegram.
Across all five frameworks, only Hermes implements cross-channel identity unification. Peers are either single-channel (Claude Code / Codex CLI / Pi) or treat each channel identity independently (OpenClaw).
3. Distinctive Engineering Techniques
3.1 Capacity-Driven Memory Management
MEMORY.md is capped at 2,200 characters and USER.md at 1,375 characters—and both are hard limits. From tools/memory_tool.py:111:
def __init__(self, memory_char_limit: int = 2200, user_char_limit: int = 1375):
Once a file hits its cap, memory_add is rejected outright; the agent must call memory_replace or memory_remove first to free up space.
The effect is deliberate: it forces the agent to curate its own memory (merging overlapping notes and pruning stale entries). Compare peer approaches:
- Claude Code: no hard cap; attaches age warnings in days so the agent can judge freshness
- Codex CLI: two-stage consolidation pipeline with explicit removals during merge
- OpenClaw: mathematical decay function that down-weights older entries automatically
- Pi: none
Hermes’s approach is the bluntest and lowest-maintenance: scarcity enforces quality—when space runs out, you clean house.
3.2 Three Parallel Paths for Writing Memory
Most frameworks implement a single path for writing memory (either explicit tool calls by the agent or periodic background extraction). Hermes runs three in parallel:
- Explicit tool calls: three separate tools—
memory_add,memory_replace, andmemory_remove - Background nudge review: every 10 accumulated tool calls (
run_agent.py:1029, 1038), after sending the response to the user, Hermes spawns a background review agent to scan the trajectory and decide whether to save new memories - Pre-compression flush:
flush_memories()(run_agent.py:5733) runs right before context compression so the LLM can persist facts toMEMORY.mdbefore middle turns get summarized away
Background nudges track separate counters: skill nudges and memory nudges each fire on their own 10-call cadence without interfering (run_agent.py:1129, 1132).
3.3 Context Compression: 5 Phases + 7-Section Summary Template
compress() in agent/context_compressor.py:565-577 runs in 5 phases:
- Prune old tool results (fast pre-pass with no LLM call)
- Protect head messages (system prompt + initial user/assistant exchange)
- Find tail boundary by token budget (~20K recent tokens kept verbatim)
- Summarize middle turns with a structured LLM prompt
- Iteratively update the previous summary on subsequent re-compressions
The summary prompt enforces a 7-section template (context_compressor.py:287-349):
## Goal
## Constraints & Preferences
## Progress (### Done / ### In Progress / ### Blocked)
## Key Decisions
## Relevant Files
## Next Steps
## Critical Context
Compression pipeline depth across the five frameworks: Hermes (5 phases) > OpenClaw (4 layers) > Claude Code (3 levels) > Codex CLI (2 levels) > Pi (1 level).
3.4 Orphan Tool Stub Injection After Compression
In agent/context_compressor.py:412-470: context slicing can split tool_call / tool_result pairs across compression boundaries. Hermes’s _sanitize_tool_pairs() repairs both directions:
- Deletes orphaned
tool_resultmessages whose correspondingtool_callwas compressed away - Injects a stub result whenever a
tool_callsurvives but itstool_resultwas pruned:"[Result from earlier conversation — see context summary above]"
Why this matters: instead of seeing an unanswered tool call (which causes LLMs to hallucinate failures or re-run the tool), the model sees an explicit pointer telling it the tool already ran and its outcome is captured in the summary above.
Other frameworks either only delete orphaned results (step 1) or leave broken boundaries untouched. Stub injection is unique to Hermes among the five frameworks.
3.5 Tool Concurrency: Path-Scoped Scheduling
run_agent.py:213-231 classifies tools into three concurrency tiers:
_NEVER_PARALLEL_TOOLS = frozenset({"clarify"})
_PARALLEL_SAFE_TOOLS = frozenset({
"read_file", "search_files", "web_search", "web_extract",
"session_search", "skill_view", "skills_list", "vision_analyze",
"ha_get_state", "ha_list_entities", "ha_list_services",
})
_PATH_SCOPED_TOOLS = frozenset({"read_file", "write_file", "patch"})
Other frameworks either serialize everything (simple, slow) or whitelist read-only tools by tool name (coarse). Hermes adds a third tier—deciding file-tool concurrency by target path: three patch calls touching disjoint files run in parallel, whereas two patch calls targeting the same file serialize automatically.
3.6 Five-Hop Fallback Chain + Synced Context Window
_try_activate_fallback() in run_agent.py:4860-4981:
429 rate limit → retry with jittered backoff
413 content too large → trigger context compression, then retry
context window exceeded → switch to a candidate model with a larger context tier
credential expired → refresh token or switch to backup credential
provider unavailable → fail over to another provider
A five-hop recovery chain is the deepest of the five frameworks. Even more distinctive is syncing context_compressor thresholds whenever a fallback switches models (run_agent.py:4954-4967):
self.context_compressor.context_length = fb_context_length
self.context_compressor.threshold_tokens = int(
fb_context_length * self.context_compressor.threshold_percent
)
Effect: failing over from Claude (200K) to GPT-4o (128K) automatically drops the compression trigger from 170K tokens down to 109K. Frameworks that keep a static threshold after failover inevitably hit a 413 on the very next turn.
3.7 Progressive Skill Disclosure (3 Tiers)
tools/skills_tool.py:640 / 719 / 787:
Tier 0 skills_categories() → tens of bytes; returns category names only
Tier 1 skills_list(category) → skill name + description within one category
Tier 2 skill_view(name, file_path) → full SKILL.md or a specific supporting file
With 26 categories and hundreds of skills under ~/.hermes/skills/, dumping everything into the system prompt would blow the context budget—progressive disclosure lets the LLM drill down on demand.
How peer frameworks handle skill loading:
- Claude Code: subagent fork pattern (spawning dedicated skill agents) or frontmatter listing
- OpenClaw / Pi: full injection into the system prompt (workable only with small skill counts)
- Codex CLI: metadata-first loading
- Hermes: three explicit tiers + file-level granularity (Tier 2 can read a single supporting file inside a skill folder)
This is the finest-grained loading scheme of the group, built for libraries of hundreds of skills.
3.8 Model-Family-Specific Prompts
run_agent.py:2704-2712:
if "gemini" in _model_lower or "gemma" in _model_lower:
prompt_parts.append(GOOGLE_MODEL_OPERATIONAL_GUIDANCE)
if "gpt" in _model_lower or "codex" in _model_lower:
prompt_parts.append(OPENAI_MODEL_EXECUTION_GUIDANCE)
Hermes matches substrings on the model name and appends family-specific behavioral instructions:
- Google block: conciseness, absolute paths, parallel tool calls, verify before editing
- OpenAI GPT/Codex block: tool persistence, precondition checks, verification, anti-hallucination rules
- Claude: no extra block (uses the base prompt directly—reflecting the authors’ judgment that Claude follows base instructions cleanly out of the box)
Most multi-provider frameworks aim for a uniform lowest-common-denominator prompt. Hermes goes the opposite way: it acknowledges that different model families have different failure modes and branches the system prompt at runtime.
3.9 coerce_tool_args: Type Coercion
model_tools.py:372-456:
def coerce_tool_args(tool_name, args):
"""Coerce tool call arguments to match their JSON Schema types.
Handles "integer", "number", "boolean", and union types."""
If an LLM emits "count": "42" when the schema expects integer, Hermes silently coerces it to 42. "true" becomes True. No validation exception, no wasted retry turn, no raw string leaking downstream.
That reflects a pragmatic engineering stance: LLM outputs are noisy, so the runtime should absorb predictable type slips rather than enforce pedantic schema rejection. Frameworks like Claude Code and Codex CLI fail schema validation and burn an extra turn making the model retry.
3.10 SubdirectoryHintTracker: Context Follows the Agent Around
agent/subdirectory_hints.py:48-219:
Every time the agent calls a path-bearing tool, the tracker checks whether the target path enters a directory the session hasn’t visited yet. If so, it reads any AGENTS.md / CLAUDE.md / .cursorrules in that directory and appends them to the tool result (leaving the system prompt untouched).
Consequences:
- When the agent moves into a subpackage of a monorepo, local directory rules take effect automatically
- Because the system prompt never mutates, the LLM prefix cache stays warm
- Each discovered file is capped at 8,000 characters and passed through input security scanning
Among the five frameworks, only Hermes makes context rules follow the agent’s physical path traversal dynamically rather than scanning once at session startup.
3.11 Runtime Skill Nudge + Offline GEPA Evolution (Two-Tier Skill Evolution)
Hermes separates skill evolution into two distinct channels—the subject of Part II of this report:
Runtime nudge (run_agent.py:9156-9176): every 10 tool calls, a background review agent scans recent turns and only creates brand-new skills, never overwriting existing ones—serving as the first safety gate.
Offline GEPA (standalone repo hermes-agent-self-evolution): uses DSPy + GEPA to reflectively evolve existing SKILL.md files, tool descriptions, and system prompt sections. Intended landing path: opening a PR against the main hermes-agent repo, never committing directly (though see Part II §11—actual code lags behind that claim).
The two tiers complement each other:
- At runtime, the agent can add new skill files (low risk, zero blast radius on existing workflows)
- Modifying existing files is pushed offline behind GEPA + constraint gates + PR + human review (high risk, tightly controlled)
Full analysis follows in Part II (§6–§11).
3.12 Always-On Streaming Even Without a Consumer
Hermes streams LLM responses even when no UI consumer is watching tokens arrive, using token chunks to detect hung connections. On a non-streaming request that sits silent for 30 seconds, the underlying TCP connection may already be dead without the application noticing; streaming plus a chunk-level heartbeat timeout catches stalls early. Hermes treats streaming as a connection health probe, not just a typing-effect UX feature.
4. Product Stance: Why Hermes Is Built This Way
A consistent product philosophy runs beneath all of these choices:
4.1 Lineage: Nous Research Is an AI Lab
- Pluggable memory backends → built as a research testbed
- ShareGPT trajectory export → feeds post-training data into Nous’s own models
- Three LLM API modes side by side → refuses to flatten away frontier provider features
- Offline GEPA evolution → reflective prompt optimization is an active research interest
These are “serve research first, productize second” decisions. Claude Code (Anthropic) and Codex CLI (OpenAI) are first-party harnesses built to showcase and sell their creators’ own frontier models—a fundamentally different posture.
4.2 Target User: An Individual Running an Always-On Agent
SOUL.mdbound to the instance, not a repo—“I’m the same person regardless of which folder I’m in”- 17 platforms + DM identity pairing—“I can reach my agent wherever I am”
- Cron + voice + Home Assistant—“my agent is an automation daemon, not just a chat window”
- Shadow git checkpoints +
/rollback—“I don’t have to worry about the agent trashing my files”
Placed alongside Claude Code (coding CLI), Codex CLI (OpenAI coding harness), and OpenClaw (personal AI gateway), Hermes merges OpenClaw’s multi-channel daemon model with Claude Code’s deep software-engineering toolset—and builds the union of both at full weight.
4.3 Ecosystem: Cross-Framework Skill Compatibility
- Ships
openai/skillsandanthropics/skillsas default taps - Adopts the open
agentskills.iospecification - Aggregates
skills.sh,.well-known/skills/,clawhub,lobehub, andclaude-marketplace
Rather than walling off a proprietary plugin store, Hermes bets on skills as portable cross-framework assets. None of its peers take this stance—even OpenClaw centers on its own marketplace.
4.4 Code Shape: A 9,400-Line Monolith as a Deliberate Trade-Off
run_agent.py’s 9,439-line monolith is the direct consequence of everything above: 17 platforms + 3 API modes + multi-tier memory + shadow git checkpoints + federated skills + RL export + voice + browser + MCP all converge inside AIAgent (lines 472–9223: 8,752 lines in one class).
The architectural restraint of smaller peers (Pi at 617 lines, Claude Code’s core loop at 1,729 lines) comes from being designed as reusable SDKs or focused developer tools. Hermes operates under no such constraint—its authors optimize for a batteries-included, always-on personal agent that runs out of the box, not for modular library reuse.
5. Hermes Naming Reference Table (Quick Lookup)
| Hermes Term | Source Location | Peer Equivalent | What the Distinction Means |
|---|---|---|---|
| Procedural Memory | skills.md:235, tools-reference.md:127 | Skills / Playbooks | Treats Skills as a branch of memory |
| Semantic Memory (implicit) | memory.md structure | Memory / Notes | Splits factual notes from user profile |
| Durable Identity | personality.md:9 | System Prompt | Binds identity to instance, not project |
| Frozen Snapshot Pattern | memory.md:47 | Prompt Cache (unnamed) | Explicitly documents the freshness trade-off |
| Input Guardrails | Security docs + source | None | Models inbound content scanning separately |
| Output Guardrails | Same as above | Permission / Approval | Paired symmetrically with Input Guardrails |
| Subagents Know Nothing | delegation.md:35 | Sub-agent | Explicit zero-knowledge delegation contract |
| Shadow Git Checkpoint | checkpoints-and-rollback.md:12 | None | Dedicated .git store for safe rollbacks |
| Skills Hub | skills.md:259 | Plugins / Registry | Federated multi-source skill discovery |
| Fallback Skill | skills.md:110 | None | Conditional skill visibility when primary tools are absent |
| Well-known Skills | skills.md:328 | None | Domain-hosted skill discovery via .well-known/skills/ |
| Platform Hints | prompt_builder.py:261 | No explicit equivalent | Lets the agent know which messaging surface it is on |
| Context References | overview.md:17 | @-mention (IDE only) | Channel-agnostic inline @ reference expansion |
| Memory Providers | memory-providers.md | None | Pluggable external memory backends |
| SKILL as Slash Command | skills.md:22 | Two separate systems | Unifies skills and slash commands into one |
| Flush Memories | run_agent.py:5733 | None | Pre-compression memory extraction pass |
| SubdirectoryHintTracker | agent/subdirectory_hints.py | None | Dynamically loads local rules as the agent enters directories |
| GEPA Self-Evolution | hermes-agent-self-evolution repo | None | Reflective evolution + PR-only landing (see Part II §11 on code gaps) |
Part II: Self-Evolution Deep Dive
This part expands on Part I §3.11. Primary sources: standalone repository
hermes-agent-self-evolution(MIT, Nous Research 2026), includingREADME.md(85 lines),PLAN.md(782 lines), and a full source walkthrough (3,762 lines of Python).Reading note: §6–§10 present the architecture as designed in
PLAN.md, while §11 auditsPLAN.mdagainst the actual codebase. Both views matter—PLAN.mdis the roadmap; the code is the MVP.
6. What Self-Evolution Means in the Hermes Context
In Hermes, “self-evolution” carries a specific technical meaning, not a vague gesture at “agents that learn on the job.”
From the opening lines of the official README.md (README.md:3-5):
Evolutionary self-improvement for Hermes Agent. Hermes Agent Self-Evolution uses DSPy + GEPA (Genetic-Pareto Prompt Evolution) to automatically evolve and optimize Hermes Agent’s skills, tool descriptions, system prompts, and code — producing measurably better versions through reflective evolutionary search.
Breaking down every term in that sentence:
| Term | Exact Meaning |
|---|---|
| Evolutionary | Evolutionary search—generating candidate variants, scoring fitness, retaining top performers, and iterating |
| self-improvement | Mutates Hermes’s own artifacts (skills / tool descriptions / system prompts / tool code), not external user projects |
| DSPy + GEPA | Concrete optimization stack (Stanford’s DSPy framework + GEPA reflective prompt evolution, ICLR 2026 Oral) |
| skills, tool descriptions, system prompts, and code | The four classes of mutable text/code artifacts |
| reflective evolutionary search | ”Reflective”—inspects failure traces to diagnose why a run failed, not merely that it failed |
Put together, the exact definition of self-evolution in Hermes is:
Using the GEPA evolutionary optimizer over real execution trajectories to iteratively mutate Hermes’s own skill files, tool descriptions, system prompt sections, and tool implementation code—producing benchmark-gated candidate improvements submitted as pull requests for human review.
Hard boundaries:
- Does not train model weights (
PLAN.md:17: “No GPU training required… DSPy+GEPA and MIPROv2 optimize the text of prompts”) - Never hot-swaps live sessions (
PLAN.md:694: “No evolved content is ever hot-swapped into an active conversation”) - Never commits directly (
PLAN.md:705-706: “All evolved changes go through a pull request”) - Touches only text and code (DSPy’s weight-training
BootstrapFinetuneis explicitly excluded inPLAN.md:17)
Mainline hermes-agent also contains a separate mechanism—runtime skill nudges (run_agent.py:9156-9176, covered in Part I §3.11), where the agent occasionally distills a newly solved workflow into a fresh SKILL.md file mid-session. That path only creates new files and never edits existing ones, runs no optimization loop, and does not touch GEPA. True mutation of existing artifacts lives strictly in the offline self-evolution repo. Together, the two form Hermes’s complete skill evolution pipeline.
7. How the Official Docs Describe It: Quotes + Analysis
7.1 Positioning: A Standalone Repo That Operates on Hermes Without Touching It
PLAN.md:5:
A standalone optimization pipeline that systematically improves Hermes Agent’s performance by evolving skills, prompts, tool descriptions, and agent configurations using automated optimization loops. Lives in its own repo (
NousResearch/hermes-agent-self-evolution), operates ON hermes-agent — not part of it.
Analysis: Self-evolution is an external toolchain, not a runtime subsystem of the agent. Whether the main agent daemon is running or stopped makes no difference—optimization runs offline in a separate process and sends improvements back via PRs.
That separation guarantees zero impact on live agent stability and cleanly isolates software licenses (Darwinian Evolver is AGPL v3 and invoked strictly as an external CLI, never imported into hermes-agent).
7.2 Core Algorithm: GEPA and Reflective Evolution
README.md:26:
GEPA reads execution traces to understand why things fail (not just that they failed), then proposes targeted improvements. ICLR 2026 Oral, MIT licensed.
Analysis: What distinguishes GEPA technically is the shape of its feedback signal. Classical RL collapses a rollout into a scalar reward (“this run scored 0.3”); GEPA has an LLM read the execution trace and articulate in natural language where and why the failure happened (“the agent called search tools before reading SKILL.md, picking the wrong tool”), feeding that diagnosis directly into the next mutation step.
Consequences:
- High sample efficiency (can start from as few as 3 examples)
- Human-legible failure diagnoses (unlike opaque scalar rewards)
- Zero GPU requirement—purely API-driven
7.3 Cost
README.md:7:
No GPU training required. Everything operates via API calls — mutating text, evaluating results, and selecting the best variants. ~$2-10 per optimization run.
Analysis: $2–$10 per optimization run is what makes the design operationally viable. Compared with thousands of dollars in GPU compute for RL runs, API-scale cost makes a recurring weekly optimization cron realistic.
7.4 Optimization Targets: Four Tiers of Increasing Risk
PLAN.md:22-48 lays out four optimization tiers with explicit value/risk profiles:
| Tier | Target Artifact | Value / Risk | Optimizer |
|---|---|---|---|
| Tier 1 | SKILL.md files | High value, low risk | DSPy + GEPA |
| Tier 2 | Tool descriptions (description fields in tool schemas) | Medium value, low risk | DSPy + GEPA |
| Tier 3 | System prompt sections | High value, high risk (edits affect all behavior) | DSPy + GEPA |
| Tier 4 | Tool implementation code | High value, highest risk | Darwinian Evolver (external CLI) |
Analysis: This ordering reveals Hermes’s thesis on what algorithms can safely rewrite:
- The more self-contained an artifact is, the safer it is to evolve (
SKILL.mdis an isolated Markdown file) - The sharper the evaluation signal, the easier it is to optimize (whether the model picked the right tool is a clean classification check)
- The wider the blast radius, the later it belongs in the sequence (a bad system prompt degrades every conversation)
- Source code comes last (because even large test suites struggle to catch every subtle regression)
7.5 Zero-Modification Principle on the Main Repo
PLAN.md:208:
hermes-agent-self-evolution operates ON hermes-agent, not inside it. Zero changes to the agent repo are needed. It reads from the hermes-agent codebase and writes evolved versions to git branches, creating PRs for human review.
Analysis: “Zero changes” is a methodological commitment—the core agent codebase makes no architectural concessions to accommodate self-evolution. Instead, self-evolution reuses batch_runner.py for evaluation, reads skills/ and tools/registry.py as optimization targets, mines hermes_state.py (SessionDB) for real usage traces, and writes evolved artifacts back exclusively via git branches and PRs.
8. Where the Idea Came From: Five Underlying Motivations
Hermes does not publish a manifesto explaining why it built self-evolution, but PLAN.md makes five underlying drivers clear between the lines.
8.1 Technical Trigger: GEPA Just Arrived
GEPA is an ICLR 2026 Oral paper (cited repeatedly in PLAN.md) from the Stanford DSPy group. Prior to GEPA, every prompt optimization option carried painful trade-offs:
- Hand-tuning prompts: slow, subjective, non-reproducible
- DSPy MIPROv2: Bayesian search—converges quickly, weak at diagnosing why prompts fail
- RL (PPO, GRPO, etc.): demands GPUs, large rollout volumes, and scalar reward engineering
- GEPA: reads traces, emits natural-language critiques, works few-shot, needs no GPUs—turning prompt optimization from a research project into an engineering job
Because Nous Research is an AI lab, wiring a freshly published algorithm that fits their exact stack into infrastructure is a natural reflex.
8.2 Structural Fit: Hermes Was Already Built Like an Optimization Pipeline
PLAN.md:90-99 inventories existing Hermes modules that plug straight into an evolution loop:
| Existing Hermes Component | Role in Self-Evolution |
|---|---|
batch_runner.py | Parallel batch execution during candidate evaluation |
agent/trajectory.py | Captures full execution traces for GEPA reflection |
hermes_state.py (SessionDB) | Mines real historical conversations into evaluation sets |
skills/ directory | Primary Tier 1 optimization targets |
tools/registry.py | Houses tool descriptions |
agent/prompt_builder.py | Houses modular system prompt sections |
tests/ | Hard regression gate—evolved artifacts must pass 100% |
| Git history | Tracks evolutionary lineage and enables one-command rollback |
Several baseline Hermes choices happened to lay the exact groundwork an evolutionary optimizer needs:
- Complete trajectories (tool calls, reasoning, outputs) → ready for GEPA to inspect
- SessionDB indexed with SQLite FTS5 → fast queries for every session where a skill was loaded
- Parallel
batch_runner→ evaluating 30 candidates scales horizontally - Plain-text Markdown skills → mutating a skill requires zero schema migrations
None of these were originally built for self-evolution, yet together they meant most of the plumbing already existed; adding self-evolution mostly required dataset builders and a thin GEPA wrapper.
8.3 Product Bottleneck: Hand-Tuning Hundreds of Skills Does Not Scale
PLAN.md:26-27 explains why Tier 1 starts with skills:
Why it works: Skills are pure text, easily mutated, and directly measurable (did the agent complete the task correctly when following this skill?) Example: Evolve the
github-code-reviewskill to produce better reviews by testing against a dataset of known-good code reviews
Hermes’s skills/ tree spans 26 categories and hundreds of hand-written Markdown files. That creates predictable scaling bottlenecks:
- A single author writing from intuition rarely hits the optimal phrasing on the first try
- Community-contributed skills vary widely in quality
- When underlying models upgrade (say, from Claude 3 to Claude 4), prompt phrasings tuned for older models drift out of optimum
- Subtle conflicts or overlaps across hundreds of skills are hard for humans to spot manually
Manual iteration cannot keep up at that scale. In principle, GEPA can:
- Run
github-code-reviewagainst 20 real PRs paired with known-good reviews and iteratively sharpenSKILL.md - Surface phrasing improvements a human author wouldn’t think to try
- Do it for $2–$10 in API calls—an order of magnitude cheaper than engineering hours
8.4 Philosophical Stance: Treating the Agent Itself as an Evolving Organism
README.md:1:
🧬 Hermes Agent Self-Evolution
The DNA emoji (🧬) signals a specific mental model: an agent is not a static software release, but an evolving lineage. PLAN.md leans heavily on evolutionary biology vocabulary:
- organism (Darwinian Evolver treats each tool file as an organism)
- evolutionary lineage (
PLAN.md:99: “Track all evolution lineage, enable rollback”) - Pareto frontier (GEPA’s selection mechanism)
- candidate variants
That framing reflects Nous Research’s identity as a research lab: the agent is an object of study, and how an agent improves itself is itself a research question—not a closed commercial product shipped over a wall.
Contrast Claude Code: as Anthropic’s proprietary commercial harness, its prompts and built-in behaviors are tuned behind closed doors. Releasing hermes-agent-self-evolution under the MIT License (PLAN.md:82: ”© 2026 Nous Research”) openly invites external researchers and users to fork and evolve the agent themselves.
8.5 Practical Driver: The Session Data Was Already Sitting There
Nous Research dogfoods Hermes daily, accumulating a rich archive of real sessions in SessionDB:
- Zero extra collection overhead
- No external user privacy hurdles on internal dogfooding logs
- Real-world task distributions rather than synthetic toy prompts
- Broad coverage across skills, tools, and messaging platforms
PLAN.md:310-315 explicitly points to SessionDB as an evaluation source:
Query SessionDB for sessions where the skill was loaded (search for skill name in messages) … Extract the task the user gave and the agent’s full response … Use LLM-as-judge to score each (task, response) pair on a rubric
When high-signal trajectory data is already sitting on disk, building an optimizer on top of it is an obvious next step.
9. Implementation Design: The Five Optimization Phases (Per PLAN.md)
This section describes each phase as designed in
PLAN.md. §11 audits what actually exists in code today.
9.1 Phase 1: Skill Evolution (Claimed in PLAN: Implemented)
Goal: Make hermes evolve skill <n> run end-to-end and open a PR with a measurably stronger SKILL.md.
Workflow (PLAN.md:295-344):
1. Load the target skill's current SKILL.md
↓
2. Wrap it as a DSPy Module
- SKILL.md text → instruction field on a dspy.Signature
- Full agent workflow → dspy.ReAct
↓
3. Build the evaluation dataset (blending three sources)
A. Synthetic: Claude Opus reads SKILL.md and generates 15–30 test tasks
B. SessionDB: mine historical sessions where this skill was loaded
C. Golden set: hand-written test cases (optional)
Split into train / val / holdout
↓
4. Run the GEPA optimizer
- Inspect trajectories (full step-by-step traces of failed runs)
- LLM reflects on why the current SKILL.md led to each failure
- Propose candidate SKILL.md mutations
- Evaluate candidates in parallel via batch_runner
- Pareto frontier selection (retain any candidate that is best on *at least one* example)
↓
5. Constraint gate validation
- pytest suite passes 100%
- File size ≤ 15 KB
- Semantic preservation (LLM verifies core intent matches the original SKILL.md)
- No benchmark regression (TBLite score drop ≤ 2%)
↓
6. Open a PR
- Branch name: evolve/<skill>-<timestamp>
- PR body: before/after scores, full diff, optimization cost, count of rejected variants
↓
7. Human review and merge
Fitness formula (evolution/core/fitness.py:14-31):
composite = max(0, 0.5·correctness + 0.3·procedure_following + 0.2·conciseness − length_penalty)
Four weighted dimensions:
- correctness (0.5): whether the task outcome is right
- procedure_following (0.3): whether the agent followed the workflow prescribed by the skill
- conciseness (0.2): whether the response avoids bloat
- length_penalty: penalizes skills approaching the 15 KB cap so evolution doesn’t drift toward ever-longer instructions
Models assigned to each role:
- GEPA reflection uses
openai/gpt-4.1(stronger reasoning model to diagnose failure root causes) - LLM-as-judge scoring uses
openai/gpt-4.1-mini(cheaper model where rubric consistency matters most)
9.2 Phase 2: Tool Description Evolution (Planned)
Goal: Evolve description strings inside tool JSON schemas so the agent selects the right tool more reliably.
Core difficulty (PLAN.md:408-411):
Cross-tool evaluation — Ensure improving one description doesn’t hurt others. Always evaluate ALL tool descriptions together. Fitness function penalizes regressions on any tool’s selection rate. This prevents a
search_filesdescription from “stealing” selections fromread_file.
Analysis: Tool selection is zero-sum across overlapping tools—making search_files sound more appealing can cannibalize legitimate read_file calls. Evaluation therefore has to run jointly across the entire toolset rather than optimizing one tool in isolation.
Hard constraints (PLAN.md:433-438):
- Tool description ≤ 500 characters
- Individual parameter description ≤ 200 characters
- Schema structure (parameter names, types,
requiredflags) frozen—only prose descriptions mutate - Factual accuracy required (cannot claim capabilities the tool doesn’t implement)
9.3 Phase 3: System Prompt Section Evolution (Planned)
Goal: Evolve the 5 mutable guidance blocks in the system prompt.
Mutable vs. frozen prompt sections (PLAN.md:460-470):
| Section | Location | Role | Mutable? |
|---|---|---|---|
DEFAULT_AGENT_IDENTITY | prompt_builder.py | Core persona and behavioral defaults | ✅ |
MEMORY_GUIDANCE | Same as above | When and what to store in memory | ✅ |
SESSION_SEARCH_GUIDANCE | Same as above | When to search past session history | ✅ |
SKILLS_GUIDANCE | Same as above | When to create or load skills | ✅ |
PLATFORM_HINTS | Same as above | Platform-specific formatting hints | ✅ |
| Memory block (live memory contents) | memory_store.py | The user’s stored memories | ❌ (user data) |
| Skills index | prompt_builder.py | Auto-generated skill listing | ❌ (auto-generated) |
| Context files | Same as above | AGENTS.md, etc. | ❌ (project-specific) |
Why risk peaks here: System prompt edits alter every turn the agent takes. Candidates must therefore pass both TBLite (100 coding/ops tasks) and YC-Bench fast_test (long-horizon coherence)—a regression on either rejects the candidate (PLAN.md:481-483).
9.4 Phase 4: Tool Code Evolution (Planned)
Goal: Evolve Python tool implementations using Darwinian Evolver.
Why switch engines: Phases 1–3 mutate natural-language prose, where GEPA’s reflective text edits shine. Phase 4 mutates executable Python—requiring a git-based organism model:
- Each tool
.pyfile is treated as an organism - Each mutation = an LLM-proposed code patch committed onto an isolated branch
- Fitness = pytest pass rate + benchmark scores + bug-reproduction test outcomes
- Zero tolerance: all 2,550+ existing unit tests must pass (
PLAN.md:556-559)
Strictest guardrails in the plan (PLAN.md:578-584):
- 100% test pass rate
- Function signatures frozen (changing signatures breaks callers)
registry.register()calls frozen (changing registration breaks tool discovery)- Error-handling coverage may not decrease
- Darwinian Evolver invoked strictly as an external CLI subprocess (preserving AGPL v3 license isolation)
- Mandatory human review on every PR—no auto-merge
9.5 Phase 5: Continuous Loop (Planned)
Goal: Let the system detect its own weakest spots and trigger offline optimization runs automatically.
Core components (PLAN.md:604-625):
-
Performance monitor
- Per-skill success rate (mining SessionDB: sessions loading a skill → whether the task succeeded)
- Tool selection accuracy (mining trajectories: whether the chosen tool was appropriate)
- Benchmark score time series
- User correction frequency (phrases like “no, use X instead of Y” treated as negative signal)
-
Auto-triage: Ranks optimization targets by
headroom × usage_frequency -
Scheduled optimization (cron):
- Runs TBLite + YC-Bench
fast_testweekly and logs score trends - Automatically triggers GEPA when a benchmark dips or a skill’s failure rate crosses a threshold
- Opens a PR
- Pings a human reviewer
- Runs TBLite + YC-Bench
Crucial invariant (PLAN.md:600):
Human still reviews and merges every PR — this phase automates detection and optimization, not deployment.
Analysis: Even in the fully automated end-state, merging remains strictly human-gated from Phase 1 through Phase 5.
9.6 Benchmarks as Gates, Not Fitness Functions
PLAN.md:661-662 draws an architectural distinction that is easy to gloss over:
Key principle: Benchmarks are GATES, not fitness functions. The fitness function is task-specific (did the skill/tool/prompt do its job better?). Benchmarks ensure the improvement didn’t break something else. A variant that improves skill quality by 20% but drops TBLite by 5% is REJECTED.
Unpacking the two roles:
- Fitness function: task-specific quality score (did this skill perform its target job better?)—ranks candidate A against candidate B
- Gate: general-purpose benchmark suite (TBLite, YC-Bench)—decides whether the winning candidate is allowed into a PR
Keeping them separate prevents Goodharting the benchmark: if TBLite were the fitness objective, GEPA could evolve bizarre skill text that games general benchmark tasks while gutting the skill’s actual domain workflow. Treating benchmarks strictly as gates keeps optimization focused on the target task while blocking collateral regressions.
9.7 The Five-Part Constraint Gate
PLAN.md:666-728 specifies five mandatory checks before any evolved artifact ships:
| # | Constraint | Requirement |
|---|---|---|
| 1 | Full test suite | pytest tests/ -q passes 100%, zero tolerance |
| 2 | Size caps | Skill ≤ 15 KB, tool description ≤ 500 chars, prompt section growth ≤ 20% |
| 3 | Cache compatibility | Never hot-swapped into active conversations; takes effect only in new sessions |
| 4 | Semantic preservation | LLM judge verifies core intent matches the baseline version |
| 5 | PR-only landing | All changes go through git branch + PR, never a direct commit |
Item #5 is echoed in README.md:76:
PR review — All changes go through human review, never direct commit.
At the design level, that is the ultimate safety backstop—an optimizer is never allowed to write directly to main.
⚠️ Caveat: As §11 shows below, only four syntactic checks exist in code today (excluding semantic preservation), and automated PR creation has not been built yet. Design intent and current code reality must be evaluated separately.
10. How It Differs from Other “Self-Improvement” Approaches
10.1 Not Reinforcement Learning
PLAN.md:17:
No GPU training required… DSPy+GEPA and MIPROv2 optimize the text of prompts, instructions, and few-shot examples — they mutate and evaluate strings, not model weights.
- RL: updates model weights; requires GPUs, large rollout batches, and scalar rewards
- GEPA: mutates prompt strings; requires only API calls, a handful of examples, and natural-language critiques
Hermes explicitly chooses string optimization here. Its top-level rl_cli.py in the main repo serves a separate pipeline—exporting ShareGPT trajectories for external RL weight training, not running RL inside Hermes. Keep the two tracks distinct:
hermes-agent-self-evolution: Nous Research evolving the Hermes harness (mutating text/code)rl_cli.pytrajectory export: Nous Research feeding post-training data into model training (updating weights)
10.2 Not Fine-Tuning
DSPy itself ships BootstrapFinetune for fine-tuning model weights on synthesized traces. Hermes explicitly rules it out (PLAN.md:17):
The only DSPy component that trains weights (
BootstrapFinetune) is explicitly excluded from this plan.
Same boundary as §10.1—mutate strings, leave weights untouched. Weight fine-tuning drags in GPUs, dataset curation, eval harnesses, and custom model serving—a vastly heavier operational surface that Hermes deliberately avoids here.
10.3 Not Live In-Conversation Self-Modification
Runtime nudges in the main repo (run_agent.py:9156-9176, Part I §3.11) only create brand-new SKILL.md files after spotting a novel workflow—they never overwrite existing skills.
Rewriting an existing SKILL.md is restricted exclusively to the offline self-evolution pipeline.
That split reflects a crisp risk model:
- Adding a new file to the skill library at runtime is low-risk and non-destructive
- Rewriting an existing skill carries regression risk, so it belongs offline behind GEPA + constraint gates + PR + human review
Contrast OpenClaw’s nightly “Dreaming” memory promotion, where the agent mutates long-term memory directly on a live schedule; Hermes pushes any destructive rewrite offline and behind human sign-off.
10.4 Not a Black Box (By Design)
Every stage of GEPA emits human-auditable artifacts:
- Candidate variants: plain-text
SKILL.mddiffs any engineer can read - Reflections: natural-language critiques explaining why one variant outperformed another
- Decomposed scores: four named rubric dimensions (
correctness/procedure/conciseness/length), rather than an opaque scalar reward
That auditability is central to why PLAN.md repeatedly emphasizes “human review” and changes being “sensible to a human reviewer.”
⚠️ Caveat: In the actual repository today, the active fitness function is a bag-of-words keyword-overlap heuristic (§11.3 Gap 1), not the four-dimensional LLM judge described in
PLAN.md. Full interpretability holds in the design doc, while the current code prototype uses a much cruder proxy.
11. PLAN vs. Code Reality: Seven Concrete Gaps + Code Walkthrough
This section is the core empirical contribution of Part II. Reading
PLAN.mdalone makes the project look like a mature production pipeline; reading the code shows an early research prototype. Separating the two is essential.
11.1 Overall Repository Scale and Commit Activity
Actual state of hermes-agent-self-evolution (as of late April 2026):
- Total codebase: 3,762 lines of Python (
evolve_skill.pyat 323 lines,external_importers.pyat 785 lines,fitness.pyat 146 lines,constraints.pyat 174 lines,dataset_builder.pyat 201 lines,skill_module.pyat 123 lines, plus__init__.pyfiles and tests) PLAN.mdsize: 40,694 bytes (~782 lines)—the design document is longer than the core optimizer implementation- Git history: 7 commits total
0949dc7 feat: initial hermes-forge — Phase 1 skill evolution via DSPy + GEPA
2e4ec14 refactor: rebrand hermes-forge → hermes-agent-evolution
ea02cd5 fix: use CLI model for dataset generation, validate full pipeline
2377f9e docs: Phase 1 validation report (PDF)
96a1132 refactor: rebrand to Hermes Agent Self-Evolution
3fb26f1 feat: external session importers for Claude Code, Copilot, and Hermes (#2)
4693c8f feat: add Hermes session importer + fix short skill name matching (#4)
Originally named hermes-forge and rebranded twice, its two most recent commits both add session importers—showing active work is currently focused on gathering real evaluation traces, not expanding optimization algorithms.
- Tests: 2 test files (
tests/core/test_constraints.pyat 98 lines +tests/skills/test_skill_module.pyat 92 lines), totaling 190 lines - Published artifact:
reports/phase1_validation_report.pdf(14.5 KB)—the Phase 1 validation write-up
11.2 Actual Implementation Status by Phase
| Phase | Target | PLAN Claim | Code Reality |
|---|---|---|---|
| 1 | Skill | ✅ Implemented | ✅ Runnable: evolve_skill.py (323 lines) + skill_module.py (123 lines) + shared core (~500 lines) |
| 2 | Tool description | 🔲 Planned | ⛔ evolution/tools/ contains only a 1-line empty __init__.py |
| 3 | System prompt section | 🔲 Planned | ⛔ evolution/prompts/ contains only a 1-line empty __init__.py |
| 4 | Tool code | 🔲 Planned | ⛔ evolution/code/ contains only a 1-line empty __init__.py |
| 5 | Continuous loop | 🔲 Planned | ⛔ evolution/monitor/ contains only a 1-line empty __init__.py |
Phases 2–5 are literally empty directories holding package placeholder files. Every detailed design in PLAN.md for tool-description optimization, system-prompt evolution, Darwinian Evolver code mutation, and continuous monitoring currently stands at zero lines of code.
11.3 PLAN Claims vs. Code Reality: Seven Concrete Gaps
Gap 1: The Fitness Function Is Not LLM-as-Judge
What PLAN says: fitness.py scores candidates with a four-dimensional LLM-as-judge rubric (correctness / procedure_following / conciseness / length_penalty):
composite = max(0, 0.5·correctness + 0.3·procedure + 0.2·conciseness − length_penalty)
What the code actually does: fitness.py defines both an LLMJudge class (74 lines) and a skill_fitness_metric() function (30 lines). GEPA is wired to skill_fitness_metric, not LLMJudge (evolve_skill.py:158: metric=skill_fitness_metric).
Here is skill_fitness_metric in fitness.py:107-136:
def skill_fitness_metric(example, prediction, trace=None) -> float:
agent_output = getattr(prediction, "output", "") or ""
expected = getattr(example, "expected_behavior", "") or ""
# ...
# Simple keyword overlap as a fast proxy
expected_words = set(expected_lower.split())
output_words = set(output_lower.split())
if expected_words:
overlap = len(expected_words & output_words) / len(expected_words)
score = 0.3 + (0.7 * overlap)
return min(1.0, max(0.0, score))
It computes word-set overlap × 0.7 + a 0.3 baseline—nothing more. The inline comment on lines 121–123 acknowledges why:
# Quick heuristic scoring (for speed during optimization)
# Full LLM-as-judge scoring is expensive — use it selectively
LLMJudge.score() sits in the file unused by evolve_skill. Length penalty is likewise implemented only inside LLMJudge, never applied in skill_fitness_metric.
Implication: Phase 1’s live optimization signal is far cruder than PLAN.md describes—just unigram overlap. That also contextualizes why the Phase 1 validation report is a modest 14.5 KB PDF rather than a sweeping benchmark claim.
Gap 2: GEPA Wraps a MIPROv2 Fallback (Because GEPA Integration Is Unstable)
What PLAN says: GEPA is the primary optimizer, with MIPROv2 noted as a fallback (matching the README’s “fallback optimizer” phrasing).
What the code actually does (evolve_skill.py:156-177):
try:
optimizer = dspy.GEPA(
metric=skill_fitness_metric,
max_steps=iterations,
)
optimized_module = optimizer.compile(baseline_module, trainset=trainset, valset=valset)
except Exception as e:
console.print(f"[yellow]GEPA not available ({e}), falling back to MIPROv2[/yellow]")
optimizer = dspy.MIPROv2(metric=skill_fitness_metric, auto="light")
optimized_module = optimizer.compile(baseline_module, trainset=trainset)
The GEPA call is wrapped in a broad try/except Exception that falls back to dspy.MIPROv2(..., auto="light"). A nearby comment noting "GEPA not available in this DSPy version" shows DSPy’s GEPA integration was still shifting when this was written.
Implication: Under an incompatible DSPy version, a “GEPA optimization run” degrades cleanly—and quietly, aside from a console warning—into light MIPROv2. You only spot that fallback by reading the source.
Gap 3: The Constraint Gate Has Four Checks, Not Five
What PLAN says (PLAN.md:666-728):
- Full test suite (
pytest tests/) - Character/size caps
- Cache compatibility
- Semantic preservation
- PR-only landing
What the code actually does (validate_all() in constraints.py:30-53):
def validate_all(self, artifact_text, artifact_type, baseline_text=None):
results = []
results.append(self._check_size(artifact_text, artifact_type)) # 1
if baseline_text:
results.append(self._check_growth(artifact_text, baseline_text, ...)) # 2
results.append(self._check_non_empty(artifact_text)) # 3
if artifact_type == "skill":
results.append(self._check_skill_structure(artifact_text)) # 4
return results
_check_size: character/byte caps (skill ≤ 15 KB, tool desc ≤ 500, param desc ≤ 200)_check_growth: size growth ≤ 20%_check_non_empty: non-empty text_check_skill_structure: YAML frontmatter containsnameanddescription
run_test_suite() exists as a separate helper (constraints.py:55-93, running pytest tests/ -q --tb=no with a 300s timeout), but validate_all() does not invoke it—and the CLI flag --run-tests defaults to False.
Missing entirely:
- Semantic preservation check (PLAN’s LLM check that core intent didn’t drift)—absent from the codebase
- Cache compatibility check (“no hot-swap”)—an operational rule, not enforced in code
- Mandatory pytest gate—disabled by default
Implication: PLAN’s five-part safety gate reduces in code to four purely syntactic checks (size, growth, non-empty, frontmatter keys), with zero semantic drift protection.
Gap 4: No Benchmark Gate Exists
What PLAN says (PLAN.md:631-662): TBLite acts as a hard regression gate before any PR, TerminalBench2 validates top-3 candidates deeply, and YC-Bench checks long-conversation coherence.
What the code actually does: There is no benchmark_gate.py anywhere in the repo. The actual contents of evolution/core/ are:
config.py 72 lines
constraints.py 174 lines
dataset_builder.py 201 lines
external_importers.py 785 lines
fitness.py 146 lines
benchmark_gate.py, listed in PLAN’s directory tree (PLAN.md:151), does not exist, nor does evolve_skill.py invoke any external benchmark runner.
Implication: The centerpiece architectural principle in §9.6 (“Benchmarks are GATES, not fitness functions”) has zero code behind it today—evolved Phase 1 skills pass only syntactic size/frontmatter checks, with no cross-task regression gate.
Gap 5: No Automated PR Generation
What PLAN says (PLAN.md:705-721):
git checkout -b evolve/<target>-<timestamp>
git add <files>
git commit -m "evolve: ..."
git push -u origin ...
gh pr create --title "evolve: ..." --body "..."
And PLAN’s directory tree assigns this workflow to evolution/core/pr_builder.py.
What the code actually does: There is no pr_builder.py. Lines 255–286 of evolve_skill.py (“Save output”) simply write files to disk:
output_dir = Path("output") / skill_name / timestamp
output_dir.mkdir(parents=True, exist_ok=True)
(output_dir / "evolved_skill.md").write_text(evolved_full)
(output_dir / "baseline_skill.md").write_text(skill["raw"])
(output_dir / "metrics.json").write_text(json.dumps(metrics, indent=2))
Artifacts land in a local output/<skill>/<timestamp>/ folder—never touching git, never creating a branch, and never opening a PR. At completion, the CLI prints:
Review the diff: diff {output_dir}/baseline_skill.md {output_dir}/evolved_skill.md
leaving diff inspection and PR creation entirely to the human operator.
Implication: Technically, writing to a local directory satisfies “never direct commit”—because the script never runs git commit at all—but automated PR creation for human review, a headline promise of PLAN.md, is unimplemented.
Gap 6: external_importers Is a Recent Expansion (Where Code Exceeds PLAN)
What PLAN says (PLAN.md:310-315): Dataset Source B mines Hermes’s own SessionDB.
What the code actually does: evolution/core/external_importers.py is 785 lines—the single largest file in the repository. Recent commit #4 (4693c8f, feat: add Hermes session importer + fix short skill name matching) shows these importers were added incrementally and support three agent harnesses:
claude-code— Claude Code local session logscopilot— GitHub Copilot chat/session historyhermes— Hermes’s own SessionDB
Here the code goes further than PLAN.md: instead of mining only Hermes sessions, it ingests trajectories from competing coding agents too. That hints at a broader ambition—cross-agent skill optimization, where a portable skill like github-code-review used across Claude Code, Copilot, and Hermes can pool real-world traces from all three into a much richer evaluation set.
Implication: This is the one area where implementation outpaces PLAN.md, and it reveals where engineering effort is actually going right now: data ingestion rather than new optimizer phases.
Gap 7: CLI Invocation Shape
What PLAN says (PLAN.md:346):
hermes evolve skill github-code-review --iterations 10
i.e., exposed as a subcommand on the main hermes CLI.
What the code actually does: Only runnable via:
python -m evolution.skills.evolve_skill --skill github-code-review --iterations 10
Lines 296–319 of evolve_skill.py define a standalone click command that does not register a plugin entrypoint on hermes. And because this repository is external to hermes-agent, running pip install -e . does not attach subcommands to hermes.
Implication: Running self-evolution today requires cloning the separate repo and invoking the Python module directly; it is not an out-of-the-box command for regular Hermes users.
11.4 Phase 1 Real Code Walkthrough (10 Steps)
What evolve() in evolve_skill.py (lines 36–293) actually executes step by step:
| Step | Action | Code Location |
|---|---|---|
| 1 | Locate target skill file (exact directory match or fuzzy match on frontmatter name:) | skill_module.find_skill() :58-81 |
| 2 | Parse SKILL.md into {frontmatter, body, name, description} | skill_module.load_skill() :15-55 |
| 3 | Build evaluation set from one of three sources: synthetic / golden / sessiondb (via external_importers) | evolve_skill.py:81-117 |
| 4 | Validate baseline skill against the 4 syntactic checks | evolve_skill.py:119-132 |
| 5 | Configure DSPy LM and wrap the skill body in SkillModule | evolve_skill.py:134-149 |
| 6 | Run GEPA (with try/except fallback to MIPROv2) | evolve_skill.py:151-180 |
| 7 | Extract the evolved skill body from the compiled module and rebuild full SKILL.md via reassemble_skill() | evolve_skill.py:182-185 |
| 8 | Validate evolved skill constraints (including growth vs. baseline); if invalid, dump to evolved_FAILED.md | evolve_skill.py:187-205 |
| 9 | Evaluate both baseline and evolved modules on the holdout split and compute mean score delta | evolve_skill.py:207-227 |
| 10 | Render a before/after rich.Table and save three output files under the timestamped output/ folder | evolve_skill.py:229-293 |
Crucial implementation detail:
SkillModule’s DSPy Signature (skill_module.py:94-102) is a genericTaskWithSkillsignature—every skill goes through the same signature asking an LLM to complete a task following the skill text- In fact, it never spins up the real Hermes Agent runtime at all—instead, DSPy’s
ChainOfThoughtmodule simulates an agent following the skill in a single forward pass, far lighter thanPLAN.md’s vision of running full multi-turn rollouts throughbatch_runner.py - Strip away the framing, and Phase 1 skill evolution currently does this: it runs DSPy GEPA (or MIPROv2) to rewrite
SKILL.mdprose so a genericChainOfThought(skill + task → output)predictor scores higher on keyword overlap against expected outputs
11.5 Phase 1 Validation Report
reports/phase1_validation_report.pdf (14.5 KB) is the sole published validation artifact for Phase 1. Its binary PDF contents were not unpacked in this text audit, but its presence shows the Nous team considered initial Phase 1 runs worth documenting—and its 14.5 KB file size matches a concise few-page note rather than a massive benchmark study, consistent with an early research prototype.
11.6 Summary Table of Gaps
| Dimension | PLAN.md | Code Reality |
|---|---|---|
| Fitness function | Four-dimensional LLM-as-judge | Keyword-overlap heuristic |
| Optimizer | GEPA | GEPA + MIPROv2 try/except fallback |
| Constraint gate | Five checks (including semantic preservation + cache rule + pytest) | Four syntactic checks (size/growth/non_empty/structure); pytest helper exists but is off by default |
| Benchmark gate | TBLite + TerminalBench2 + YC-Bench | None (benchmark_gate.py does not exist) |
| PR output | Automated gh pr create | Writes files locally under output/ |
| Phase 2 (Tool descriptions) | Detailed design | Empty directory |
| Phase 3 (Prompt sections) | Detailed design | Empty directory |
| Phase 4 (Tool code via Darwinian Evolver) | Detailed design | Empty directory |
| Phase 5 (Continuous loop) | Detailed design | Empty directory |
| Evaluation data sources | Three sources (synthetic + SessionDB + golden) | Four sources (adds external_importers mining Claude Code / Copilot / Hermes)—exceeds PLAN |
| CLI entry point | hermes evolve skill ... | python -m evolution.skills.evolve_skill ... |
Bottom-line assessment: hermes-agent-self-evolution today is a research-grade prototype. Phase 1 has a working end-to-end demo, while major safety and evaluation pillars (wired LLM judge, benchmark gates, automated PRs, semantic drift checks) remain unimplemented. PLAN.md’s 780+ lines sketch a multi-quarter (or multi-year) architecture, whereas the repository sits at roughly month three of execution.
Someone reading only the README.md could easily assume an autonomous self-improving pipeline is already churning out PRs in production; in reality, today’s workflow is:
- An engineer manually runs
python -m evolution.skills.evolve_skill --skill xxx --eval-source synthetic --iterations 10 - Inspects the local file diff under
output/ - Manually decides whether to copy those edits over into
hermes-agent
Recent commit activity (expanding cross-agent session importers) suggests the immediate priority is not rushing into Phases 2–5, but grounding Phase 1 evaluation sets in real session traces. That is a sound engineering call—scaling optimization to prompts and code before fixing the fitness signal would be premature.
PLAN.md itself inserts explicit validation gates between phases (PLAN.md:250-258) and notes candidly:
But we may stop at Phase 1 or 2 if the returns diminish — no obligation to do all five.
Read alongside the codebase, that sentence rings completely true: Phases 2–5 haven’t started, and if Phase 1 doesn’t clear a high bar on real tasks, Phase 2 may never need to be built.
Conclusion: Seven Core Takeaways
On Hermes Overall (from Part I):
-
Hermes stands out by naming its abstractions explicitly—Procedural Memory, Durable Identity, Frozen Snapshot, Input Guardrails, Subagents Know Nothing, Shadow Git—none of these are empty labels; each is a concrete behavioral contract backed by code. When studying an agent harness, start with the vocabulary it invents for itself; Hermes has the richest lexicon of the group.
-
Hermes’s design choices cohere around a single persona—always-on multi-platform gateway + pluggable memory backends + ShareGPT RL export + cross-framework skill taps + a 9,400-line monolith. Any single item on that list looks debatable in isolation; taken together, they form a coherent portrait of a heavy-duty personal agent built by AI researchers for their own daily use.
-
Hermes is a capability encyclopedia rather than a minimalist template—it shows little architectural restraint (massive monolith, no dependency injection, lenient argument coercion), yet packs the highest density of original mechanisms. If you want to see how far a specific sub-capability of an agent harness can be pushed, Hermes usually represents the upper bound.
On Self-Evolution (from Part II):
-
In Hermes, “self-evolution” is a precise engineering term—meaning offline reflective optimization of Hermes’s own text/code artifacts via GEPA, not vague “self-learning.” Its four target tiers, five-part constraint gate, and PR-only deployment rule each carry exact specifications.
-
It grows naturally out of existing Hermes plumbing—
trajectory.py,SessionDB,batch_runner.py, plain-textskills/, and git history happened to supply nearly all the prerequisites an evolutionary loop needs. Once GEPA appeared, stringing those pieces together took relatively little glue code. -
Its risk-containment architecture is worth studying on its own—“benchmarks as gates rather than fitness functions,” “semantic preservation checks against drift,” “PR-only, never direct commit,” and “license-isolated external CLI + 100% test gate for code mutation” directly address how to let an optimizer rewrite parts of an agent without losing control. Even where code hasn’t caught up yet, the conceptual taxonomy is valuable.
-
A wide gap separates
PLAN.mdfrom current code—780+ lines ofPLAN.mdlay out a five-phase automated pipeline, while the repo today is an early Phase 1 prototype:- Phases 2–5 are four directories containing empty 1-line
__init__.pyfiles - Active fitness scoring uses a keyword-overlap heuristic rather than
LLMJudge - Benchmark gates, automated PR creation, and semantic preservation checks do not exist in code
- GEPA is wrapped in a
try/exceptfallback to MIPROv2 - The repo has 7 commits total, with recent work focused on session data importers
That gap doesn’t make
PLAN.mdvaporware—PLAN.mdis a roadmap and the repo is an MVP. Still, readingPLAN.mdas if it were already running in production is a trap; separating design roadmap from runnable code is basic due diligence. - Phases 2–5 are four directories containing empty 1-line
Appendix: Primary Source Index
A. Hermes Main Repository (hermes-agent)
Official Documentation
website/docs/user-guide/features/skills.md— Skills system; origin of the “procedural memory” framingwebsite/docs/user-guide/features/memory.md— Dual-file memory and origin of the “frozen snapshot” patternwebsite/docs/user-guide/features/personality.md— Design rationale behindSOUL.mdwebsite/docs/user-guide/features/delegation.md— “Subagents Know Nothing” warning and contractwebsite/docs/user-guide/checkpoints-and-rollback.md— Shadow Git Checkpoint systemwebsite/docs/user-guide/features/overview.md— High-level capability tourwebsite/docs/developer-guide/architecture.md— Layered architecture overviewwebsite/docs/reference/tools-reference.md— Reference for 48 built-in tools
Source Code Anchors
run_agent.py:472-9223—AIAgentclassrun_agent.py:167-252—IterationBudgetrun_agent.py:213-231— Three-tier tool concurrency setsrun_agent.py:1029, 1038, 1129, 1132— Nudge cadence constantsrun_agent.py:2638-2797— 10+ block system prompt assemblyrun_agent.py:2704-2712— Model-family-specific prompt branchesrun_agent.py:4860-4981, 4954-4967— Five-hop fallback chain + synced compressor thresholdrun_agent.py:5733—flush_memories()run_agent.py:9156-9176— Background nudge spawn (runtime skill creation)agent/prompt_builder.py:36-74, 49-52, 330-332— Input Guardrail regex rulesagent/subdirectory_hints.py:48-219—SubdirectoryHintTrackeragent/context_compressor.py:287-349— 7-section compression summary templateagent/context_compressor.py:412-470— Orphan tool result stub injectionagent/context_compressor.py:565-696— 5-phase context compression pipelineagent/retry_utils.py:19-57— Jittered backoff utilitiesagent/trajectory.py— Trajectory format (input to GEPA)agent/redact.py— 50+ API key redaction patternstools/memory_tool.py:60-76, 111, 198+— Memory threat regexes + hard character caps + three memory toolstools/skills_tool.py:640, 719, 787— Three-tier progressive skill disclosuretools/skills_guard.py:82-484— 120+ skill upload threat regexesmodel_tools.py:372-456—coerce_tool_argsbatch_runner.py— Parallel evaluation runner intended for reuse by self-evolutionhermes_state.py—SessionDB(mined for evaluation sets)skills/— Optimization target directory (hundreds ofSKILL.mdfiles)gateway/platforms/base.py:470-632—BasePlatformAdaptergateway/platforms/*.py— 17 platform adaptersgateway/session.py:73-150, 202—SessionSource+build_session_context_promptgateway/pairing.py— DM pairing cross-channel identity binding
B. Standalone Self-Evolution Repository (hermes-agent-self-evolution)
Documentation
README.md(85 lines) — Public overview and core claimsPLAN.md(782 lines) — Full architecture, motivations, five-phase breakdown, constraints, and timelinereports/phase1_validation_report.pdf(14.5 KB) — Sole published Phase 1 validation artifact
Code That Actually Exists (Phase 1 Implementation)
evolution/skills/evolve_skill.py(323 lines) — Phase 1 CLI entrypoint;evolve()spans lines 36–293evolution/skills/skill_module.py(123 lines) — WrapsSKILL.mdas a DSPyModuleevolution/core/config.py(72 lines) — Configuration defaultsevolution/core/constraints.py(174 lines) — Constraint gate implementation (four checks invalidate_all(), lines 30–53)evolution/core/dataset_builder.py(201 lines) — Evaluation dataset builderevolution/core/external_importers.py(785 lines) — Three-source session importer (Claude Code / Copilot / Hermes)evolution/core/fitness.py(146 lines) — ContainsLLMJudge(unwired) andskill_fitness_metric()(active keyword-overlap heuristic)tests/core/test_constraints.py(98 lines)tests/skills/test_skill_module.py(92 lines)
Files Claimed in PLAN.md That Do Not Exist in Code
- ⛔
evolution/core/benchmark_gate.py— Benchmark regression gate (listed atPLAN.md:151, absent from repo) - ⛔
evolution/core/pr_builder.py— Automated PR builder (described atPLAN.md:705-721, absent from repo) - ⛔
evolution/tools/*— Phase 2 tool description optimizer (empty directory) - ⛔
evolution/prompts/*— Phase 3 system prompt section optimizer (empty directory) - ⛔
evolution/code/*— Phase 4 tool code optimizer (empty directory) - ⛔
evolution/monitor/*— Phase 5 continuous loop monitor (empty directory)
C. External References
- DSPy (MIT) — Stanford’s programming—not prompting—framework
- GEPA (MIT) — Reflective prompt evolution algorithm, ICLR 2026 Oral
- Darwinian Evolver (AGPL v3) — Code evolution framework
- agentskills.io — Open specification for portable agent skills