← 返回开源项目

Hermes Agent:自进化AI Agent的工程化典范

Hermes Agent: Engineering Excellence in Self-Evolving AI

🔗 GitHub 项目地址
🎯 核心收获 Key Takeaways
  • 闭环学习系统 - Hermes Agent首创"自进化"机制,从使用经验中自动生成和优化技能
  • Closed-loop Learning - Hermes pioneered self-evolution mechanism, auto-generating and optimizing skills from experience
  • 多平台网关架构 - 单一Agent同时服务Telegram、Discord、飞书等多个平台
  • Multi-platform Gateway - Single Agent serves Telegram, Discord, Feishu and more
  • 持久记忆与用户建模 - 跨会话连续性,AI越来越懂用户
  • Persistent Memory - Cross-session continuity, AI gets smarter about users
  • 技能即资产 - Skills作为可复用、可进化的数字资产沉淀
  • Skills as Assets - Skills as reusable, evolvable digital assets

一、项目概述:重新定义AI Agent

1. Project Overview: Redefining AI Agent

1.1 什么是Hermes Agent

1.1 What is Hermes Agent

Hermes Agent是由Nous Research打造的自改进AI Agent,定位是"与你共同成长的数字分身"(The agent that grows with you)。它不是传统的一问一答工具,而是一个具备学习能力、记忆能力和自我进化能力的智能系统。

Hermes Agent is a self-improving AI Agent built by Nous Research, positioned as "a digital twin that grows with you". It's not a traditional Q&A tool, but an intelligent system with learning, memory, and self-evolution capabilities.

102K+
GitHub Stars
38K+
周增长
6.2K
Commits
364
贡献者

1.2 核心设计理念

1.2 Core Design Philosophy

Hermes Agent的设计哲学可以概括为三点:

Hermes Agent's design philosophy can be summarized in three points:

┌─────────────────────────────────────────────────────────┐
│  1. 学习闭环 (Learning Loop)                            │
│     经验 → 技能 → 优化 → 经验                           │
│                                                         │
│  2. 跨平台统一 (Platform Unity)                        │
│     一个Agent,服务所有沟通渠道                          │
│                                                         │
│  3. 本地优先 (Local-First)                              │
│     运行在$5 VPS,闲时几乎零成本                         │
└─────────────────────────────────────────────────────────┘

二、核心架构解析

2. Core Architecture

2.1 Skills系统(技能引擎)

2.1 Skills System

设计思想:每个成功完成的任务都应该变成可复用的技能。

Design Philosophy: Every successfully completed task should become a reusable skill.

class Skill:
    name: str                    # 技能名称
    trigger: List[str]          # 触发词
    content: str                 # 技能内容(prompt模板)
    examples: List[dict]        # 成功案例
    usage_count: int             # 使用次数
    success_rate: float          # 成功率
    auto_improve: bool          # 是否自动优化

技能分类

Skill Categories:

  • 内置技能(Bundled Skills) - 开箱即用
  • Bundled Skills - Ready to use
  • 可选技能(Optional Skills) - 按需安装
  • Optional Skills - Install on demand
  • 用户技能(User Skills) - 用户自定义
  • User Skills - User-defined
  • AI生成技能(AI-Created Skills) - 完成任务后自动生成
  • AI-Created Skills - Auto-generated after task completion

2.2 Memory系统(记忆引擎)

2.2 Memory System

Hermes的持久记忆系统包含多层架构:

Hermes's persistent memory system includes a multi-layer architecture:

┌─────────────────────────────────────────────────────────┐
│  工作记忆 (Working Memory)                              │
│  - 当前会话上下文                                       │
│  - 最近N轮对话                                         │
├─────────────────────────────────────────────────────────┤
│  语义记忆 (Semantic Memory)                            │
│  - 用户偏好向量                                        │
│  - 项目上下文摘要                                      │
│  - FTS5全文搜索索引                                    │
├─────────────────────────────────────────────────────────┤
│  情景记忆 (Episodic Memory)                            │
│  - 历史会话记录                                        │
│  - 重要事件标注                                        │
│  - LLM压缩后的总结                                     │
├─────────────────────────────────────────────────────────┤
│  程序记忆 (Procedural Memory)                          │
│  - 已掌握的Skills                                      │
│  - 工作流程模式                                        │
└─────────────────────────────────────────────────────────┘

2.3 Gateway系统(消息网关)

2.3 Gateway System

平台 Platform 状态 Status 特点 Features
Telegram最稳定Most stable
Discord服务器友好Server-friendly
Slack企业场景Enterprise
WhatsApp国际化International
Signal隐私优先Privacy-first
飞书中国特色China
钉钉中国特色China

2.4 GEPA引擎:自我进化的核心

2.4 GEPA Engine: Core of Self-Evolution

GEPA = Genetic Evolutionary Prompt Adaptation

GEPA = Genetic Evolutionary Prompt Adaptation

这是Hermes Agent最核心的创新,实现"越用越聪明":

This is Hermes Agent's most core innovation, enabling "getting smarter with use":

class GEPAController:
    def __init__(self):
        self.trajactory_buffer = []
        self.fitness_scores = []
        self.best_prompts = {}
    
    def on_task_complete(self, task, trajectory, outcome):
        """任务完成后触发"""
        # 1. 记录轨迹
        self.trajactory_buffer.append({...})
        
        # 2. 评估效果
        fitness = self.evaluate(outcome)
        
        # 3. 进化技能
        if fitness > self.baseline:
            self.evolve_skill(task, trajectory, fitness)
        
        # 4. 更新基准
        self.update_baseline(fitness)

三、核心技术亮点

3. Core Technical Highlights

3.1 终端后端多样性

3.1 Terminal Backend Diversity

Hermes支持6种运行方式:

Hermes supports 6 running methods:

后端 Backend 适用场景 Use Case 成本 Cost
Local 开发测试 Dev/Test Free
Docker 生产部署 Production Low
SSH 远程服务器 Remote Server Low
Modal Serverless Serverless 几乎零 Near Zero

3.2 模型无关性

3.2 Model Agnostic

Hermes不绑定任何特定模型,支持:

Hermes doesn't bind to any specific model, supports:

  • Nous Portal
  • OpenRouter (200+ models)
  • NVIDIA NIM (Nemotron)
  • Xiaomi MiMo
  • z.ai/GLM (智谱)
  • Kimi/Moonshot
  • MiniMax
  • Hugging Face
  • OpenAI / Anthropic
  • Ollama (本地模型)

四、安装与部署

4. Installation & Deployment

4.1 快速安装

4.1 Quick Install

# 一键安装(Linux/macOS/WSL2)
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash

# 安装后
source ~/.bashrc  # 或 source ~/.zshrc
hermes            # 启动交互式CLI

4.2 配置流程

4.2 Configuration

# 完整配置向导
hermes setup

# 分步配置
hermes model           # 选择模型
hermes tools           # 配置工具
hermes gateway setup   # 配置消息网关

五、与看宝AI的关联思考

5. Insights for KanBao AI

可迁移的设计模式

Transferable Design Patterns

Hermes模式 看宝AI对应
Skills系统 学习笔记模板
Memory系统 知识库索引
Gateway 多渠道推送
Cron 每日学习任务
GEPA 笔记迭代优化

六、总结与展望

6. Summary & Outlook

核心价值:从"工具"到"伙伴"的范式转移

Core Value: Paradigm shift from "tool" to "partner"

  • 闭环学习是关键 - 没有学习能力的Agent只是高级脚本
  • Closed-loop learning is key - Agents without learning are just advanced scripts
  • 记忆即护城河 - 跨会话连续性创造长期价值
  • Memory is moat - Cross-session continuity creates long-term value
  • 技能可沉淀 - 成功经验应该变成可复用资产
  • Skills can compound - Successful experiences should become reusable assets

🔗 相关链接

🔗 Related Links

💡 思考与实践:Hermes的"自进化"机制值得借鉴。看宝AI知识库目前是"静态沉淀"模式,未来可以考虑笔记进化、技能生成、记忆分层等方向。

💡 Reflection: Hermes's "self-evolution" mechanism is worth learning from. KanBao AI knowledge base is currently in "static沉淀" mode, future directions could include skill generation and memory layering.