Section Insights
Introduction to Hermes Agent
What makes Hermes Agent special compared to Open Claw?
Hermes Agent is distinguished by its unique architecture that includes a stateless LLM API call, context injection, and a structured approach to memory management. It operates through user messages or cron jobs, maintaining statefulness by injecting session history into LLM calls.
- Hermes Agent has gained popularity with over 210,000 GitHub stars.
- It is designed to push the limits of coding agents.
- The agent's functionality is divided into four zones: triggers, tools, context, and output.
Memory and Skill Management in Hermes
How does Hermes manage memory and skills?
Hermes utilizes two types of memory: short-term and long-term. It reviews memory every 10 user turns and creates new skills based on user interactions. The system forks context for memory and skill reviews, allowing Hermes to adapt and learn from user behavior.
- Memory review is triggered by user interactions, allowing Hermes to adapt to user preferences.
- Skill creation occurs when a user utilizes tools extensively in a single turn.
- Hermes maintains a searchable history for deeper context understanding.
Utilizing Knowledge Bases and Skills
What strategies can be employed to enhance Hermes' functionality?
Users can mine session summaries for valuable insights, create skills from repeated mistakes, and utilize a knowledge base for preferences and workflows. The agent can be configured to use skills as slash commands to avoid context pollution.
- Extracting insights from past sessions can improve agent performance.
- Using skills as slash commands minimizes unnecessary context injection.
- A well-structured knowledge base enhances the agent's understanding and efficiency.
Tool Call Counting and Workflow Optimization
How does Hermes optimize tool usage and workflow?
Hermes counts tool calls during user interactions and forks sessions when a threshold is reached. This allows for the evaluation of whether certain workflows should be saved as long-term skills, preventing the buildup of ineffective skills.
- Tool call counting helps identify valuable workflows for long-term skill development.
- Forking sessions allows for focused evaluation of user interactions.
- Preventing context rot is crucial for maintaining agent efficiency.
Customizing and Controlling Your Agent
How can users take control of their agent's functionality?
Users can create and manage their own knowledge bases, automate cleanup processes, and tailor agent interactions to their specific needs. This empowers users to build tools that suit their workflows rather than relying on generic solutions.
- Users are encouraged to build personalized tools and knowledge bases.
- Custom automation can enhance agent performance and reduce clutter.
- Understanding first principles allows for better customization and control over agent behavior.
Transcript
0:00 Hermes Agent hit 210,000 GitHub stars and is being labeled as the king of personal assistant agents. But, what makes it so special? Is it better than Open Claw? In this video, I'll explain how Hermes Agent works, what separates it from Open Claw, and how you can rebuild the parts that matter with just a few simple commands. I'm Roman. I published a top 3% paper at NeurIPS, the best AI conference in the world. Now, I'm on a mission to push coding agents to their limits. I like to think about agents as being comprised of four zones.
0:34 What triggers the agent to start work, what tools does the agent have at its disposal, what context gets injected into the agent, and where does the agent output its response? And agents all start with one thing, a stateless LLM API call. Stateless meaning that LLMs cannot remember your previous conversations. They are a function that takes input tokens and produces output tokens. So, it all starts with asking, what triggers something like Hermes to start work? Typically, we start with a user message through the Hermes app, Telegram, Discord, or Slack. Another method is through a cron job triggering Hermes. All of these run through an always-on gateway and pass the message into the stateless LLM. Then, we have the outputs. This is basically how the LLM maintains statefulness. Hermes works by injecting the entire SQLite history from a session back into each LLM call.
1:32 Harnesses like Claude use JSONL instead. And next, we have context injection, which is all of the identity that makes Hermes Hermes, as well as memory add-ons. Remember, you can't teach an LLM anything, so you just have to tell it every time. This is the zone that controls that. Typically, it breaks down to tool schemas, message replay, cached prompts, and turn add-ons. Then, we have how Hermes actually interacts on your computer. It does this via tool calls.
2:03 Tool calls are outputs that an LLM can produce which triggers actions on your computer such as running bash, controlling the computer, or web searching. And now that we know what makes Hermes work, what makes it different from Openclaw? The secret sauce is actually in how Hermes learns and improves. Hermes has two background review triggers. One for remembering the user long-term and one for creating and improving its skills. Memory review is turn based, by default every 10 user turns. The second is skill review which allows Hermes to create new skills during conversations. This one triggers when a single turn does 10 or more tool uses. When either of these trigger, it forks the exact context of the agent. If the trigger was for memory review, a review agent decides whether user.md or memory.md should change. These files are capped and give Hermes a baseline understanding of us. But if the trigger was for skill review, here's how it works. When a single user does 10 or more tool uses, the review agent is instead tasked with finding reusable learning anywhere in that forked context, including user corrections, workflow fixes, incorrect skills, etc.
3:18 And specifically, Hermes remembers in two ways. You can think of this similar to short-term memory and long-term memory. So the always-on prompt to understand the user is like the short-term memory, and we just inject that into context. We tell the model about ourselves every turn. And the searchable history that Hermes can decide to query via SQLite FTS5 when it decides it needs to do a more thorough memory search. This is that long-term memory that allows Hermes to decide, "Hey, I'm going going look into the user's history and see when they told me something similar to this and what I know about that based on previous conversations I've had. So, now we can answer the golden question.
4:02 Which one should I use? Hermes or Open Claw? Well, the answer is actually neither because the truth is that both of these agents are over-engineered and result in context rot and pollution from all of the skill and plugin buildup. This comes because they're generalist agents. They're trying to do everything at once and this both distracts the model and results in higher costs. You should build your own agents and workflows that fit your use case and needs instead, specifically in your favorite harness. My favorite harness is Claude Code, so I'll build it in there.
4:35 So, the first mechanism that we're going to clone is how it has long-term memory. So, in Claude Code, what you can do is start by installing a session end hook that summarizes every single session using a Haiku agent or a GPT-5.4 for cheapness. Personally, I've been running this in the background for about 6 months without thinking about it. I have 13,735 summaries written by Claude Haiku and GPT-5.4 side by side. So, you can install this and leave it in the background and you'll have these summaries from what all of your sessions have done in the past. Then in step two, what we can do is mine all of these really valuable sessions for anything like workflows, repeated mistakes, issues, and we can then turn those into skills or put them into a knowledge base. One thing to note is that personally, I don't really like using skills because skills always inject a little bit of context about what the skill is into the agent's active context window. And that's because the agent has to decide when to invoke a skill. So, we have to tell it what skills it can invoke. Instead, I prefer to use skills as slash commands, which means that I disable model invocation, which means that the agent knows nothing about the skill, and instead I induce it as a slash command when I choose. And the other option, of course, which is what I actually do is utilize a knowledge base of all of the preferences I have, all of the workflows, all of the mistakes, and I typically use an embedding model, I use wiki links, I use metadata tagging, and I use sub-agents for agentic rag.
6:18 Then my agent, whenever I decide, can go search from my knowledge base for my preferences and my workflows, and not only understand me a lot better, but do things in repeated ways that have worked before. Then we move on to step three, which I call merging. So, a lot of sessions have the same material. So, we end up extracting the same atomic nuggets over time. So, what I like to do is I like to have parallel sub-agents look through and decide merge candidates.
6:49 The other option for this is that you can use an embedding model and take nuggets that are over 90% similar, and then have an agent decide to merge those. This is basically how you build a very solid knowledge base about yourself that your agent can use at any time. Similar to Hermes, but created by you, maintained by you, and designed by you. This is so much more useful than just having a pre-installed Hermes knowledge base. And the best part of all of this is that you don't have to experience context rot or context poisoning. So, what about the other thing Hermes does, which is tool call counting, such that we can build certain skills for certain workflows? Well, what we can do is the same thing in something like Claude code. You basically take a post tool use hook, you make it such that it counts the number of tool calls in a single turn, and then as soon as that number of tool calls hits 10, we fork the session and spawn a haiku or a sonnet agent with the forked context to say, "Hey, is there any part of this workflow actually worth saving into a long-term skill and understanding how to do later on?" And one little prompting trick here is to basically say, "If there's nothing to save, then don't save it." Cuz we don't want just a bunch of garbage skills built up, which is the problem that Hermes has. So, let me show you how I queried the knowledge base about myself.
8:16 All right. So, first, you can see that the sessions that I've been working on today is 7/10. The sessions I've been working on are right here. They're already summarized for me in the background. And here's an example of how these sessions look. So, basically, talking about a knowledge base demo here. I have a custom slash command for the Obsidian graph, everything like that. Queryable at our fingertips at all times very cheaply. And then as for the always-on learning, you can see in this case, I had a little bit of strategy talk with the agent, and it decided to pull this nugget: Do not grow agent memory by appending it into always-loaded claw.md. That's actually a great little learning nugget. It's not necessarily something I would inject into context, but it's the same thing that Hermes does here, just in my claw code. So, let's jump into claw code.
9:11 And let's see what happens when we run slash with me, which is my slash command for actually querying this memory. And maybe I'll even say, "What is the best solution to determinism over probabilism?" So, that's one of my favorite little things to think about is making sure we have as many deterministic and quick processes as possible instead of just random stuff with the LLMs. And my slash with me command specifically queries the nuggets. It does not query the session summaries.
9:48 But you can see here's a nugget, deterministic first automation before more LLM behavior. So you can see some preferences, some fast slash architecture. And if I wanted to, I could even have a custom sub-agent that I call Hermes within Claude code that on session start runs this command in the background and then injects this memory brief into the agent. With whatever I'm working on specifically, maybe even after my first prompt. And so the best part of this is you're not locked into Hermes. You're not even locked into Claude code. You can just do this however you want because you are the controller of this.
10:28 You've now created the knowledge base. It's based on work you've done. You can clean up the knowledge base manually if you want. You can create automated hooks that clean it up for you overnight with a Claude-p call. When you stop waiting for someone else to build the tools for you and you take inspiration from tools that you like and build them yourself, not only do you learn a lot more as an agentic developer and build skills that will go far beyond the tool. Like what's the next thing after Hermes? Nobody knows. But if you know what you like and you know how to tailor it to your situation instead of them trying to make a one-size-fits-all scenario for you, just learn the first principles and do it yourself. So you can see here, this would have been injected into my agent while I was talking to it about determinism over probabilism. I could create it that way anytime I want. And so many people are obsessed with persistent memory of this sort, but the truth is more context does not equate with better results. After thousands of hours of using this models, I found that and I learned it the hard way. So, if you want to grab the setup that I used for this demo, specifically the hooks, the knowledge base setup, and the {slash} with me {slash} command that you can install into a custom agent, please do not install this into your normal Claude code. It will decrease performance, but you can use this in a custom agent, then you can join my free school community linked down below, where you can also get access to my free Claude code course. I'll see you in there. Thank you for watching.
Summary
- Hermes Agent operates using a stateless LLM API, triggered by user messages or cron jobs.
- It maintains statefulness by injecting session history into each LLM call, unlike Claude which uses JSONL.
- Hermes differentiates itself with two background review triggers: one for long-term memory and another for skill improvement.
- The agent remembers user interactions through short-term and long-term memory mechanisms, allowing it to provide contextually relevant responses.
- Both Hermes and Open Claw are criticized for being over-engineered, leading to context rot; building personalized agents is recommended.
- The video outlines a method for creating a custom knowledge base and skills using Claude Code, emphasizing the importance of managing context effectively.
- Users can implement session summaries and extract valuable insights to enhance their agent's performance without unnecessary context buildup.
- The speaker encourages developers to take control of their agent's design and functionality, advocating for personalized solutions over generic ones.
Questions Answered
What makes Hermes Agent special compared to Open Claw?
Hermes Agent is distinguished by its unique architecture that includes a stateless LLM API call, context injection, and a structured approach to memory management. It operates through user messages or cron jobs, maintaining statefulness by injecting session history into LLM calls.
How does Hermes manage memory and skills?
Hermes utilizes two types of memory: short-term and long-term. It reviews memory every 10 user turns and creates new skills based on user interactions. The system forks context for memory and skill reviews, allowing Hermes to adapt and learn from user behavior.
What strategies can be employed to enhance Hermes' functionality?
Users can mine session summaries for valuable insights, create skills from repeated mistakes, and utilize a knowledge base for preferences and workflows. The agent can be configured to use skills as slash commands to avoid context pollution.
How does Hermes optimize tool usage and workflow?
Hermes counts tool calls during user interactions and forks sessions when a threshold is reached. This allows for the evaluation of whether certain workflows should be saved as long-term skills, preventing the buildup of ineffective skills.
How can users take control of their agent's functionality?
Users can create and manage their own knowledge bases, automate cleanup processes, and tailor agent interactions to their specific needs. This empowers users to build tools that suit their workflows rather than relying on generic solutions.