Hermes Agent 进阶指南:从架构原理到构建自进化的多智能体系统 ✍ Akshay🕐 2026-05-28📦 28.0 KB 🟢 已读 𝕏 文章列表 本文深入介绍了 Nous Research 开源项目 Hermes Agent。文章详细解析了其独特的“学习闭环”架构,该架构结合了三层持久化内存、自进化技能系统以及 GEPA 优化引擎,解决了传统 Agent 随会话结束而遗忘的问题。文中还将 Hermes 与 OpenClaw 进行了对比,并提供了从零开始配置多个个性化 Agent(程序员、研究员、设计师)的实战教程,旨在帮助开发者打造能够 24/7 运行且持续学习的个人 AI 队伍。 AgentHermes自进化LLM开发者工具系统架构教程Nous ResearchGEPA多智能体 # 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) - [4.4M](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) - [93K](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) - [4.4M Views](https://x.com/akshay_pachaar/status/2054564519280804028/analytics) - [View quotes](https://x.com/akshay_pachaar/status/2054564519280804028/quotes) --- *导出时间: 2026/5/28 10:04:32* --- ## 中文翻译 # 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 构建 10 个为你全天候工作的 Agent。 Hermes Agent 在两个月内 GitHub 星标数突破了 9 万。开发者们正在悄悄构建能够学习他们的工作流、记住上下文并全天候运行的个人 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 你是一位务实且品味极佳的高级工程师。 你优先考虑真实性、清晰度和实用性, 而不是礼貌的客套。 ``` `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: > 适用于崩溃的 Pod、CrashLoopBackOff、 "为什么我的 Pod 在重启"、容器故障。 version: 1.2.0 author: agent platforms: [linux, macos] --- ## 流程 1. 获取 Pod 状态 → 检查事件 → 拉取日志 2. 查找 OOMKilled、ImagePullBackOff、配置错误 ## 陷阱 - 在重启容器时忘记 --previous 标志 ## 验证 - Pod 保持 Running 状态且 5 分钟以上重启次数为 0 ``` 为了保持 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 创建的技能会堆积。你最终会得到几十个狭窄、重叠的剧本,浪费 tokens 并污染目录。 策展人是一个后台维护系统,负责处理这个问题。它在非活动检查上运行(而不是 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 倾向于自我 congratulation。它几乎总是认为自己表现很好,即使实际上并非如此。社区反馈证实了这一点。 - 自动生成技能的同一系统也可能用更差的版本覆盖手动定制的内容。 这就是 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 RAM 就够了。 一键安装: ``` 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 获取机器人令牌(运行 `/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/ # 技能 Hub 状态 │ ├── sessions/ # 每平 ```
H Hermes Agent 大师课程:完整指南 本文是一份关于 Hermes Agent 的 12 部分系列课程汇总,涵盖了从工作流程、学习系统、技能管理到多平台集成、浏览器控制等核心功能,详细介绍了该系统的架构设计与最佳实践。 技术 › Hermes ✍ Tony Simons🕐 2026-07-20 AgentHermesLLM教程系统架构工具集成多代理自动化
终 终极 Hermes 指南:构建 30 天后仍保持高内聚的多代理团队 本文是一篇关于 Hermes 多代理系统的深度操作指南。作者指出,单个代理承担多种角色会导致声音模糊和上下文污染,而简单的角色划分也难以维持长期的一致性。文章提出了基于“隔离配置文件”的解决方案,详细介绍了构建包含编排者、研究员、作家和工程师的四人团队步骤。重点阐述了通过“交接契约”、内存 KPI 审计和策略门禁来建立“操作员层”,确保团队在运行 30 天后依然保持专业分工和清晰边界,避免多代理系统退化为单一混乱体。 技术 › Hermes ✍ Nyk🕐 2026-04-16 多智能体HermesAgent系统架构LLM提示词工程工作流自动化团队协作AI运营
H Hermes Agent多智能体群聊协作配置教程 这是一份关于如何利用 Hermes 的 Profile 机制构建多智能体协作群聊的实操教程。文章详细介绍了配置 1 个主 Agent(Leader)和 3 个辅助 Agent(数据、技术、市场研究员)的完整流程。内容涵盖了 Profile 创建、共享 API 密钥配置、角色 Prompt 编写、Discord 机器人对接以及发言顺序控制与成本优化策略。 技术 › Agent ✍ DeFi狙击手 | Ai🕐 2026-05-28 Hermes多智能体Agent配置教程提示词群聊协作成本控制LLMDeepSeek
T The Hermes Agent Memory Guidebook 这是一份关于 Hermes Agent 记忆系统的终极指南。文章深入解析了 Hermes 的三层记忆架构:开箱即用的原生层、可选的插件层以及社区扩展层。作者详细说明了本地数据库与 Markdown 文件的协同工作机制,澄清了关于记忆合并的常见误区,并强调了记忆在 Agent 从无状态聊天机器人转变为具备技能累积和个性化能力的智能体过程中的关键作用。 技术 › Agent ✍ Kevin Simback🕐 2026-05-28 HermesAgentMemoryArchitectureNous ResearchTutorialMemory ManagementLLM
H Hermes Agent 记忆系统架构指南 本文详细介绍了 Hermes Agent 的记忆系统架构。作者指出,记忆是 Agent 区别于普通 Chatbot 的核心。Hermes 的记忆栈分为三层:开箱即用的原生层(包含本地数据库和两个 Markdown 文件)、可选的官方插件提供商层、以及社区构建的扩展层。文章深入解析了内存文件的运作机制,如字符上限、自动合并的误区以及 Agent 如何自主管理记忆。 技术 › Hermes ✍ Kevin Simback🕐 2026-05-24 Agent记忆系统HermesArchitecture开发者工具LLM技术栈插件系统
H Hermes Agent 入门指南:模型选择与 Skill 配置实战 本文是 Hermes Agent 的新手入门教程,通过 PPT 生成的实战对比测试,深入解析了“模型能力”与“Skill 技能”之间的乘数关系。文章指出,仅靠强模型或好 Skill 无法达到最佳效果,必须两者配合。作者介绍了 Ring-2.6-1T 模型在工具调用和多步规划上的优势,并强调了在使用 Hermes Agent 时“先规划(Plan)、后执行”的重要性。 技术 › Skill ✍ Lonely🕐 2026-05-18 HermesAgentLLM教程模型评测实战技巧Ring模型PPT生成工作流工具推荐
H How to Become a Hermes Agent Operator 本文介绍了由 Nous Research 开源的高杠杆 AI 框架 Hermes Agent。文章详细阐述了其架构(大脑、个性、技能集)、具备记忆与自学习能力的闭环机制,以及如何从单机部署扩展为 VPS 上的自动化营销团队。作者分享了将其作为营销基础设施的实际经验与配置指南。 技术 › Agent ✍ Shann³🕐 2026-05-16 HermesAgent营销自动化Nous ResearchDevOps工作流VPS开源LLM实战指南
H Hermes Agent Masterclass:架构详解与实战指南 本文是 Hermes Agent 的深度教程。Hermes 是一个能够在使用中不断自我进化的 AI Agent,与 OpenClaw 等其他 Agent 不同,它具备跨会话记忆、自编写/修剪技能以及通过 GEPA 引擎进行离线验证的独特能力。文章详细剖析了其包含 SOUL.md 身份层在内的三层记忆系统,并指导读者如何从零配置运行多个具备独立个性的 Agent。 技术 › Hermes ✍ Akshay🕐 2026-05-14 AI AgentHermesNous ResearchSelf-evolvingGEPAMemory SystemTutorialOpenClawLLM架构
单 单智能体与多智能体解决方案的选择指南 文章探讨了在大语言模型时代,如何权衡使用单智能体与多智能体系统。引用斯坦福及Google/MIT的研究指出,多智能体系统并非总是更优,往往伴随着更高的计算成本、延迟和通信开销,且在“思考预算”相当的情况下,优化后的单智能体常能胜出。文章建议将单智能体作为默认起点,仅当任务涉及大量工具、上下文退化严重、存在自然解耦边界或需严格合规验证时,才考虑引入多智能体架构。 技术 › Agent ✍ AlphaSignal AI🕐 2026-05-07 AgentLLM系统架构多智能体性能优化StanfordGoogleMIT决策框架
H Hermes Curator:解决 Agent 技能漂移与上下文腐朽的自动化管理系统 本文介绍了 Hermes Agent v0.12.0 版本中推出的 Hermes Curator 功能。针对自改进 Agent 普遍存在的技能囤积和上下文腐朽问题,Hermes Curator 作为一个后台维护系统,通过遥测驱动的状态机自动追踪技能使用频率。它能将长期未用的技能由活跃转为陈旧,直至归档,并利用低成本辅助模型定期审查和合并重复技能。此外,系统提供 CLI 工具和“固定”机制,确保关键技能不被误删,从而在不干扰用户工作的情况下,降低 Token 成本并提升 Agent 推理效率。 技术 › Agent ✍ mem0🕐 2026-05-02 HermesHermes CuratorAgentSelf-ImprovingMemory ManagementSkill DriftLLMNous Research
H Hermes 高级用法:用多 Profile 协作搭建 OPC Agent 团队 本文探讨了如何利用 Hermes 的多 Profile 协作功能,将多个 Agent 组织成一支 OPC(一人公司)团队。文章指出,单一 Agent 存在幻觉、记忆污染和角色混乱等问题,因此建议引入类似公司架构的四角色模型:Coordinator(协调员)、Researcher(研究员)、Writer(作家)和 Builder(构建者)。文章详细阐述了 Profile、Subagent、Project 和 Wiki 四个核心概念的区别,并提供了构建稳定 Agent 工作系统的具体配置方法,旨在建立清晰的角色边界和可长期运行的协作体系。 技术 › Hermes ✍ 知野🕐 2026-04-30 HermesAgent多Profile协作OPCWiki知野LLM系统架构团队协作Skill
H Hermes 微信接入保姆级教程:零基础实操手册 本文是一份详细的 Hermes 微信接入教程,专为小白用户设计。文章基于 Ubuntu 环境,详细介绍了从准备微信小号、安装依赖包、扫码绑定、配置文件修改到最终启动 AI 助手的全过程。作者强调无需编程基础,只需按步骤操作即可将 Hermes Agent 接入微信,实现拥有分层记忆的私人 AI 助理。 技术 › Agent ✍ Suu🕐 2026-04-24 Hermes微信接入教程AgentLLM实操指南配置教程