cd ../blog
5 min read

Borrowing From Hermes Agent: Six Self-Improvement Patterns for AI Coding Agents

Revised October 2026 to focus on the patterns rather than the specifics of our own setup.

NousResearch shipped Hermes Agent, an open-source AI agent with persistent memory, auto-generated skills and a closed learning loop. I read the architecture, compared it with the multi-agent coding setup we already run, and borrowed six patterns. Each was small enough to build in an afternoon. This post is about the patterns, why they help, and what surprised me.

The starting point

We already had the bones of a self-improving system: several coding agents working in parallel, a shared set of written policies, persistent memory notes, a failure journal, and a routine that turns recent mistakes into rules. What we did not have:

  • A real search index over past work. We were grepping text files.
  • A user model built from observation, separate from static configuration.
  • Skills learned from successes. We only learned from failures.
  • Structured records of each task, for auditing or future fine-tuning.
  • A way to run long parallel jobs without flooding an agent’s context.
  • A digest, so a human could ask “what happened this week” without reading every log.

Hermes covers all six.

The six patterns

1. Full-text recall over everything the agents wrote

A small SQLite database with FTS5 indexes covers session notes, known gotchas, the failure journal and learnings. It reindexes before each search, so results are always current, and it returns ranked snippets in a few milliseconds. This one tool replaced most of the ad-hoc text searching the agents had been doing, and it made “has this failed before?” a question an agent actually asks.

2. A daily digest written by a local model

The same index feeds a summarizer. It packs recent activity into a token budget and asks a locally hosted model for a structured digest: themes, decisions made, blockers, new rules, and anything that deserves a human’s attention. The first run named patterns I had half-noticed but never put words to, such as one deploy problem showing up independently in three agents’ notes.

3. A user model built by observation

This is the closest copy of Hermes. Instead of a fixed settings file, the agents append short observations about how the person they work for actually decides things, to a journal. Periodically a model reads the journal, groups entries that describe the same underlying pattern, and promotes each group into one consolidated line in a structured profile. Then it removes the raw entries.

Hermes calls this dialectic memory: a working hypothesis, updated by evidence and consolidated over time. That framing produces a different file shape (a journal at the bottom, curated sections above it) and a much more useful one than a list of preferences.

4. Skills drafted from successful work

Our end-of-task retrospective already wrote a learning note. We extended it so that a successful task can propose a draft skill, a short instruction file that a future agent loads when the situation fits. A human reviews each draft before it goes live.

This is where the most important lesson came from: the first auto-drafted skills described how to build the tool, not how to use it. One draft opened with “Step 1: chunk the markdown files by heading”, which is useless to a future agent because that work is already done. One paragraph added to the prompt fixed it:

The task that just completed produced artifacts. The skill teaches future agents how to USE the artifacts that already exist. Phrase every step as “invoke X with these arguments”, not “build X like this”.

After that change the same task produced a draft that said when to reach for the tool and how to call it. That is the whole difference between a generated skill that helps and one that wastes context.

5. A trajectory record for every task

Every retrospective now also writes one structured record: the task, what worked, what failed, the rule learned, and a rating. An exporter turns the records into a fine-tuning-shaped message set, a CSV for review, and summary statistics. At our scale this is audit data more than training data, but if we ever want to tune a small model on how the work actually gets done, the data is already in shape.

6. Fire-and-forget batch work

The smallest piece, and the one I expected to use most. Long parallel jobs, like building several release bundles at once, run as background processes that write their own logs and exit codes. The agent gets back a directory path immediately and reads the results only when they are ready. Without this, every line of output from a ten-minute job lands in the agent’s conversation and crowds out the work it is actually doing.

What it cost

Roughly two hours of one agent’s time, mostly a frontier model for the code and a local model for the generated content. No new infrastructure: everything runs on the hardware and storage that were already there.

What surprised me

The plainest tool was the most overdue. The agents had been spawning helper agents for parallel work for weeks, and each one still flooded the parent’s context with its results. A background process that writes to a log file was the obvious answer the whole time.

Prompt framing mattered more than model choice. The build-versus-use fix in the skill drafter was one paragraph. It improved the output more than swapping models would have.

“Dialectic” is the right word for a user model. Treating it as a hypothesis that evidence keeps revising, instead of a settings page, changes what you store and how you maintain it.

Related reading: Self-Hosted LLMs in Production: What It Actually Takes to Cut API Costs

If your team is working on multi-agent development, agent memory or local-model pipelines, I take on consulting work in this space. Services and pricing are here, or email developer@griswoldlabs.com with a one-paragraph description.

Newsletter

Enjoyed this post?

Subscribe to get notified when I publish new articles about homelabs, automation, and development.

// no spam, unsubscribe anytime. ~2-4 emails / month

Keep reading