hermes-motif

May 17, 2026 ยท View on GitHub

hermes-motif is a Hermes Agent plugin that watches tool calls as they happen, finds repeated workflows, and proposes them as reusable SKILL.md drafts. It turns live execution traces into evidence-based micro-skills, so new skills come from what the agent actually did instead of what it remembers afterward.

Install

  1. Clone and install the package:

    git clone https://github.com/Saurav0989/hermes-motif
    cd hermes-motif
    pip install -e ".[dev]"
    
  2. Run the offline tests and demo:

    pytest tests/ -v
    python3.11 scripts/run_demo.py
    
  3. Link the plugin into Hermes:

    scripts/install_plugin.sh
    

Demo Output

python3.11 scripts/run_demo.py loads tests/fixtures/traces/web_research_4x.json, runs the full extraction pipeline, and prints an auto-extracted skill draft. The full captured output is in demo-output.md.

---
name: web-search-web-extract
source: auto-extracted
pattern_hash: 59a953968e94
occurrences: 4
tool_sequence:
- web_search
- web_extract
---

The generated steps mark changing arguments as {variable}, for example web_search.query and web_extract.url.

Configuration

plugin/plugin.yaml exposes these options:

  • min_occurrences: minimum repeated occurrences for a motif.
  • min_sequence_length: minimum number of tool calls in a motif.
  • max_sequence_length: maximum number of tool calls in a motif.
  • auto_install: when false, proposals are injected or written for review.

Known Limitation

Hermes bug #12922 means post_tool_call does not trace memory, todo, session_search, clarify, or delegate_task. hermes-motif does not patch Hermes internals; it only analyzes the tool calls emitted through the documented hook.

Why This Matters For Nous Research

Nous Research has invested in agents that improve from experience, but a large part of that improvement loop depends on what an agent can summarize after a task is already over. That is useful, yet it loses evidence: the exact tool ordering, the arguments that changed, the arguments that stayed fixed, and the number of times a workflow actually repeated. hermes-motif keeps that evidence by observing execution traces while work happens. The result is practical subroutine extraction: repeated procedures can be turned into candidate skills because the trace shows that the procedure was used more than once, not because a language model guessed it sounded important. This is especially valuable for Hermes because skills are operational building blocks. A good extracted skill can compress future context, make repeated work more reliable, and give maintainers a concrete artifact to review. It also creates a path toward measurable self-improvement: motif candidates have hashes, occurrence counts, confidence values, and variable parameters, so teams can compare what was proposed with what was accepted or rejected. For research on agent memory, tool use, and skill composition, that turns vague reflection into inspectable data.

Safety

  • No module makes LLM calls.
  • Tests use fixture traces and tmp_path; they do not write to ~/.hermes/.
  • Proposal output is deterministic for the same input trace and session id.