<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Hermes on Jamie&#39;s Blog</title>
    <link>http://akjamie.github.io/tags/hermes/</link>
    <description>Recent content in Hermes on Jamie&#39;s Blog</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 29 May 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="http://akjamie.github.io/tags/hermes/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>The Self-Improvement Agent in Hermes: A Deep Dive</title>
      <link>http://akjamie.github.io/post/2026-05-29-self-improvement-agent-deep-dive/</link>
      <pubDate>Fri, 29 May 2026 00:00:00 +0000</pubDate>
      <guid>http://akjamie.github.io/post/2026-05-29-self-improvement-agent-deep-dive/</guid>
      <description>&lt;h1 id=&#34;the-self-improvement-agent-in-hermes-a-deep-dive&#34;&gt;The Self-Improvement Agent in Hermes: A Deep Dive&lt;/h1&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Staff-engineer-level notes on Hermes Agent&amp;rsquo;s procedural self-improvement&#xA;loop: how the runtime turns solved problems, user corrections, and hard-won&#xA;debugging paths into durable skills without interrupting the foreground task.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;hr&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;[!NOTE]&lt;/p&gt;&#xA;&lt;h3 id=&#34;executive-tldr&#34;&gt;Executive TL;DR&lt;/h3&gt;&#xA;&lt;p&gt;Hermes self-improvement is not a magic &lt;code&gt;auto_create_skill()&lt;/code&gt; function. It is a&#xA;runtime pattern composed from five pieces:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Foreground guidance:&lt;/strong&gt; the main agent is told to save or patch skills when&#xA;a complex workflow succeeds.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Iteration counters:&lt;/strong&gt; the runtime tracks how much tool-heavy work has&#xA;happened since the last skill review.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Background review fork:&lt;/strong&gt; after the user-visible answer is delivered,&#xA;Hermes starts a quiet review agent with the conversation transcript.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Narrow tool whitelist:&lt;/strong&gt; the review fork may call only memory and skill&#xA;tools, not arbitrary shell, web, or browser tools.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Procedural memory tool:&lt;/strong&gt; &lt;code&gt;skill_manage&lt;/code&gt; writes, patches, deletes, and&#xA;annotates skills under Hermes&amp;rsquo; skill library.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The architecture matters more than the prompt. The learning loop is isolated&#xA;from the foreground answer, bounded by tool permissions, marked with&#xA;provenance, and implemented through the same skill API the main agent can use.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Exception Handling for LLM Calls in Production Agentic Systems</title>
      <link>http://akjamie.github.io/post/2026-05-27-llm-exception-handling-deep-dive/</link>
      <pubDate>Wed, 27 May 2026 00:00:00 +0000</pubDate>
      <guid>http://akjamie.github.io/post/2026-05-27-llm-exception-handling-deep-dive/</guid>
      <description>&lt;h1 id=&#34;exception-handling-for-llm-calls-in-production-agentic-systems&#34;&gt;Exception Handling for LLM Calls in Production Agentic Systems&lt;/h1&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;A deep dive into &lt;code&gt;agent/auxiliary_client.py&lt;/code&gt; from Hermes Agent.&#xA;Written for engineers building production agentic applications who need&#xA;to go beyond &amp;ldquo;catch Exception and retry.&amp;rdquo;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;why-llm-exception-handling-is-different&#34;&gt;Why LLM Exception Handling Is Different&lt;/h2&gt;&#xA;&lt;p&gt;Most backend services talk to one upstream. When it fails, you retry or return an error.&lt;/p&gt;&#xA;&lt;p&gt;LLM-backed agents are different in three ways that make naive exception handling dangerous:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;The call is expensive.&lt;/strong&gt; A failed LLM call that retried five times against a dead endpoint burned five API round-trips, five timeouts, and potentially five billing events — before the user saw anything.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Designing Context Compression for Production Agents: A Deep Dive into Hermes</title>
      <link>http://akjamie.github.io/post/2026-05-24-context-compressor-deep-dive/</link>
      <pubDate>Sun, 24 May 2026 00:00:00 +0000</pubDate>
      <guid>http://akjamie.github.io/post/2026-05-24-context-compressor-deep-dive/</guid>
      <description>&lt;h1 id=&#34;designing-context-compression-for-production-agents-a-deep-dive-into-hermes&#34;&gt;Designing Context Compression for Production Agents: A Deep Dive into Hermes&lt;/h1&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Staff-engineer-level notes on &lt;code&gt;agent/context_compressor.py&lt;/code&gt;: how Hermes&#xA;preserves task continuity when a long-running agent outgrows the model context&#xA;window, and what the implementation teaches about summarization, compression,&#xA;and failure-tolerant agent design.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;hr&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;[!NOTE]&lt;/p&gt;&#xA;&lt;h3 id=&#34;executive-tldr&#34;&gt;Executive TL;DR&lt;/h3&gt;&#xA;&lt;p&gt;Hermes context compression is not &amp;ldquo;summarize the chat when it gets long.&amp;rdquo; It is&#xA;a transcript rewrite algorithm with strict invariants:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Head / middle / tail partitioning:&lt;/strong&gt; keep the system prompt and first turns&#xA;intact, summarize the middle, and protect the recent tail by token budget.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Active task anchoring:&lt;/strong&gt; the latest user message must stay outside the&#xA;summary. A summarized &amp;ldquo;pending ask&amp;rdquo; is reference material, not a live user&#xA;turn.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Tool-aware compaction:&lt;/strong&gt; old tool outputs are deduplicated, summarized, and&#xA;pruned before any LLM call; tool call/result pairs are sanitized afterward so&#xA;providers never receive invalid message history.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Iterative summaries:&lt;/strong&gt; second and later compactions update the existing&#xA;handoff instead of recursively summarizing summaries as ordinary turns.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Multimodal budgeting:&lt;/strong&gt; images are charged a fixed token estimate so image&#xA;sessions do not accidentally preserve far more context than the model can fit.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Failure visibility:&lt;/strong&gt; if the summary model fails, Hermes inserts an explicit&#xA;fallback marker and records dropped-turn metadata instead of silently losing&#xA;context.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;how-to-use-this-deep-dive&#34;&gt;How to Use This Deep Dive&lt;/h2&gt;&#xA;&lt;p&gt;Read this document in four passes:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Hermes Agent — Deep Dive Learning Notes</title>
      <link>http://akjamie.github.io/post/2026-05-21-hermes-agent-deep-dive/</link>
      <pubDate>Thu, 21 May 2026 00:00:00 +0000</pubDate>
      <guid>http://akjamie.github.io/post/2026-05-21-hermes-agent-deep-dive/</guid>
      <description>&lt;h1 id=&#34;hermes-agent--deep-dive-learning-notes&#34;&gt;Hermes Agent — Deep Dive Learning Notes&lt;/h1&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Staff-engineer-level notes for senior AI engineers designing and implementing production agents.&#xA;Written after reading &lt;code&gt;run_agent.py&lt;/code&gt;, &lt;code&gt;model_tools.py&lt;/code&gt;, &lt;code&gt;toolsets.py&lt;/code&gt;, &lt;code&gt;agent/&lt;/code&gt;, and &lt;code&gt;tools/&lt;/code&gt; in full.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;1-high-level-architecture&#34;&gt;1. High-Level Architecture&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;┌─────────────────────────────────────────────────────────────────────┐&#xD;&#xA;│                         Entry Points                                │&#xD;&#xA;│  cli.py (HermesCLI)  │  gateway/run.py  │  batch_runner.py         │&#xD;&#xA;│  tui_gateway/server  │  acp_adapter/    │  run_agent.py __main__    │&#xD;&#xA;└──────────────────────┬──────────────────────────────────────────────┘&#xD;&#xA;                       │&#xD;&#xA;                       ▼&#xD;&#xA;┌─────────────────────────────────────────────────────────────────────┐&#xD;&#xA;│                      AIAgent  (run_agent.py)                        │&#xD;&#xA;│  ┌──────────────┐  ┌──────────────┐  ┌──────────────────────────┐  │&#xD;&#xA;│  │ Conversation │  │  Tool Loop   │  │  Provider / Transport    │  │&#xD;&#xA;│  │   History    │  │  Orchestrator│  │  (Anthropic / OpenAI /   │  │&#xD;&#xA;│  │  (messages)  │  │              │  │   Bedrock / Codex / ACP) │  │&#xD;&#xA;│  └──────────────┘  └──────────────┘  └──────────────────────────┘  │&#xD;&#xA;│  ┌──────────────┐  ┌──────────────┐  ┌──────────────────────────┐  │&#xD;&#xA;│  │  ContextComp │  │  MemoryMgr   │  │  CredentialPool          │  │&#xD;&#xA;│  │  -ressor     │  │  (builtin +  │  │  (multi-key failover)    │  │&#xD;&#xA;│  │              │  │   plugins)   │  │                          │  │&#xD;&#xA;│  └──────────────┘  └──────────────┘  └──────────────────────────┘  │&#xD;&#xA;└──────────────────────┬──────────────────────────────────────────────┘&#xD;&#xA;                       │&#xD;&#xA;                       ▼&#xD;&#xA;┌─────────────────────────────────────────────────────────────────────┐&#xD;&#xA;│                    model_tools.py                                   │&#xD;&#xA;│  get_tool_definitions()  │  handle_function_call()                  │&#xD;&#xA;│  _run_async()            │  _should_parallelize_tool_batch()        │&#xD;&#xA;└──────────────────────┬──────────────────────────────────────────────┘&#xD;&#xA;                       │&#xD;&#xA;                       ▼&#xD;&#xA;┌─────────────────────────────────────────────────────────────────────┐&#xD;&#xA;│                    tools/registry.py  (singleton)                   │&#xD;&#xA;│  ToolRegistry.register()  │  .dispatch()  │  .get_definitions()     │&#xD;&#xA;└──────────────────────┬──────────────────────────────────────────────┘&#xD;&#xA;                       │&#xD;&#xA;          ┌────────────┴────────────┐&#xD;&#xA;          ▼                         ▼&#xD;&#xA;┌──────────────────┐     ┌──────────────────────────────────────────┐&#xD;&#xA;│  tools/*.py      │     │  plugins/&amp;lt;name&amp;gt;/__init__.py              │&#xD;&#xA;│  (built-in tools)│     │  (user / pip-installed plugins)          │&#xD;&#xA;└──────────────────┘     └──────────────────────────────────────────┘&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Key insight:&lt;/strong&gt; The architecture is a strict layered DAG. &lt;code&gt;tools/registry.py&lt;/code&gt; has zero imports from any other Hermes module — it is the root. Every tool file imports from it. &lt;code&gt;model_tools.py&lt;/code&gt; imports from the registry and triggers discovery. &lt;code&gt;run_agent.py&lt;/code&gt; imports from &lt;code&gt;model_tools.py&lt;/code&gt;. This prevents circular imports and makes the tool system independently testable.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Building a Multi-Platform Agentic Gateway: A Deep Dive into Hermes Gateway</title>
      <link>http://akjamie.github.io/post/2026-05-19-gateway-deep-dive/</link>
      <pubDate>Tue, 19 May 2026 00:00:00 +0000</pubDate>
      <guid>http://akjamie.github.io/post/2026-05-19-gateway-deep-dive/</guid>
      <description>&lt;h1 id=&#34;building-a-multi-platform-agentic-gateway-a-deep-dive-into-hermes-gateway&#34;&gt;Building a Multi-Platform Agentic Gateway: A Deep Dive into Hermes Gateway&lt;/h1&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;em&gt;A Staff-Engineer-level study of the Hermes Agent messaging gateway — from process lifecycle to platform adapters, session management to streaming delivery, and the design patterns that make it production-grade across 15+ messaging platforms.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;hr&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;[!NOTE]&lt;/p&gt;&#xA;&lt;h3 id=&#34;executive-tldr&#34;&gt;Executive TL;DR&lt;/h3&gt;&#xA;&lt;p&gt;This document is a comprehensive deep dive into the &lt;strong&gt;Hermes Gateway&lt;/strong&gt; — ~75,000+ lines of Python across 50+ modules connecting an AI agent to 15+ messaging platforms (Telegram, Discord, Slack, WhatsApp, Signal, Matrix, and more). Key architectural patterns:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Building Production Agentic CLIs: A Deep Dive into Hermes</title>
      <link>http://akjamie.github.io/post/2026-05-17-hermes-cli-deep-dive/</link>
      <pubDate>Sun, 17 May 2026 00:00:00 +0000</pubDate>
      <guid>http://akjamie.github.io/post/2026-05-17-hermes-cli-deep-dive/</guid>
      <description>&lt;h1 id=&#34;building-production-agentic-clis-a-deep-dive-into-hermes&#34;&gt;Building Production Agentic CLIs: A Deep Dive into Hermes&lt;/h1&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;em&gt;A Staff-Engineer-level study of the Hermes Agent command-line interface — from filesystem layout to REPL internals, model selection to plugin extensibility, and the design patterns that make it production-grade.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;hr&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;[!NOTE]&lt;/p&gt;&#xA;&lt;h3 id=&#34;-executive-tldr&#34;&gt;⚡ Executive TL;DR&lt;/h3&gt;&#xA;&lt;p&gt;This document is a comprehensive, Staff-Engineer level deep dive into the architecture, execution pipeline, and design patterns of the &lt;strong&gt;Hermes Agent CLI&lt;/strong&gt;. If you are building production-grade agentic command-line interfaces, these are your key takeaways:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
