Figure 1: Hermes Agent architectural lifecycle. Unlike stateless LLM agents that reset between turns, Hermes continuously persists state across three memory tiers, updates structured skill definitions, and indexes conversation trajectories via SQLite FTS5.
The Stateless Limitation of Contemporary Agents
Most agent frameworks (e.g., standard ReAct loops or chat-based CLI wrappers) operate under an episodic execution model: when a process terminates, the context window evaporates. Re-establishing project context, developer preferences, and tool idiosyncrasies requires manual re-prompting or bloated system prompt injection.
Hermes Agent, developed by Nous Research, addresses this limitation through an autonomous closed learning loop. The agent inspects its own execution trajectories, updates curated persistent memory buffers, discovers and compiles reusable skills, and indexes conversation turns into an embedded full-text search database.
Architectural Comparison
| Capability | Standard Stateless Agent | AutoGPT / LangChain Agent | Hermes Agent |
|---|---|---|---|
| Session State | Process-bound (Lost on exit) | Vector DB Chunking | Dual-Tier Markdown + SQLite FTS5 |
| Skill Synthesis | Static / Pre-configured | Script Generation | Progressive Disclosure (agentskills.io) |
| Execution Sandboxes | Local Host Only | Local Subprocess / Docker | 6 Backends (Local, Docker, SSH, Modal, Daytona, Singularity) |
| Memory Access Overhead | N/A | High (Embedding + Vector Search) | Zero-Latency Prompt Injection + 20ms FTS5 |
| Tool Protocol | Custom JSON Schemas | OpenAI Function Calling | Dynamic Tool Registry + MCP Client |
System Architecture
Figure 2: Hermes Agent runtime stack. The AIAgent core resolves provider endpoints, compiles structured system prompts, and delegates tool execution to isolated backends or MCP servers while writing state updates to SQLite and Markdown stores.
Core Mechanisms & Mathematical Formulation
1. Three-Tier Hierarchical Prompt Assembly
To maximize KV-cache reuse with providers supporting prefix caching (e.g., Anthropic Prompt Caching), Hermes splits system instructions into static and dynamic partitions:
- (Cached Prefix): Agent identity (
SOUL.md), active tool JSON schemas, and Level-0 skill catalogs (). - (Semi-Static): Workspace context files (e.g., repository trees,
README.md). - (Dynamic): Formatted
MEMORY.md(),USER.md(), dynamic time, and current session metadata.
2. The Post-Turn Learning Loop
At the conclusion of each interaction turn , a background evaluation phase triggers:
3. Progressive Skill Disclosure
Skills adhere to the agentskills.io standard and load on-demand across three levels:
Level 0: skills_list() --> Metadata Header (name, description, tags) [~50 tokens/skill]
Level 1: skill_view(name) --> Full SKILL.md Instructions & Workflows [~500–2,000 tokens]
Level 2: skill_view(name, path) --> Supporting Scripts & Reference Files [On-Demand]
Installation & Deployment
Quick Install
# Linux / macOS / WSL2
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
source ~/.bashrc
# Native Windows (PowerShell)
iex (irm https://hermes-agent.nousresearch.com/install.ps1)
Verify the environment:
hermes doctor
hermes --version
Configuration (~/.hermes/config.yaml)
# Model Provider Routing
providers:
openrouter:
api_key: ${OPENROUTER_API_KEY}
api_mode: openai
default_model: anthropic/claude-sonnet-4-6
anthropic:
api_key: ${ANTHROPIC_API_KEY}
api_mode: anthropic
prompt_caching: true
# Terminal Execution Sandbox
terminal:
backend: docker # local | docker | ssh | modal | daytona | singularity
timeout: 180
docker:
image: "nikolaik/python-nodejs:python3.11-nodejs20"
network: "bridge" # none | bridge | host
gpu: false
# Memory System & Approval Gates
memory:
memory_char_limit: 2200
user_char_limit: 1375
write_approval: false # Set true to enforce manual confirmation before saves
# MCP Server Definitions
mcp_servers:
filesystem:
command: "npx"
args: ["-y", "@modelcontextprotocol/server-filesystem", "/workspace"]
github:
command: "npx"
args: ["-y", "@modelcontextprotocol/server-github"]
env:
GITHUB_TOKEN: ${GITHUB_TOKEN}Implementing Custom Skills
Create a structured skill directory inside ~/.hermes/skills/:
---
name: k8s-deploy
description: Validate, deploy, and inspect Kubernetes resources using kubectl and Helm
version: 1.0.0
platforms: [linux, macos]
metadata:
hermes:
tags: [kubernetes, helm, devops]
category: devops
requires_toolsets: [terminal]
---
# Kubernetes Deployment Workflow
## Deployment Procedure
1. Verify cluster connectivity:
```bash
kubectl cluster-info- Lint Helm charts before installation:
helm lint ./chart/ -f values.yaml - Execute atomic deployment:
helm upgrade --install <release-name> ./chart/ --namespace <namespace> --atomic --timeout 5m
Rollback Protocol
If deployment fails, verify pod health and revert:
kubectl get pods -n <namespace> --field-selector status.phase!=Running
helm rollback <release-name> 0 --namespace <namespace>
---
## Subagent Delegation & Batch Trajectory Generation
### Parallel Workstream Execution via RPC
```python title="examples/subagent_delegate.py"
from __future__ import annotations
import json
from hermes.tools import delegate
def execute_parallel_audit() -> dict[str, str]:
# Spawn isolated subagents with independent context budgets
task_test = delegate(
action="spawn",
prompt="Execute pytest test suite in isolated container and report traceback",
toolsets=["terminal"],
backend="docker",
timeout=300,
)
task_security = delegate(
action="spawn",
prompt="Run bandit and safety audit across all repository dependencies",
toolsets=["terminal"],
backend="docker",
timeout=180,
)
return {
"tests": task_test["output"],
"security": task_security["output"],
}Research Trajectory Export
Hermes supports emitting structured ShareGPT / JSONL interaction trajectories for post-training and imitation learning:
python -m hermes.batch_runner \
--input prompts/benchmark_tasks.jsonl \
--output trajectories/sharegpt_v1.jsonl \
--model anthropic/claude-sonnet-4-6 \
--max-parallel 8Production Security & Sandboxing Matrix
| Deployment Profile | Target Environment | Sandbox Backend | Network Policy | File Access |
|---|---|---|---|---|
| Local Dev | Workstation | local | Host Access | Full Filesystem |
| CI / Multi-User | Shared Server | docker | Isolated Bridge | Mounted Directory Only |
| Serverless Evals | Cloud Infrastructure | modal / daytona | Ephemeral Egress | Read-Only Root + /tmp |
| High Security | Untrusted Webhooks | docker | none (Offline) | Ephemeral Scratch Memory |
Troubleshooting Common Issues
1. Memory Buffer Saturation
- Symptom: Agent logs
MemoryLimitExceededduring turn evaluation. - Resolution: Adjust
memory_char_limitinconfig.yamlor invoke/memory pendingto prune obsolete facts.
2. FTS5 Index Desynchronization
- Symptom:
session_searchfails to recall past conversations. - Resolution: Rebuild the SQLite full-text index via
hermes doctor --reindex.
3. Docker Socket Permission Denied
- Symptom: Tool execution fails with
PermissionDenied: /var/run/docker.sock. - Resolution: Ensure the active user is in the
dockeruser group (sudo usermod -aG docker $USER) and reload the shell.
Subscribe to Unlock the Rest
This section is exclusive to active subscribers. Support our work and unlock this article immediately.
Unlock this post and get unlimited access to all premium articles.
References
- Nous Research. (2025–2026). Hermes Agent Official Repository. GitHub.
- Anthropic. (2024). Prompt Caching: Accelerating Developer Workflows. Anthropic Engineering Blog.
- Model Context Protocol Authors. (2024–2026). Model Context Protocol Specification. modelcontextprotocol.io.
- AgentSkills Standard. (2025). Open Specification for AI Agent Toolkits. agentskills.io.