Hermes Agent
View on GitHubSelf-improving open-source AI agent with a closed learning loop, persistent memory, and a multi-platform messaging gateway.
About
Hermes Agent is a Python AI agent framework maintained by Nous Research, the AI lab best known for its work on open-weight models and reinforcement learning infrastructure. The project went public in July 2025 and crossed 126,000 GitHub stars by April 2026, a growth curve driven less by marketing than by a feature set that addresses genuine friction in how agents are deployed and maintained.
The core idea is what the README calls a "closed learning loop." After each conversation turn, a background fork reviews what happened and decides whether to save a new skill, update an existing one, or update the user model. Skills are Markdown files (procedural instructions the agent loads into context when relevant) that accumulate over time, shaped by the specific workflows of the specific user. A curator agent runs on a weekly cycle to grade, consolidate, and prune the skill library. The system is not self-modifying in the deep sense, but it is genuinely self-organizing in a way that most agents are not.
The second notable feature is platform breadth. Hermes runs through a gateway process that simultaneously handles Telegram, Discord, Slack, WhatsApp, Signal, iMessage (via BlueBubbles), WeChat, WeCom, Matrix, Mattermost, and more, totaling nineteen platforms as of v0.12.0. One deployed agent instance is reachable wherever you already communicate. The gateway maintains per-platform session isolation while sharing the underlying agent state, memory, and skills.
Architecture
The core of the codebase is the AIAgent class in run_agent.py (~12,000 lines). This class owns the conversation loop: it calls the configured LLM provider with the current message list and tool schemas, dispatches tool calls through model_tools.py, appends results to the message list, and iterates until the model returns a plain text response or the iteration budget is exhausted. The loop is synchronous and single-threaded; concurrent tool calls within a single turn run via ThreadPoolExecutor.
The tool system is auto-discovered at startup. Each file in tools/ calls registry.register() at import time, building the list of available tool schemas. toolsets.py defines named groups of tools; the agent starts with a configured subset enabled, and hermes tools lets users change it. Six terminal execution backends (environments/) let the agent run code locally, in Docker, over SSH, on Modal's serverless infrastructure, in Daytona, or inside Singularity containers. The backend is a configuration setting, and the agent's interface to all of them is the same set of shell tools.
The gateway layer (gateway/) sits on top of the agent loop. A platform adapter per messaging service handles inbound messages, translates them into the agent's input format, dispatches the agent, and delivers the response back through the platform's APIs. Session state is stored in SQLite via hermes_state.py, which also provides FTS5 full-text search across conversation history. When the agent is configured with Honcho (a separate open-source memory service by Plastic Labs), cross-session user modeling is written and read through Honcho's API rather than local SQLite.
The self-improvement machinery lives in the "review fork." After each conversation turn, the parent process spawns a background fork that re-runs the completed turn through a restricted agent instance, one that has access only to memory and skills tools. The fork reads the parent's session context, evaluates against a rubric, and writes skill files or memory entries as appropriate. The v0.12.0 release substantially revised this fork: it is now class-first (evaluates against an explicit rubric rather than free-form), prefers updating existing skills over creating new ones, and properly inherits the parent's live credentials rather than re-resolving them. The autonomous Curator, also introduced in v0.12.0, applies this same logic to the full skill library on a weekly schedule, grading every skill for usefulness, consolidating related ones, and pruning dead ones, with a report written to logs/curator/.
Start here
The First Contribution tour is the recommended starting point for developers new to this codebase. It covers dev environment setup, the file dependency chain from tools/registry.py through model_tools.py to run_agent.py, how to add a new tool, and how to run the test suite. Get oriented in the architecture before branching into the gateway, memory, or RL training systems.
Start the First Contribution Tour →
Want the origin story, why Nous Research built this and what it's trying to do differently? Read that first.
Tours
Your First Contribution to Hermes Agent
beginnerWhere to put new code in a 70-file Python agent with a learning loop, a messaging gateway, and a self-registering tool system
The Self-Improving Skill System: How Hermes Builds and Refines Its Own Procedures
intermediateHow Hermes discovers, loads, preprocesses, invokes, and tracks its own skills across the full lifecycle
Hermes Memory Architecture: How an Agent Remembers You Across Sessions
advancedHow a fact travels from a conversation into long-term storage and back into a future prompt
The Multi-Platform Gateway: One Agent, Six Chat Platforms, Shared Sessions
intermediateHow a Telegram message and a Discord DM share the same agent state inside Hermes
Context Compression: Keeping Long Conversations Inside Token Budgets
intermediateHow Hermes detects context pressure, summarizes the middle of a conversation, and hands off to itself without losing the thread
Provider-Agnostic LLM Adapters: One Agent, Eight APIs
intermediateHow Hermes Agent normalizes OpenAI, Anthropic, Bedrock, Gemini, Codex Responses, and custom endpoints behind a single call interface
Maintainers
is the founder of Nous Research and the project's primary author with 3,743 contributions as of April 2026. He is known in the open-weight model community for creating the Hermes series of fine-tuned models (hence this project's name) and the OpenHermes and Nous-Hermes datasets. He co-led the React/Ink TUI rewrite in v0.11.0 alongside OutThisLife.
is the second-largest contributor at 600 commits. He led the Ink-based TUI rewrite shipped in v0.11.0 (a full React/Node.js terminal UI with Python JSON-RPC backend) and continues driving TUI improvements, including lazy init performance work that cut cold-start time by ~57% in v0.12.0.
is a NousResearch engineer with 145 commits. He led the pluggable transport architecture in v0.11.0 (agent/transports/) that extracted provider-specific format conversion into an ABC, which added native AWS Bedrock support. He is also the primary author of several major skill integrations, including TouchDesigner-MCP and the Vercel Sandbox backend.
has 197 commits and is the primary author of the native MCP client implementation (both stdio and HTTP transports) shipped in v0.2.0, plus the loop-detection logic that prevents the agent from re-reading files it has already searched after context compression.
has 55 commits and wrote the initial Honcho memory integration. Honcho is Plastic Labs' open-source dialectic user modeling service; Barrett's work brought it into the gateway session lifecycle and multi-user isolation model.
Origin Story
Hermes Agent: The Agent That AccumulatesHow Nous Research built an AI agent that learns from its own work, and what it took to make that idea hold up in production.
Read the full storyRelated Projects
Create code tours for your project
Intraview lets AI create interactive walkthroughs of any codebase. Install the free VS Code extension and generate your first tour in minutes.
Install Intraview Free