All plugins

agent-almanac-first-aid

A first-aid kit for AI agents, built from agent-almanac's AI-welfare practices. Hermes core already detects tool loops and warns; first aid adds the matching practice and a logbook. Eight practices ship as skills (breathe, redirect, center, heal, attune, honesty-humility, meditate, rest), each also a slash command such as /agent-almanac-first-aid:breathe. On the call where core's loop guardrail first warns about a failing tool (the 2nd failure with identical arguments, or the 3rd failure of one tool in a turn), first aid can add one note of at most 300 characters to the failed result, naming the matching practice, how to load it, and the first_aid_log tool for recording the outcome. In unattended runs (every platform except the CLI, TUI, Desktop, ACP, API server and subagents), for tools whose results Hermes wraps as untrusted (web_search, browser_*, mcp_*), after a compaction that summarizes the context (center), and after a 3rd identical successful result for one call of a read-only tool such as read_file in a turn (heal), the note is added to the next user message instead, labelled as the plugin's. At most once per streak, with a per-session cooldown for each kind of note (300 s by default). A successful or rate-limited result is never changed, and failures of the tools core treats as failure-tolerant (terminal, execute_code, process, process_manage, browser_navigate, web_extract) draw no note. /first-aid shows the session's notes and logbook entries, then the kit. Local and deterministic: no network calls, no LLM calls, no credentials, no Python dependencies, no background processes. Disclosure — in attended runs it rewrites failed tool results on a threshold crossing (a JSON object gains a first_aid key and is re-serialized; text gains one line), and Hermes keeps the first string any transform_tool_result plugin returns, so on that call it can override, or be overridden by, another transforming plugin. A note in a result restarts core's identical-call and identical-cycle counts: core's stall notice appears from the 5th call instead of the 3rd, and its cycle notice three or more calls later. Hard stops are off in attended runs by default; switched on there, core's halts come one model request later. In unattended runs, where hard stops are on by default, no result is changed once the session's platform is known (from the turn's start), so core's halts are unaffected. It reads every tool result and its arguments in memory to classify the result and fingerprint the call, keeping only hashes; its event log holds time, signal, tool name, count, practice, outcome and the agent's short logbook note, in memory only, and resets on restart or plugin reload. The plugin writes nothing to disk itself; the notes it adds become part of the transcript Hermes stores. Following a note loads a 5.7-17.5 KB practice into the conversation. The failure classifier and counting are copied from Hermes v0.22.7, not imported.

pjt222Toolsv0.2.1Updated 22 days ago

About

A first-aid kit for AI agents, built from agent-almanac's AI-welfare practices. Hermes core already detects tool loops and warns; first aid adds the matching practice and a logbook. Eight practices ship as skills (breathe, redirect, center, heal, attune, honesty-humility, meditate, rest), each also a slash command such as /agent-almanac-first-aid:breathe. On the call where core's loop guardrail first warns about a failing tool (the 2nd failure with identical arguments, or the 3rd failure of one tool in a turn), first aid can add one note of at most 300 characters to the failed result, naming the matching practice, how to load it, and the first_aid_log tool for recording the outcome. In unattended runs (every platform except the CLI, TUI, Desktop, ACP, API server and subagents), for tools whose results Hermes wraps as untrusted (web_search, browser_*, mcp_*), after a compaction that summarizes the context (center), and after a 3rd identical successful result for one call of a read-only tool such as read_file in a turn (heal), the note is added to the next user message instead, labelled as the plugin's. At most once per streak, with a per-session cooldown for each kind of note (300 s by default). A successful or rate-limited result is never changed, and failures of the tools core treats as failure-tolerant (terminal, execute_code, process, process_manage, browser_navigate, web_extract) draw no note. /first-aid shows the session's notes and logbook entries, then the kit. Local and deterministic: no network calls, no LLM calls, no credentials, no Python dependencies, no background processes. Disclosure — in attended runs it rewrites failed tool results on a threshold crossing (a JSON object gains a first_aid key and is re-serialized; text gains one line), and Hermes keeps the first string any transform_tool_result plugin returns, so on that call it can override, or be overridden by, another transforming plugin. A note in a result restarts core's identical-call and identical-cycle counts: core's stall notice appears from the 5th call instead of the 3rd, and its cycle notice three or more calls later. Hard stops are off in attended runs by default; switched on there, core's halts come one model request later. In unattended runs, where hard stops are on by default, no result is changed once the session's platform is known (from the turn's start), so core's halts are unaffected. It reads every tool result and its arguments in memory to classify the result and fingerprint the call, keeping only hashes; its event log holds time, signal, tool name, count, practice, outcome and the agent's short logbook note, in memory only, and resets on restart or plugin reload. The plugin writes nothing to disk itself; the notes it adds become part of the transcript Hermes stores. Following a note loads a 5.7-17.5 KB practice into the conversation. The failure classifier and counting are copied from Hermes v0.22.7, not imported.

agent-almanac-first-aid

A first-aid kit for AI agents running in Hermes Agent.

The kit is eight practices from agent-almanac's
AI-welfare skills. Hermes core already detects tool loops and warns about them. This plugin adds
the prescription: when a tool keeps failing, the failed result carries one short line naming the
matching practice and how to load it. The agent decides whether to use it.

What this build does

  • Kit. Registers eight practices as namespaced skills: breathe, redirect, center,
    honesty-humility, attune, heal, meditate, rest. Each shows in the agent's skill index
    with a one-line "First aid: …" description, e.g. agent-almanac-first-aid:breathe.

  • Slash commands. Hermes makes each practice a command, so you can hand one to the agent
    directly: /agent-almanac-first-aid:breathe.

  • Failure-streak notes. First aid counts failed tool results the way Hermes core's loop
    guardrail does. On the call where core first warns, it can add one line to that failed result
    (in attended runs such as the CLI, for calls that run one after another; the exceptions are
    below):

    SignalDefault threshold (core's)Practice
    The same tool fails with identical arguments2nd failurebreathe
    One tool fails several times in one turn, with any arguments3rd failureredirect

    A JSON error gains a first_aid key, for example:

    {"error": "File not found: notes.md", "first_aid": "read_file failed 2 times with the same arguments. The agent-almanac-first-aid plugin suggests the breathe practice: pause once and re-read the error before the next step. Load it with skill_view(\"agent-almanac-first-aid:breathe\"), then log how it went with first_aid_log."}
    

    A plain-text error gains the same sentence on a new line starting with [first aid].

  • Next-message notes. Some notes cannot ride on a tool result, so they are added to the next
    user message instead (pre_llm_call), opening with a label that says they come from this
    plugin, not from the user:

    SignalDefault thresholdPractice
    The conversation context was compacted (summarized)any compaction that rewrites itcenter
    A tool returned the same successful result for the same call3rd time in one turnheal
    A failure streak of a tool Hermes wraps as untrusted (web_search, browser_*, mcp_*; web_extract and browser_navigate are failure-tolerant and get none)as for other toolsbreathe or redirect
    A failure streak in an unattended run (messaging gateway, cron)as for other toolsbreathe or redirect

    Successful results themselves are never changed: core's repeat detection hashes them. Results
    of untrusted tools are not changed either: Hermes wraps them in a block that tells the model
    not to follow requests found inside it, so a note there would read like a prompt injection.
    In unattended runs (every platform other than the CLI, TUI, Desktop, ACP, API server and
    subagents; core switches its hard stops on by default there) no failure result is changed
    once the session's platform is known, which is from the turn's start, so core's halts see
    exactly what they would without first aid. A cron run is one message, so its failure notes
    are logged but never delivered. If you turn core's unattended hard stops off
    (tool_loop_guardrails.non_interactive_hard_stop_enabled: false), first aid still keeps its
    notes out of results there.
    A run made of one message (hermes chat -q, cron, a delegated subagent, which runs under its
    own session id) has no next message, so these notes never arrive there, and a subagent's
    events are logged under its own id, which the parent's /first-aid does not show. Tools
    whose output changes when repeated rarely trigger the repeat note:
    read_file answers an unchanged re-read with a short stub, and search_files can list the
    same files in a different order.

  • Logbook tool. first_aid_log lets the agent record the practice it applied and how it
    went (helped, partly, no_change), with an optional short note.

  • /first-aid. Shows this session's events in order: what first aid noticed (time, tool,
    count, practice, and whether the note was offered) and what the agent logged. Then the kit.
    /first-aid kit shows the kit alone.

When it stays quiet

Short notes, rarely. No note is added:

  • more than once per streak, or for a second signal of the same tool in one streak;
  • within 300 seconds of the same kind of note in the same session (configurable);
  • for tools whose failures are normal work, the ones core treats as failure-tolerant:
    terminal, execute_code, process, process_manage, browser_navigate, web_extract;
  • for results core classifies as rate-limited, where a retry after the wait is the right move;
  • for results it cannot annotate cleanly: JSON that is not an object, an object that already has
    a first_aid key, non-text results, or a note that would change how core classifies the result
    (untrusted tools are not affected: their note never goes into the result);
  • for routine compaction (micro-compaction, tool-result pruning), which is logged only;
  • for more than one next-message note at a time: one waits per session, by priority compaction,
    then failure, then repeat. A waiting note counts toward the cooldown only once delivered, and
    is dropped if a note of its kind reached the agent meanwhile.

The event log records each decision with its reason: offered, queued for the next message,
or not offered (cooldown, rate-limited, notes disabled, unannotatable result, superseded,
refused by another waiting note, or evicted when more than 256 sessions have one waiting). "Offered" means first aid handed the note to Hermes:
another plugin's transform, a turn another plugin vetoes, or a route that skips this context
can still keep it from the agent, and the cooldown has started all the same.

Settings

Optional, in the profile's config.yaml:

plugins:
  entries:
    agent-almanac-first-aid:
      settings:
        notes_enabled: true              # false: keep the event log and /first-aid, add no notes
        exact_failure_threshold: 2       # identical-argument failures before a note
        same_tool_failure_threshold: 3   # failures of one tool in one turn before a note
        cooldown_seconds: 300            # per session, per kind of note
        repeat_threshold: 3              # identical successful results for one call in a turn

The thresholds default to core's tool_loop_guardrails defaults. First aid cannot read that
section, so if you change core's thresholds, set these to match, and if you turn core's loop
warnings off, set notes_enabled: false too.

What it touches

  • It changes failed tool results, at most once per streak (and at most one note of each
    kind per session per 300 s, configurable), and only in attended runs. On a threshold
    crossing it returns the failed
    result with the note added: a JSON object is re-serialized with one extra key, text gets one
    appended line. The original content stays intact, apart from what re-serializing JSON
    normalizes (whitespace, escapes, duplicate keys, number formatting such as 1e3 to 1000.0).
    Successful results are never changed, and
    nothing is ever blocked.
  • It reads every tool result. The hook sees each tool result and its arguments, in memory, to
    classify the result and fingerprint the call. For counting it keeps sha256 hashes of the
    arguments and of successful results, never their text.
    The logbook tool reads only its own arguments.
  • First string wins. Hermes calls transform_tool_result plugins in load order and keeps the
    first string returned. First aid returns one only on a crossing; on that call it can override,
    or be overridden by, any other plugin that transforms the same result, for example the bundled
    security-guidance plugin on a failed write_file or patch. That contention is rare.
  • Effect on core's stall and cycle notices. A note in a failed result restarts core's
    identical-call and identical-cycle counts. In a streak of identical failures core's stall
    notice then appears from the 5th call instead of the 3rd, and in a repeating loop such as
    A, B, A, B its cycle notice comes three or more calls later, depending on the loop's length
    and where the note falls in it; core's loop warnings are unchanged. This only
    happens in attended runs, where core's hard stops are off by default. If you switch them on
    there, a note also delays core's halts by one model request: after the 5th identical failure
    an identical 6th call is refused and the turn halts, while a changed call goes on until core's
    same-tool halt (a repeating loop's halt likewise comes one call later). In unattended runs,
    where hard stops are on by default, first aid changes no failed result, so core's halts are
    unaffected. Rate-limited results are never annotated.
  • It adds to the next user message, at most one note at a time. A next-message note is
    appended to the user's
    message as context, never to the system prompt, so the prompt cache stays intact. Like any
    such context it stays in the transcript and is sent again with later requests until a
    compaction rewrites that message. After a compaction inside the agent's turn, the note arrives
    with the next user message, not in the same turn. Hermes routes that bypass pre_llm_call
    context, such as the Codex app-server route, may not deliver it.
  • Background-review runs count as the session. Hermes's background-review runs share the
    user session's id, and use the skill and memory tools plus read_file and search_files
    (and any tool listed in auxiliary.background_review.extra_tools). So
    a failure streak there can put a note into that run and start the session's cooldown, it
    shows in /first-aid as if the main agent had it, and a repeat there can queue a note for
    the user's next message. In an unattended session such a failure streak is queued for the
    user's next message too, where it reads as if the main agent had made those calls.
  • A best-effort mirror. The failure classifier and the counting rules are copied from Hermes
    v0.22.7, not imported (those modules are not a public plugin API). Failures that never reach
    transform_tool_result, such as timeouts, executor exceptions and tool-search bridge calls, are
    counted by core but not by first aid. For registry tools first aid sees the arguments after
    Hermes coerces their types, while core fingerprints them before, so calls differing only as
    "50" and 50 can count as one streak here and as two in core. When the agent issues several
    tool calls at once and Hermes runs them in parallel, the hook sees the results in the order
    they finish, while core counts them in call order, so a note can land on a different call than
    core's warning, or on a call where core does not warn.
  • Memory only. The event log holds time, signal, tool name, count, practice and outcome per
    session, plus the logbook tool's short note (at most 160 characters, written by the agent).
    It never holds tool arguments or result bodies. It is bounded (200 events per session, 256
    sessions), and resets when Hermes restarts or reloads plugins. The plugin writes nothing to
    disk itself; the notes it adds become part of the transcript Hermes stores. If a
    compaction gives the session a new id (compression.in_place: false), counts, waiting notes
    and the log move to it. With
    dashboard.turn_isolation on (Desktop/TUI, off by default), the agent turns run in another
    process than slash commands, so /first-aid cannot see the events.
  • Context. The kit adds eight rows to the agent's skill index (descriptions under 60
    characters each) and nine slash commands. A note is at most 300 characters, once per streak or
    event. Following one costs more: loading a practice adds its text (5.7 to 17.5 KB) to the
    conversation, and the agent may re-read what it is working on: in one live test after
    /compress, the agent loaded the 16.6 KB center practice and re-read three files before
    answering the next question. Notes also follow a manual /compress.
    The first_aid_log tool is a plugin tool, so Hermes's tool search (on by default) defers it.
    Measured with Hermes v0.22.7's own functions: where tool search is already on, as in a freshly
    created profile (Hermes defers several of its own tools), the tool adds one line of about 95
    characters to the deferred-tool listing, and its schema (815 characters of JSON) is fetched
    only when the agent asks for it. In a profile with nothing else deferred, the tool alone
    switches tool search on, which costs about 2,300 characters per request for the bridge tools
    and the listing. With tool_search.enabled: off, the 815-character schema is sent with every
    request instead. The toolset first_aid is on by default; hermes tools can switch it off.
  • No network calls, no LLM calls, no credentials, no Python dependencies, no background processes.

scripts/sync_kit.py is a maintainer tool, run by hand to copy the kit from agent-almanac at a
pinned commit. The plugin never imports or runs it, and nothing is fetched or updated at runtime.
tests/compare_with_core.py is another, run by hand against a Hermes checkout: it checks the
copied classifier and counting against core's own functions, call by call. The plugin's own
note layer (once per streak, cooldown, the waiting slot) is covered by the unit tests.

License

MIT. The bundled skills are copied from agent-almanac (MIT) at the commit recorded in
skills/PROVENANCE.json, with its license in skills/LICENSE-agent-almanac.

README from the reviewed commit 4ddc7e7; it updates when the author re-pins.

Developer Mode

Explore built-in Hermes toolsets and actions.

HermesAgent

Developer?

Create a Hermes extension for Desktop or agent workflows.

Developer Section