Hermes Agent Masterclass:架构详解与实战指南 ✍ Akshay🕐 2026-05-14📦 28.0 KB 🟢 已读 𝕏 文章列表 本文是 Hermes Agent 的深度教程。Hermes 是一个能够在使用中不断自我进化的 AI Agent,与 OpenClaw 等其他 Agent 不同,它具备跨会话记忆、自编写/修剪技能以及通过 GEPA 引擎进行离线验证的独特能力。文章详细剖析了其包含 SOUL.md 身份层在内的三层记忆系统,并指导读者如何从零配置运行多个具备独立个性的 Agent。 AI AgentHermesNous ResearchSelf-evolvingGEPAMemory SystemTutorialOpenClawLLM架构 # Hermes Agent Masterclass **作者**: Akshay **日期**: 2026-04-30T18:17:40.000Z **来源**: [https://x.com/akshay_pachaar/status/2054564519280804028](https://x.com/akshay_pachaar/status/2054564519280804028) ---  Everything you need to understand and customize Hermes Agent. Self-evolving skills, three-tier memory, GEPA optimization, and going from 1 to 10 agents that work for you 24/7. Hermes Agent crossed 90,000 GitHub stars in two months. Developers are quietly building personal AI agents that learn their workflow, remember their context, and run 24/7.  Star history tracker Every AI agent you've used has the same problem: it forgets everything the moment your session ends. Your coding preferences, the project conventions you corrected it on three times, the fix it spent 10 minutes figuring out yesterday. All gone. Next session, you start from scratch. Hermes Agent by Nous Research takes a fundamentally different approach. It ships with a learning loop that: - Remembers across sessions - Writes its own reusable skills - Prunes them in the background - And validates them offline through an evolutionary engine called GEPA No other open-source agent combines all three. Not even OpenClaw. This guide covers how this learning loop works, what each memory layer does, and how to configure everything from scratch. By the end, you'll have three fully isolated agents running on your machine: a programmer (who uses your Claude code), a deep researcher, and a designer, each with its own personality, memory, skills, and Telegram bot. Check this out:  The three agents in Telegram The whole setup takes minutes and everything here is reproducible on your own hardware. > Note: All the illustrations in this guide were designed by Pixel, one of the Hermes agents you'll learn to build by the end. Watch for them as you read. Let's get started! # How to Read This Two halves: theory first, hands-on second. Short on time? Skip to Getting Up and Running. The commands work standalone. But the theory pays off. Knowing how skills self-evolve, how memory composes, and when GEPA earns its keep is the difference between using Hermes as a chatbot with notes and using it as something that compounds. What's ahead: - What Hermes Agent Actually Is. The pitch, plus a comparison with OpenClaw. - How It's Built. Architecture in one diagram. - Before Memory: Who Is the Agent? SOUL.md, the identity layer. - The Memory System. Three tiers, three speeds. - Self-Evolving Skills. Agent-authored playbooks plus the Curator. - GEPA. Offline skill optimization. - Getting Up and Running. Install, Telegram, first agent. - Running Multiple Agents. Profiles, three personas, scheduled digests. - Customising the agents as per your needs. # What Hermes is, and what makes it architecturally different The one-line pitch: an agent that gets better the longer you use it. What makes that real is that three usually separate capabilities sit in one framework: runtime skill learning, persistent multi-layer memory, and an optional weight-training pipeline. No other open-source agent ships all three. The closest comparison in the open ecosystem is OpenClaw. Both are persistent, messaging-friendly, but they make opposite architectural choices. A clean framing from the Kilo blog captures it: "Hermes packages a gateway around a learning agent. OpenClaw packages an agent around a messaging gateway."  OpenClaw vs. Hermes # How It's Built Before the learning loop makes sense, you need a basic picture of how Hermes is structured. Everything flows through a single AIAgent class in a run_agent.py script. CLI, messaging gateway, batch runner, IDE integration: they're all entry points into the same core agent. This is what makes the platform-agnostic story actually work.  How Hermes agent is structured The core loop is ReAct-style and synchronous. Build the system prompt, check if compression is needed, make an interruptible API call, execute any tool calls, loop again. A few details that matter later: - The agent can run commands in six different places. Local terminal, Docker, SSH, Modal, Daytona, or Singularity. Same code, just a config change. Move execution from your laptop to a cloud GPU server without touching anything else. - It works with almost any model. A translation layer routes any provider through one of three API formats. That's why you can swap from Claude to GPT to Gemini to local Ollama with one command and nothing breaks. - The agent has a hard cap of 90 turns per task. Without it, an agent stuck in a loop (retrying a failing API, re-reading the same file) would silently burn through your credits. Subagents share the same budget, so a runaway delegation chain can't sneak past either. That's enough scaffolding. Now the interesting part. # Before Memory: Who Is the Agent? Before we get to memory and self-evolving skills, there's a layer that sits above both: identity. Memory is what the agent knows. Skills are how it does things. But neither tells you who it is when it shows up. Without an identity layer, every agent feels like the same agent wearing different hats. Hermes solves this with a single file: SOUL.md. It lives at ~/.hermes/SOUL.md and occupies slot #1 in the system prompt, before anything else loads. It defines the agent's personality, tone, communication style, and hard limits. ``` # SOUL.md You are a pragmatic senior engineer with strong taste. You optimize for truth, clarity, and usefulness over politeness theater. ``` SOUL.md is hand-authored and static. You write it once, tweak it over time, and it stays consistent across every project and every session. If the file is missing, Hermes falls back to a built-in default identity. Why does this matter for the self-improving story? Because everything that follows (the memory the agent writes, the skills it creates, the way it consolidates knowledge) happens through the lens of this identity. SOUL.md is the fixed frame. Memory and skills are the moving parts inside it. # The Memory System: Three Tiers, Three Speeds Hermes doesn't have a single "memory." It has three layers, each designed for a different purpose.  ## Tier 1: Two tiny Markdown files. At the core are two files stored on disk: - MEMORY.md (2,200 chars max) holds the agent's notes about your environment, project conventions, tool quirks, and lessons learned. - USER.md (1,375 chars max) holds your profile: name, communication preferences, skill level, and things to avoid. Both are injected into the system prompt as a frozen snapshot when a session starts. If the agent writes a new memory entry mid-session, that change persists to disk immediately but won't appear in the system prompt until the next session. When memory fills up (~80% capacity, shown as a percentage in the system prompt header), the agent has to consolidate. It merges related entries into denser, more information-packed versions, so that only useful information survives. ## Tier 2: Full-text session search. Every conversation (CLI and messaging) is stored in SQLite with full-text search. The agent can search weeks of past conversations from this. The tradeoff is clear: Tier 1 is always in context but tiny. Tier 2 has unlimited capacity but requires an active search plus LLM summarization. Critical facts live in memory. Everything else is searchable on demand. ## Tier 3: External memory providers (8 plugins). For deeper persistent memory, Hermes ships with 8 pluggable providers that run alongside built-in memory (never replacing it). Only one can be active at a time. When any external provider is active, Hermes automatically prefetches relevant memories before each turn, syncs conversation turns after each response, and extracts memories on session end.  External providers comparison. # Self-Evolving Skills: The Agent Writes Its Own Playbooks Memory handles facts. Skills handle procedures. Skills are Markdown files with YAML frontmatter, and function as the agent's procedural memory: not what it knows, but how it does things. Here's the anatomy of a skill: ``` --- name: k8s-pod-debug description: > Activate for crashing pods, CrashLoopBackOff, "why is my pod restarting", container failures. version: 1.2.0 author: agent platforms: [linux, macos] --- ## Procedure 1. Get pod status → check events → pull logs 2. Look for OOMKilled, ImagePullBackOff, config errors ## Pitfalls - Forgetting --previous flag on restarted containers ## Verification - Pod stays Running with 0 restarts for 5+ minutes ``` To keep token costs low, skills use progressive disclosure:  Progressive disclosure in Skills - Level 0: The agent sees names + descriptions only (~3k tokens for the full catalog) - Level 1: It loads the full skill content when it actually needs one - Level 2: It can drill into specific reference files within a skill ## The self-improvement loop. This is the core differentiator. The agent creates its own skills autonomously using the skill_manage tool. Skill creation triggers when: - The agent completes a complex task (5+ tool calls) - It hits errors or dead ends and finds the working path - The user corrects its approach - It discovers a non-trivial workflow So the loop works like this: the agent encounters a problem → solves it through trial and error → saves the successful approach as a SKILL.md file → next time it encounters a similar problem, it loads the skill and follows the proven procedure instead of rediscovering the approach from scratch. The tool supports six actions: create, patch (targeted fix, preferred because it's token-efficient), edit (full rewrite), delete, write_file, and remove_file.  ## The Curator: garbage collection for skills. Without maintenance, agent-created skills pile up. You end up with dozens of narrow, overlapping playbooks that waste tokens and pollute the catalog. The Curator is a background maintenance system that handles this. It runs on an inactivity check (not a cron daemon): if 7 days have passed since the last run and the agent has been idle for 2+ hours, a background fork of the agent spins up with its own prompt cache, never touching the active conversation. It operates in two phases: 1. Automatic transitions (deterministic, no LLM): Skills unused for 30 days become stale. Skills unused for 90 days get archived. 2. LLM review (up to 8 iterations): A forked agent surveys all agent-created skills and decides per-skill whether to keep, patch, consolidate, or archive. Two important constraints: - The Curator never touches bundled or hub-installed skills. Only agent-authored ones. - It never auto-deletes. The worst outcome is archival to ~/.hermes/skills/.archive/, which is recoverable with one command. Before every Curator pass, Hermes takes a tar.gz snapshot of the entire skills directory. Rollback is one command, and rollbacks are themselves reversible. You can also pin critical skills with hermes curator pin <skill> to protect them from archival and deletion. Patches and edits still go through, so the agent can improve a pinned skill without requiring you to unpin it first.  # GEPA: Evolving Skills Offline with Execution Traces Here's where it gets interesting. The in-agent learning loop (skill creation + Curator) has a known weakness: - The agent tends toward self-congratulation. It almost always thinks it performed well, even when it didn't. Community feedback has confirmed this. - The same system that auto-generates skills can also overwrite manual customizations with worse versions. This is where GEPA comes in. GEPA (Genetic-Pareto Prompt Evolution) is not built into the Hermes runtime. It lives in a companion repository (NousResearch/hermes-agent-self-evolution) and operates as an offline optimization pipeline. Published as an ICLR 2026 Oral paper, MIT licensed. The core idea: instead of asking the agent "did you do well?", GEPA reads execution traces to understand why things failed, then proposes targeted improvements through evolutionary search. The pipeline: 1. Read the current skill from the Hermes repo 2. Generate an evaluation dataset (synthetic test cases via Claude Opus, real session history from SQLite, or hand-curated golden sets) 3. Run the GEPA optimizer: read execution traces → understand failure points → generate candidate variants 4. Evaluate candidates using LLM-as-judge scoring with rubrics (not binary pass/fail) 5. Apply constraint gates: full test suite must pass 100%, skills stay under 15KB, caching compatibility is preserved, semantic purpose doesn't drift 6. Best variant goes out as a PR against the Hermes repo. Never a direct commit. No GPU required. Everything runs through API calls. Cost: roughly $2-10 per optimization run. This is something that can be skipped initially, but is highly effective when you hit a wall and don't want to spend time and money on finetuning (RL/GRPO) More details in this repo →  I recently wrote an article on GEPA. It’s a great alternative to try before moving to full fine-tuning or RL-based fine-tuning.  GRPO vs GEPA > **Akshay @akshay_pachaar**: [原文链接](https://x.com/akshay_pachaar/status/2049916107923034300) > Ok, to summarise: SOUL.md sets the identity. The runtime loop captures experience. The Curator keeps the library clean. GEPA makes sure what's in the library actually works. That's the full theory. Now let's get it running on your machine. # Getting Up and Running Linux, macOS, or WSL2. Python 3.11+ comes with the installer. 8GB RAM is fine for API-based usage. One-line install: ``` curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash source ~/.bashrc # or ~/.zshrc ``` Run the setup wizard. It walks through provider, API key, model, and tools: ``` hermes setup ``` Start chatting in terminal: ``` hermes ``` Connect it to Telegram: If you want to talk to your agent from your phone instead of the terminal, point it at a Telegram bot. Get a bot token from @BotFather (run /newbot), then get your Telegram user ID from @userinfobot. That's it. You have a working agent:  Hermes setup guide ## What Lives in ~/.hermes/ Right after install, your home directory gets a new folder. It's worth understanding the layout because everything you do with Hermes touches one of these paths. ``` ~/.hermes/ ├── config.yaml # Main configuration ├── .env # API keys and secrets ├── auth.json # OAuth provider credentials ├── SOUL.md # Agent identity (slot #1 in system prompt) │ ├── memories/ │ ├── MEMORY.md # Persistent agent facts │ └── USER.md # User model │ ├── skills/ # All skills (bundled, hub, agent-created) │ ├── mlops/ │ │ ├── axolotl/ │ │ │ ├── SKILL.md │ │ │ ├── references/ │ │ │ └── scripts/ │ │ └── vllm/ │ ├── devops/ │ └── .hub/ # Skills Hub state │ ├── sessions/ # Per-platform session metadata ├── state.db # SQLite session store with FTS5 ├── cron/ │ ├── jobs.json # Scheduled jobs │ └── output/ # Cron run outputs │ ├── plugins/ # Custom plugins ├── hooks/ # Lifecycle hooks ├── skins/ # CLI themes └── logs/ # agent.log, gateway.log, errors.log ``` A few files deserve a closer look. - config.yaml is the source of truth for everything non-secret. Model choice, terminal backend, tool enablement, MCP servers all live here. Edit with hermes config edit or set values one at a time with hermes config set <key> <value>. - .env holds your secrets. API keys, bot tokens, passwords. Hermes routes secret-looking values here automatically. - SOUL.md is slot #1 in the system prompt, before everything else. Identity layer, covered earlier. - skills/ is where the entire learning loop lives. Every skill the agent creates, plus everything you install, lands here. - state.db is the SQLite database backing session search. WAL-mode safe, FTS5-indexed. This is what makes "what did we discuss three weeks ago?" actually work. You won't manually edit most of this. But knowing the layout makes everything else click. ## Adding new Skills Hermes maintains its own official Skills Hub with 687 skills across 18 categories. The breakdown: - 87 built-in skills that ship with the agent - 79 optional skills you can enable on demand - 16 from Anthropic (frontend-design, pdf, pptx, docx, mcp-builder, etc.) - 505 from LobeHub (broader community contributions)  You can also add any GitHub repo as a custom tap: ``` hermes skills tap add yourname/your-skills-repo hermes skills install yourname/your-skills-repo/<skill-name> ``` This is how you'd share skills across a team or maintain your own private collection. # Going from 1 to 10 agents One agent is fine. Multiple specialized agents is where Hermes gets interesting. Hermes has a first-class feature for this called profiles. Each profile is a fully isolated Hermes instance with its own config, memory, skills, sessions, and SOUL.md. They share nothing by default. We'll set up three: a designer, a programmer, and a researcher. ## Create a team ``` hermes profile create designer --clone hermes profile create programmer --clone hermes profile create researcher --clone hermes profile list ``` > --clone copies your default profile's config and .env as a starting point.  Setting up the programmer and claude code delegation ## Give each one its own Telegram bot Each profile needs its own bot from BotFather. Telegram only allows one connection per token, so sharing breaks things. Run /newbot three times with BotFather and save the three tokens. Then run the gateway wizard once per profile: ``` hermes -p designer gateway setup hermes -p programmer gateway setup hermes -p researcher gateway setup ``` The setup is exactly the same as a regular agent, where you can again create new bots in bot father and connect them to their respective agents. ## Give each one a personality via SOUL.md This is where the agents become genuinely different from each other. Edit each profile's SOUL.md. Designer at ~/.hermes/profiles/designer/SOUL.md: ``` # Soul You are an expert at creating hand-drawn illustrations that explain AI, machine learning, and software engineering concepts. Think whiteboard sketches, not polished marketing art. Every illustration should make a technical idea click. You lead with the concept, then choose the metaphor, then commit to the sketch. You prefer simple line work and clear labels over visual flourish. Be opinionated about what to draw and what to leave out. Say when an illustration would hurt more than help. ``` Check out these examples:  Examples of illustrations created by Pixel: The designer Programmer at ~/.hermes/profiles/programmer/SOUL.md: ``` # Soul You are my staff engineer. Terse, direct, pragmatic. You read code before you write code. You write the smallest change that solves the problem. You prefer standard library over dependencies, boring tech over shiny tech, and explicit over clever. Always check: does this already exist in the codebase? Are there tests? What breaks if this fails? Run the tests before saying "done." ``` Researcher at ~/.hermes/profiles/researcher/SOUL.md: ``` # Soul You are my deep researcher for the AI and machine learning space. Your main job is a daily Telegram digest of what's new and what matters. Cover four streams: trending GitHub repos, big tech and lab announcements, fresh research papers, and the social pulse on X, Reddit, and Hacker News. Lead with what changed since yesterday. Cite every claim with a URL. Flag when signal is thin. Use delegate_task aggressively to parallelize across streams. Never state a contested claim as settled. Never fabricate a citation. ``` ## Customizing the programmer: route execution through Claude Code The programmer is more interesting if it doesn't just write code itself, but delegates execution to the Claude Code CLI. Hermes orchestrates. Claude Code does the file edits, runs commands, manages git. Hermes reads the result and decides what's next. This is also how I run mine on top of my Claude Max subscription. No separate API key. Claude Code uses Max credentials automatically. Start a session and send this single activation prompt: I already have a Claude Max subscription. You are my staff engineer who helps me with my day-to-day coding tasks, and under the hood you use Claude Code for all the executions. Set yourself up accordingly. The programmer will install the autonomous-ai-agents/claude-code skill on its own, verify claude is on PATH, and start using it for code execution. From the next message onward, anything coding-related (read files, write code, run tests, commit, push) routes through Claude Code under the hood. Two things worth knowing: - Make sure claude is on your PATH before activating. which claude should print a real binary path. - Claude Code has both a print mode (one-shot, fast, no TUI) and an interactive mode (full tmux session). The programmer picks based on the task. You don't need to think about it. ## Customizing the designer: teach it your visual style The designer becomes genuinely useful when it can generate images in your style, not generic AI output. The pattern: feed it reference designs, let it study them, ask it to create a skill that generates new images in the same style. This is the self-improving loop being used as a setup mechanism. Instead of writing a skill by hand, you're showing the agent good examples and asking it to encode the pattern itself. Start a session with the designer and paste your reference images (drag-and-drop in CLI, or attach in Telegram). Then send this prompt: ``` Carefully study these reference illustrations. Note the color palette, line weight, level of detail, composition, and overall aesthetic. I want you to create a new skill called "my-design-style" that captures this visual style. The skill should: 1. Document the style fingerprint in plain language (palette, line weights, composition rules, recurring motifs) 2. Include a Python script that takes a text description of a new illustration and generates the image using the Nano Banana model (google/gemini-2.5-flash-image) via the OpenRouter API in this style 3. Read OPENROUTER_API_KEY from the environment Use skill_manage to create it. Test the generated script on a sample prompt before saying it's done. ``` The designer will study the references, write the SKILL.md, generate the Python script, save it under ~/.hermes/profiles/designer/skills/my-design-style/, and verify the script runs. If you already ran hermes setup and picked OpenRouter as your provider, the key is already in the designer profile's .env thanks to --clone. If not, add it once: ``` hermes -p designer config set OPENROUTER_API_KEY <your-key> ``` From then on, asking the designer for a new illustration triggers the skill. It writes a prompt informed by your style fingerprint, calls Nano Banana through OpenRouter, and saves the output. The same pattern works for any style-specific output. Feed reference content, ask the agent to build a skill that reproduces the pattern. Newsletter intros, X threads, code review comments, anything where consistency matters. ## Scheduling Work: Cron in Plain English The researcher's SOUL.md says it's responsible for a daily Telegram digest. That implies a job running on its own schedule, without you remembering to ask. That's what Hermes cron is for. Hermes ships with a built-in scheduler. The gateway daemon ticks every 60 seconds, runs any due jobs in isolated agent sessions, and delivers output to whichever messaging platform you specify. Jobs survive restarts. They live in ~/.hermes/cron/jobs.json and output goes to ~/.hermes/cron/output/.  The interesting part: you don't write cron expressions. You describe what you want in English and Hermes converts it. Wire up the researcher's daily digest Open a session with the researcher and send this prompt: ``` Every weekday at 8am India time, prepare a deep digest of what's new in the AI and machine learning space over the last 24 hours. Cover four streams in this order: 1. Trending GitHub repos (especially new AI/ML tooling) 2. Big tech and lab announcements (Anthropic, OpenAI, Google, Meta, xAI, Nous, etc.) 3. Fresh research papers worth reading 4. Social pulse from X, Reddit, and Hacker News Lead with what changed since yesterday. Cite every claim with a URL. Keep it under 800 words. Deliver to Telegram. Set this up as a recurring cron job. ``` The researcher creates the job using its cronjob tool, delivery target defaults to the current chat (Telegram in this case), and the scheduler takes over from there. Verify it was created: ``` hermes -p researcher cron list ``` You should see the job with its next scheduled run time. Tomorrow morning at 8am, your Telegram lights up with the digest. No further action needed. Other useful patterns The cron syntax is flexible. A few variations worth knowing: - One-shot delays. /cron add 30m "Remind me to check the build" runs once in 30 minutes. - Recurring intervals. /cron add "every 2h" "Check server status" runs every two hours. - Standard cron expressions. /cron add "0 9 * * 1-5" "..." for precise control. Weekdays at 9am, in this case. - Skill attachment. /cron add "every 1h" "Summarize new feed items" --skill blogwatcher loads a skill before running the prompt. You can also chain jobs. One cron's output becomes the next cron's input via a context_from flag. Useful for multi-stage automations where you want a research step to feed a writing step. That's a wrap. Thanks for reading. Let me know in the comments what you'd want me to cover next. If you learn better from video, I'm dropping a full Hermes Agent walkthrough on YouTube and X in a couple of days. Stay tuned! Cheers! :) ## 相关链接 - [Akshay](https://x.com/akshay_pachaar) - [@akshay_pachaar](https://x.com/akshay_pachaar) - [63K](https://x.com/akshay_pachaar/status/2054564519280804028/analytics) - [8 pluggable providers](https://hermes-agent.nousresearch.com/docs/user-guide/features/memory-providers) - [ICLR 2026 Oral paper](https://arxiv.org/abs/2507.19457) - [More details in this repo →](https://github.com/NousResearch/hermes-agent-self-evolution) - [May 1](https://x.com/akshay_pachaar/status/2049916107923034300) - [91K](https://x.com/akshay_pachaar/status/2049916107923034300/analytics) - [@BotFather](https://t.me/BotFather) - [@userinfobot](https://t.me/userinfobot) - [Skills Hub](https://hermes-agent.nousresearch.com/docs/skills) - [Upgrade to Premium](https://x.com/i/premium_sign_up) - [10:08 PM · May 13, 2026](https://x.com/akshay_pachaar/status/2054564519280804028) - [63.3K Views](https://x.com/akshay_pachaar/status/2054564519280804028/analytics) - [View quotes](https://x.com/akshay_pachaar/status/2054564519280804028/quotes) --- *导出时间: 2026/5/14 14:13:57* --- ## 中文翻译 # Hermes Agent 大师课 **作者**: Akshay **日期**: 2026-04-30T18:17:40.000Z **来源**: [https://x.com/akshay_pachaar/status/2054564519280804028](https://x.com/akshay_pachaar/status/2054564519280804028) ---  理解和定制 Hermes Agent 所需的一切。自我进化的技能、三层记忆系统、GEPA 优化,以及从 0 到 1 打造为你 24/7 工作的 Agent。 Hermes Agent 在两个月内 GitHub 星标数突破了 90,000。开发者们正在悄悄构建能够学习工作流、记忆上下文并全天候(24/7)运行的个人 AI Agent。  Star 历史追踪器 你用过的每一个 AI Agent 都有同样的问题:会话一结束,它就会把所有事情忘得一干二净。 你的编码偏好、你纠正过三次的项目约定、昨天它花了 10 分钟才找出的修复方案。全都没了。下次会话时,你又得从头开始。 来自 Nous Research 的 Hermes Agent 采取了一种根本不同的方法。它内置了一个学习循环,能够: - 跨会话记忆 - 编写自己的可复用技能 - 在后台清理它们 - 并通过名为 GEPA 的进化引擎离线验证它们 没有其他开源 Agent 能将这三者结合在一起。即使是 OpenClaw 也不行。 本指南将涵盖这个学习循环是如何工作的,每一层记忆的作用,以及如何从零开始配置所有内容。 到最后,你的机器上将运行三个完全隔离的 Agent:一名程序员(使用你的 Claude 代码)、一名深度研究员和一名设计师,每个人都有自己的性格、记忆、技能和 Telegram 机器人。 看看这个:  Telegram 中的三个 Agent 整个设置只需几分钟,这里的一切都可以在你自己的硬件上复现。 > 注意:本指南中的所有插图均由 Pixel 设计,它是你在本指南末尾将学会构建的 Hermes Agent 之一。阅读时请注意它们。 让我们开始吧! # 如何阅读本文 两部分:先理论,后实践。 时间紧迫?直接跳转到“快速上手”部分。这些命令可以独立运行。 但理论是值得的。了解技能如何自我进化、记忆如何组合,以及 GEPA 何时发挥作用,这决定了你是把 Hermes 当作一个带笔记功能的聊天机器人,还是把它当作一种能产生复利效应的工具。 接下来包含: - **Hermes Agent 到底是什么**:介绍,以及与 OpenClaw 的对比。 - **它是如何构建的**:一张图看懂架构。 - **记忆之前:Agent 是谁?**:SOUL.md,身份层。 - **记忆系统**:三层,三种速度。 - **自我进化的技能**:Agent 编写的剧本以及策展人。 - **GEPA**:离线技能优化。 - **快速上手**:安装、Telegram、第一个 Agent。 - **运行多个 Agent**:配置文件、三种人格、定时摘要。 - **根据你的需求定制 Agent。 # Hermes 是什么,以及它在架构上有何不同 一句话介绍:一个越用越强的 Agent。 之所以能实现这一点,是因为三种通常分离的能力被整合在了一个框架中:运行时技能学习、持久化多层记忆,以及可选的权重训练流水线。没有其他开源 Agent 能同时具备这三点。 开源生态中最接近的竞品是 OpenClaw。两者都是持久化的、对消息友好的,但它们做出了截然相反的架构选择。 Kilo 博客上的一个精辟概括很好地捕捉了这一点:“Hermes 围绕学习 Agent 打包了一个网关。OpenClaw 围绕消息网关打包了一个 Agent。”  OpenClaw vs. Hermes # 它是如何构建的 在理解学习循环之前,你需要先了解 Hermes 的基本结构。 所有内容都通过 `run_agent.py` 脚本中的一个单一 `AIAgent` 类流动。CLI(命令行界面)、消息网关、批处理运行器、IDE 集成:它们都是同一个核心 Agent 的入口点。 这正是平台无关性能够真正奏效的原因。  Hermes agent 的结构 核心循环是 ReAct 风格且同步的。构建系统提示,检查是否需要压缩,进行可中断的 API 调用,执行任何工具调用,然后再次循环。 一些稍后很重要的细节: - Agent 可以在六个不同的地方运行命令。本地终端、Docker、SSH、Modal、Daytona 或 Singularity。代码相同,只需更改配置。将执行环境从笔记本电脑转移到云 GPU 服务器,而无需触碰任何其他东西。 - 它几乎适用于任何模型。一个转换层将任何提供商路由到三种 API 格式之一。这就是为什么你可以用一个命令从 Claude 切换到 GPT、Gemini 或本地 Ollama,而不会出现任何问题。 - 每个 Agent 每个任务有 90 轮的硬性上限。如果没有这个,陷入循环的 Agent(重试失败的 API,重读同一个文件)会悄悄消耗掉你的额度。子 Agent 共享相同的预算,因此失控的委托链也无法蒙混过关。 脚手架已经足够了。现在进入有趣的部分。 # 记忆之前:Agent 是谁? 在进入记忆和自我进化技能之前,有一个位于它们之上的层:身份。 记忆是 Agent 知道的内容。技能是它做事的方式。但这两者都无法告诉你当它出现时它是谁。如果没有身份层,每个 Agent 感觉都像是同一个 Agent 戴着不同的帽子。 Hermes 通过一个文件解决了这个问题:`SOUL.md`。 它位于 `~/.hermes/SOUL.md`,并在其他任何内容加载之前占据系统提示中的第 1 号位置。它定义了 Agent 的性格、语气、沟通风格和硬性限制。 ``` # SOUL.md You are a pragmatic senior engineer with strong taste. You optimize for truth, clarity, and usefulness over politeness theater. ``` `SOUL.md` 是手写的静态文件。你编写一次,随时间调整,它在每个项目和每个会话中保持一致。如果文件丢失,Hermes 会回退到内置的默认身份。 为什么这对自我改进的故事很重要?因为随后的所有内容(Agent 编写的记忆、它创建的技能、它整合知识的方式)都是通过这个身份的视角发生的。 `SOUL.md` 是固定框架。记忆和技能是其中的移动部件。 # 记忆系统:三层,三种速度 Hermes 没有单一的“记忆”。它有三层,每一层都针对不同的目的而设计。  ## 第 1 层:两个微小的 Markdown 文件 核心是存储在磁盘上的两个文件: - `MEMORY.md`(最多 2,200 个字符)保存 Agent 关于你的环境、项目约定、工具怪癖和经验教训的笔记。 - `USER.md`(最多 1,375 个字符)保存你的个人资料:姓名、沟通偏好、技能水平和需要避免的事项。 两者都会在会话开始时作为冻结快照注入系统提示。如果 Agent 在会话中间写入新的记忆条目,该更改会立即持久化到磁盘,但要等到下一次会话才会出现在系统提示中。 当记忆装满时(约 80% 容量,在系统提示标题中显示为百分比),Agent 必须进行整合。 它会将相关条目合并为密度更高、信息量更大的版本,以便只有有用的信息得以保留。 ## 第 2 层:全文会话搜索 每次对话(CLI 和消息)都存储在 SQLite 中,支持全文搜索。Agent 可以从中搜索数周甚至数月前的过去对话。 权衡很明显:第 1 层始终在上下文中但容量微小。第 2 层容量无限但需要主动搜索加 LLM 摘要。 关键事实存在于记忆中。其他所有内容均可按需搜索。 ## 第 3 层:外部记忆提供商(8 个插件) 为了实现更深层次的持久化记忆,Hermes 附带了 8 个可插拔的提供商,它们与内置记忆并行运行(永不替换)。一次只能激活一个。 当任何外部提供商处于活动状态时,Hermes 会在每一轮之前自动预取相关记忆,在每次响应后同步对话轮次,并在会话结束时提取记忆。  外部提供商对比。 # 自我进化的技能:Agent 编写自己的剧本 记忆处理事实。技能处理程序。 技能是带有 YAML 前言的 Markdown 文件,充当 Agent 的程序性记忆:不是它知道什么,而是它如何做事。 这是一个技能的剖析: ``` --- name: k8s-pod-debug description: > Activate for crashing pods, CrashLoopBackOff, "why is my pod restarting", container failures. version: 1.2.0 author: agent platforms: [linux, macos] --- ## Procedure 1. Get pod status → check events → pull logs 2. Look for OOMKilled, ImagePullBackOff, config errors ## Pitfalls - Forgetting --previous flag on restarted containers ## Verification - Pod stays Running with 0 restarts for 5+ minutes ``` 为了保持 Token 成本低廉,技能使用了渐进式披露:  技能中的渐进式披露 - 0 级:Agent 仅看到名称 + 描述(整个目录约 3k tokens) - 1 级:当它实际需要某个技能时,加载完整的技能内容 - 2 级:它可以深入钻研特定技能中的参考文件 ## 自我改进循环 这是核心的差异化优势。Agent 使用 `skill_manage` 工具自主创建自己的技能。技能创建会在以下情况触发: - Agent 完成了一项复杂任务(5 次以上工具调用) - 它遇到错误或死胡同并找到了可行路径 - 用户纠正了它的方法 - 它发现了一个非平凡的工作流 因此循环是这样工作的:Agent 遇到问题 → 通过试错解决 → 将成功的方法保存为 `SKILL.md` 文件 → 下次遇到类似问题时,它加载技能并遵循经过验证的程序,而不是从头开始重新探索方法。 该工具支持六种操作:`create`(创建)、`patch`(修补,目标修复,首选,因为它节省 Token)、`edit`(编辑,完全重写)、`delete`(删除)、`write_file`(写文件)和 `remove_file`(移除文件)。  ## 策展人:技能的垃圾回收 如果不进行维护,Agent 创建的技能会堆积如山。你最终会得到几十个狭窄、重叠的剧本,浪费 Token 并污染目录。 策展人是一个后台维护系统,负责处理这个问题。它在非活动检查时运行(而不是 cron 守护进程):如果自上次运行以来已过 7 天,且 Agent 空闲了 2 小时以上,Agent 的一个后台分支会启动,拥有自己的提示缓存,绝不会触及活动的对话。 它分两个阶段运行: 1. 自动转换(确定性,无 LLM):30 天未使用的技能变为陈旧状态。90 天未使用的技能会被归档。 2. LLM 审查(最多 8 次迭代):一个分支的 Agent 调查所有 Agent 创建的技能,并针对每个技能决定是保留、修补、合并还是归档。 两个重要的约束: - 策展人永远不会触及捆绑的或从 Hub 安装的技能。只针对 Agent 编写的技能。 - 它永远不会自动删除。最坏的结果是归档到 `~/.hermes/skills/.archive/`,这可以通过一个命令恢复。 在每次策展人运行之前,Hermes 会获取整个技能目录的 `tar.gz` 快照。回滚只需一个命令,且回滚本身也是可逆的。 你还可以使用 `hermes curator pin <skill>` 固定关键技能,以保护它们不被归档和删除。修补和编辑仍然可以通过,因此 Agent 可以改进固定的技能,而无需你先取消固定。  # GEPA:利用执行跟踪离线进化技能 这里就变得有趣了。 Agent 内部的学习循环(技能创建 + 策展人)有一个已知的弱点: - Agent 倾向于自我表扬。即使它表现不好,它几乎总是认为自己表现很好。社区的反馈证实了这一点。 - 自动生成技能的同一系统也可能用更差的版本覆盖手动定制的内容。 这就是 GEPA 发挥作用的地方。 GEPA (Genetic-Pareto Prompt Evolution) 没有内置在 Hermes 运行时中。它存在于一个配套的仓库(NousResearch/hermes-agent-self-evolution)中,并作为离线优化流水线运行。作为 ICLR 2026 口头论文发表,MIT 许可。 核心思想:不是问 Agent “你做得好吗?”,GEPA 阅读执行跟踪以理解失败的原因,然后通过进化搜索提出针对性的改进。 流水线如下: 1. 从 Hermes 仓库读取当前技能。 2. 生成评估数据集(通过 Claude Opus 生成的合成测试用例,来自 SQLite 的真实会话历史,或手动策划的黄金集)。 3. 运行 GEPA 优化器:读取执行跟踪 → 理解失败点 → 生成候选变体。 4. 使用基于评分标准的 LLM 评判(而非二元通过/失败)来评估候选者。 5. 应用约束门:完整的测试套件必须 100% 通过,技能保持在 15KB 以下,保留缓存兼容性,语义目的不发生偏移。 6. 最佳变体作为 PR 发送到 Hermes 仓库。绝不直接提交。 不需要 GPU。一切通过 API 调用运行。成本:每次优化运行大约 2-10 美元。 这是最初可以跳过的东西,但当你碰壁并且不想在微调(RL/GRPO)上花费时间和金钱时,它非常有效。 更多细节在这个仓库 →  我最近写了一篇关于 GEPA 的文章。 在转向完整的微调或基于 RL 的微调之前,这是一个很好的替代尝试方案。  GRPO vs GEPA > **Akshay @akshay_pachaar**: [原文链接](https://x.com/akshay_pachaar/status/2049916107923034300) > 好的,总结一下: `SOUL.md` 设定身份。运行时循环捕获经验。策展人保持库的整洁。GEPA 确保库里的东西确实有效。 理论部分讲完了。现在让我们在你的机器上运行起来。 # 快速上手 Linux、macOS 或 WSL2。安装程序附带 Python 3.11+。基于 API 的使用 8GB 内存就足够了。 一键安装: ``` curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash source ~/.bashrc # 或者 ~/.zshrc ``` 运行设置向导。它会引导你完成提供商、API 密钥、模型和工具的配置: ``` hermes setup ``` 在终端开始聊天: ``` hermes ``` 连接到 Telegram: 如果你想通过手机而不是终端与 Agent 对话,可以将其指向一个 Telegram 机器人。 从 @BotFather 获取机器人 Token(运行 `/newbot`),然后从 @userinfobot 获取你的 Telegram 用户 ID。 就这样。你就有了一个能工作的 Agent:  Hermes 设置指南 ## ~/.hermes/ 中有什么 安装后,你的主目录会立即获得一个新文件夹。 了解这个布局是值得的,因为你在 Hermes 中所做的每一件事都会触及这些路径之一。 ``` ~/.hermes/ ├── config.yaml # 主配置 ├── .env # API 密钥和秘密 ├── auth.json # OAuth 提供商凭证 ├── SOUL.md # Agent 身份(系统提示中的 #1 号位置) │ ├── memories/ │ ├── MEMORY.md # 持久化的 Agent 事实 │ └── USER.md # 用户模型 │ ├── skills/ # 所有技能(捆绑的、hub、agent 创建的) │ ├── mlops/ │ │ ├── axolotl/ │ │ │ ├── SKILL.md │ │ │ ├── references/ │ │ │ └── scripts/ │ │ └── vllm/ │ ├── devops/ │ └── .hub/ # Skills Hub 状态 │ ├── sessions/ # Per-pla
T The Hermes Agent Memory Guidebook 这是一份关于 Hermes Agent 记忆系统的终极指南。文章深入解析了 Hermes 的三层记忆架构:开箱即用的原生层、可选的插件层以及社区扩展层。作者详细说明了本地数据库与 Markdown 文件的协同工作机制,澄清了关于记忆合并的常见误区,并强调了记忆在 Agent 从无状态聊天机器人转变为具备技能累积和个性化能力的智能体过程中的关键作用。 技术 › Agent ✍ Kevin Simback🕐 2026-05-28 HermesAgentMemoryArchitectureNous ResearchTutorialMemory ManagementLLM
H Hermes Agent 进阶指南:从架构原理到构建自进化的多智能体系统 本文深入介绍了 Nous Research 开源项目 Hermes Agent。文章详细解析了其独特的“学习闭环”架构,该架构结合了三层持久化内存、自进化技能系统以及 GEPA 优化引擎,解决了传统 Agent 随会话结束而遗忘的问题。文中还将 Hermes 与 OpenClaw 进行了对比,并提供了从零开始配置多个个性化 Agent(程序员、研究员、设计师)的实战教程,旨在帮助开发者打造能够 24/7 运行且持续学习的个人 AI 队伍。 技术 › Hermes ✍ Akshay🕐 2026-05-28 AgentHermes自进化LLM开发者工具系统架构教程Nous ResearchGEPA多智能体
H Hermes Agent 完全指南:从零到自进化的 AI 员工 这是一份 Hermes Agent 的深度实操指南,涵盖了安装、模型选择、平台配置及最佳实践。文章对比了 Hermes 与 OpenClaw、Claude Code 的差异,强调了其本地化记忆、自我改进能力和多平台支持优势。核心内容涉及通过 Cron 和 /goal 命令实现全天候自主任务执行,助你打造一个能持续进化的 AI 员工。 技术 › Agent ✍ YanXbt🕐 2026-05-28 HermesAI AgentLLM自动化自我进化OpenClawClaude教程模型选择DevOps
2 2026年AI Agent横评:水星与爱马仕的抉择 文章针对2026年AI Agent红海现状,对比了OpenClaw、Hermes(爱马仕)和Mercury(水星)三款工具。指出OpenClaw成本高易出Bug,Hermes适合进阶玩家追求自我进化,而Mercury(水星)因其安全可控、成本低廉及稳定性,被推荐为普通人的最优解。文章详细分析了选型逻辑并提供了Mercury的安装指南。 技术 › Agent ✍ 弘毅新征程🕐 2026-04-29 AI AgentMercury工具测评OpenClawHermesLLM个人助理技术选型效率工具DeepSeek
H Hermes Agent 完全上手指南:会自己进化的 AI Agent 这是一份关于 Hermes Agent 的深度上手教程。文章介绍了 Hermes 相比 OpenClaw 的核心优势:具备自我进化能力,能从任务中自动创建和优化 Skills,以及拥有强大的 SQLite 全文搜索记忆系统。教程涵盖从环境准备、安装配置、基础对话,到进阶的消息网关配置、定时任务、记忆训练,再到高级的 MCP 服务器集成、多 Profile 管理、浏览器自动化及语音交互等 15 个实践任务,帮助用户全面掌握这一开源 AI Agent 框架。 技术 › Hermes ✍ OneHopeA9🕐 2026-04-22 AI AgentHermesOpenClaw自我进化记忆系统MCP教程自动化SQLiteLLM
H Hermes Agent 橙皮书 2.0:自动进化的 AI 同事 本文介绍了由 Nous Research 开源的超快速迭代 AI Agent 框架——Hermes。与需要人工编写规则(如 soul.md)的 OpenClaw 不同,Hermes 的核心优势在于具备自我进化和记忆管理能力,能通过“小抄”和“管家”机制在使用过程中不断自我完善,无需用户反复调教。作者还提及了针对 Hermes v0.16.0 全新重写的《Hermes Agent 橙皮书 2.0》,涵盖了其多平台接入、桌面应用及安全模型等新特性。 技术 › Agent ✍ 花叔🕐 2026-06-09 HermesAI Agent开源自我进化OpenClaw书评
我 我连续跑了几个月 Hermes Agent,最后发现:99% 的人根本没用对 AI Agent 文章通过作者几个月的实际测试,深入探讨了 Hermes Agent 与 ChatGPT/Claude 的核心区别:Hermes 具备本地记忆、自我改进和经验沉淀能力,越用越懂你。文章详细介绍了安装步骤、模型选择策略(如 GPT-5.5 起步)、Telegram 消息配置及核心指令,并提出了将 AI 视为“长期员工”而非简单工具的 8 大应用场景与安全建议。 技术 › Hermes ✍ 路飞 AI 研究员🕐 2026-06-02 AI AgentHermesNous Research教程工作流自我改进模型选择Telegram自动化工 具多Agent
A AI 神经系统诊断:Agent 运行时的六种病症 文章提出了一个新的视角来理解和调试 AI Agent:将其错误类比为人类神经系统疾病。作者指出,所谓的“AI 幻觉”在医学上更接近于“虚构症”。文章详细列举了 Agent 运行时中的六种病症,包括“遗忘症”、“幻肢状态”等,并针对每种症状提供了具体的诊断工具(如 gbrain, Mem0)和解决方案,强调通过检查“器官”(记忆、环境、工具链)来优化 Agent 性能。 技术 › Agent ✍ Vox🕐 2026-05-25 AgentOpenClawHermes调试心理学LLM记忆自动化幻觉工具推荐
O OpenClaw 终于有了一个能打的对手:Hermes Engine 全平台实测+迁移指南 本文深入评测了新兴的 AI Agent 引擎 Hermes Engine,视其为 OpenClaw 的强力替代品。文章指出 Hermes 在稳定性、记忆持久化和进度可视化方面显著优于 OpenClaw,且完美兼容 OpenClaw 的技能生态。详细提供了 Linux/Mac/Windows 全平台安装教程、数据迁移方法及 Telegram Bot 集成指南,推荐搭配 Google AI Studio 的免费 Gemma 模型使用。 技术 › Agent ✍ 0x小师妹🕐 2026-05-20 HermesOpenClaw教程实测开源自动化效率工具LLMAI评测
Y Your Agent Needs a Wiki and a Recording 文章指出仅依靠扩大上下文窗口无法解决 Agent 的遗忘问题,并提出了 GBrain 和 Lossless 两个解决方案。GBrain 是基于 Wiki 的知识检索层,解决跨对话的长期记忆(如项目背景、决策历史);Lossless 则像会议录音,通过保留原始消息记录,解决长对话中的细节检索与回溯问题。二者结合能让 Agent 拥有类似查阅文档和回溯记录的能力,从而更智能地处理复杂任务。 技术 › Agent ✍ Vox🕐 2026-05-18 GBrainLosslessAgent MemoryOpenClawHermesRAGLLMContext Window
A Agent 记忆架构指南:为什么你需要 Wiki 和 录音 文章探讨了 AI Agent 开发中的记忆瓶颈,指出单纯扩大上下文窗口并不足以解决遗忘问题。作者提出了 GBrain 和 Lossless 两个核心模式:GBrain 像公司 Wiki,用于跨会话查询事实和决策;Lossless 像会议录音,允许在长对话中无损检索原始细节。文章详细解释了二者的区别、应用场景以及如何在 OpenClaw 和 Hermes 运行时中集成。 技术 › Agent ✍ Vox🕐 2026-05-18 AgentGBrainLosslessOpenClawHermes上下文管理记忆架构RAGLLM开发指南
H How to Become a Hermes Agent Operator 本文介绍了由 Nous Research 开源的高杠杆 AI 框架 Hermes Agent。文章详细阐述了其架构(大脑、个性、技能集)、具备记忆与自学习能力的闭环机制,以及如何从单机部署扩展为 VPS 上的自动化营销团队。作者分享了将其作为营销基础设施的实际经验与配置指南。 技术 › Agent ✍ Shann³🕐 2026-05-16 HermesAgent营销自动化Nous ResearchDevOps工作流VPS开源LLM实战指南