---> 原文链接:https://mp.weixin.qq.com/s/uAS2_tMjFX7o4j0La3QKWg
Hermes Agent 完全指南
Hermes Agent 是由 Nous Research 开
Hermes Agent 是由 Nous Research 开发的自我进化的 AI Agent,也是目前唯一内置学习循环的 Agent。
GitHub: https://github.com/NousResearch/hermes-agent | Stars: 49.5k ⭐
自我进化的 Agent - 能从经验中创建技能、在使用中改进技能
跨平台运行 - $5 VPS、Serverless (Daytona/Modal)
多渠道接入 - Telegram/Discord/Slack/WhatsApp 等 15+ 平台
47+ 内置工具 - 网络搜索、浏览器自动化、代码执行、图像生成、TTS
持久记忆 - 跨会话的用户模型、对话搜索、技能系统
agent/ - Agent 核心逻辑
gateway/ - 消息网关(Telegram/Discord 等)
skills/ - 内置技能模块
tools/ - 工具集实现
hermes_cli/ - CLI 命令行工具
mcp/ - MCP 协议集成
Agent Loop - 主循环:接收输入 → 思考 → 调用工具 → 处理结果 → 输出
Memory System - 持久记忆:MEMORY.md、USER.md、会话历史
Skills Engine - 技能引擎:动态加载、创建、改进技能
Tool Registry - 工具注册:47+ 内置工具 + MCP 扩展
Gateway Manager - 网关管理:统一处理多平台消息
`curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash`
`source ~/.bashrc # 或 source ~/.zshrc
hermes # 开始对话`
1.克隆仓库: git clone --recurse-submodules https://github.com/NousResearch/hermes-agent.git
2.创建虚拟环境: uv venv venv --python 3.11
3.安装依赖: uv pip install -e ".[all]"
4.配置目录: mkdir -p ~/.hermes/{cron,sessions,logs,memories,skills,pairing}
5.配置 API Key: hermes config set OPENROUTER_API_KEY your-key
6.选择模型: hermes model
| Extra | 说明 | 命令 |
|---|---|---|
| all | 完整安装 | uv pip install -e ".[all]" |
| messaging | Telegram/Discord | uv pip install -e ".[messaging]" |
| cron | 定时任务 | uv pip install -e ".[cron]" |
| voice | 语音模式 | uv pip install -e ".[voice]" |
| mcp | MCP 支持 | uv pip install -e ".[mcp]" |
| 命令 | 功能 |
|---|---|
hermes | 启动交互式 CLI |
hermes model | 选择 LLM 提供商和模型 |
hermes tools | 配置启用的工具 |
hermes config set KEY value | 设置配置项 |
hermes gateway | 管理消息网关 |
hermes setup | 运行完整设置向导 |
hermes doctor | 诊断问题 |
hermes update | 更新到最新版本 |
| 命令 | 功能 |
|---|---|
/new 或 /reset | 开始新对话 |
/model [provider:model] | 切换模型 |
/personality [name] | 设置人格 |
/retry / /undo | 重试/撤销 |
/compress / /usage | 压缩上下文/查看使用 |
/skills 或 / | 浏览技能 |
/platforms | 平台状态 |
Telegram、Discord、Slack、WhatsApp、Signal、Matrix、Email、SMS、DingTalk、飞书、企业微信
`hermes gateway setup # 设置网关
hermes gateway start # 启动网关
hermes gateway stop # 停止网关`
Telegram/Discord: 语音消息转录、语音频道实时对话
Email: SMTP/IMAP 支持
飞书/企业微信: 文���、多维表格、群聊集成
MEMORY.md - 长期记忆:Agent 主动写入的重要信息
USER.md - 用户画像:通过 Honcho 记录的偏好、习惯
Sessions - 对话历史:FTS5 全文搜索 + LLM 摘要
Context Files - 项目上下文:AGENTS.md 定义的指令
1.定期提醒:Agent 周期性提示保存重要信息
2.自动持久化:复杂任务完成后自动写入 MEMORY.md
3.跨会话检索:搜索历史对话,LLM 总结相关片段
4.用户建模:Honcho 持续学习用户偏好
`/hermes-memory # 手动触发记忆保存
/hermes-memory view # 查看当前记忆`
技能是 Agent 从经验中创建的程序化记忆,可以被复用和改进。与 agentskills.io 标准兼容。
skills/ - 官方技能
optional-skills/ - 可选技能
~/.hermes/skills/ - 用户技能
1.创建: 复杂任务完成后,Agent 自动生成技能
2.保存: 存储到 ~/.hermes/skills/
3.复用: 类似场景自动调用
4.改进: 使用中持续优化
| 命令 | 功能 |
|---|---|
/skills | 浏览可用技能 |
/ | 使用指定技能 |
hermes skills create | 手动创建技能 |
| 类别 | 工具 |
|---|---|
| Web | web_search, web_fetch, browse, scrape, extract |
| Vision | vision, image_generation (FLUX), image_edit |
| Audio | tts, voice_clone, audio_transcribe |
| Terminal | execute_code, bash, ipython |
| File | read, write, glob, grep, edit |
| Debug | debug_code, fix_code, explain_error |
`hermes tools # 交互式选择
hermes tools minimal # 仅基础工具
hermes tools coding # 编程工具集`
local - 本地执行
docker - Docker 容器
ssh - 远程 SSH
daytona - Daytona Serverless
modal - Modal Serverless
MCP 是一个标准协议,允许 Hermes 连接外部工具服务器。
`hermes mcp add [args...]`
文件系统访问: hermes mcp add fs uvx mcp-server-fs /path/to/dir
Git 操作: hermes mcp add git uvx @modelcontextprotocol/server-git
数据库: hermes mcp add db uvx mcp-server-sqlite /data.db
`hermes mcp filter --include "read,write" --exclude "delete"`
命令审批: 敏感命令需要用户确认
DM 配对: 私聊需要配对验证
容器隔离: 工具在隔离环境中执行
工作区限制: 文件操作限制在允许目录
`security:
command_approval:
auto_approve_patterns:
- "read-only commands"
- "file glob operations"
dm_policy: pairing # 或 allowlist/blocklist
workspace_root: "/path/to/allowed/directory"`
批量轨迹生成
`python batch_runner.py --task-file tasks.yaml --output-dir ./trajectories`
轨迹压缩
`python trajectory_compressor.py input.jsonl --output compressed.jsonl`
RL 训练 (Tinker-Atropos)
`git submodule update --init tinker-atropos
uv pip install -e "./tinker-atropos"`
Mini SWE 基准测试
`python mini_swe_runner.py --model he`
📖 官方文档
💬 Discord 社区
📦 Skills Hub
🐛 Issues
基于 Hermes Agent 项目文档整理
https://github.com/NousResearch/hermes-agent
💬 本文评论区已开启,但暂无读者留言。
本文转载自微信公众号,如有侵权请联系删除。