乐于分享
好东西不私藏

Hermes AI 智能体:基于官方文档的正确安装和使用 Playbook

Hermes AI 智能体:基于官方文档的正确安装和使用 Playbook

Hermes AI 智能体:基于官方文档的正确安装和使用 Playbook

本文基于 Hermes 官方 GitHub 仓库(https://github.com/NousResearch/hermes-agent)和官方文档编写,提供正确的安装和使用指南。[1]

📋 官方信息确认

官方仓库:https://github.com/NousResearch/hermes-agent[2]官方文档:https://hermes-agent.nousresearch.com/docs/[3]Discord:https://discord.gg/NousResearch[4]

🚀 正确的安装方法

1. 一键安装(Linux/macOS/WSL2)

# 官方推荐的一键安装命令curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash

2. Windows 安装(早期 beta 版本)

# PowerShell 中运行irm https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.ps1 | iex

注意:Windows 原生支持是早期 beta 版本,建议使用 WSL2。

3. 安装后配置

# 重新加载 shellsource ~/.bashrc  # 或 source ~/.zshrc# 启动 Hermeshermes

🎯 Hermes 核心特点(官方描述)

根据官方 README,Hermes 的核心特点是:

1. 自我进化的 AI 智能体

  • 内置学习循环,从经验中创建技能
  • 使用过程中改进技能
  • 推动自身持续学习知识
  • 搜索过去的对话记录
  • 构建跨会话的用户模型

2. 灵活的模型支持

  • Nous Portal
  • OpenRouter(200+ 模型)
  • NovitaAI
  • NVIDIA NIM(Nemotron)
  • 小米 MiMo
  • z.ai/GLM
  • Kimi/Moonshot
  • MiniMax
  • Hugging Face
  • OpenAI
  • 自定义端点

3. 多平台支持

  • Telegram
  • Discord
  • Slack
  • WhatsApp
  • Signal
  • CLI

4. 真正的终端界面

  • 完整的 TUI 界面
  • 多行编辑
  • 斜杠命令自动补全
  • 对话历史
  • 中断和重定向
  • 流式工具输出

📖 正确的使用方式

基本命令

# 交互式 CLI - 开始对话hermes# 选择 LLM 提供商和模型hermes model# 配置启用的工具hermes tools# 设置单个配置值hermes config set# 启动消息网关(Telegram、Discord 等)hermes gateway# 运行完整设置向导hermes setup# 从 OpenClaw 迁移hermes claw migrate# 更新到最新版本hermes update# 诊断问题hermes doctor

CLI 与消息平台的命令对比

操作
CLI
消息平台
开始聊天
hermes
运行 hermes gateway setup + hermes gateway start,然后给机器人发消息
开始新对话
/new

 或 /reset
/new

 或 /reset
更改模型
/model [provider:model] /model [provider:model]
设置个性
/personality [name] /personality [name]
重试或撤销上一轮
/retry

/undo
/retry

/undo
压缩上下文/检查使用情况
/compress

/usage/insights [--days N]
/compress

/usage/insights [days]
浏览技能
/skills

 或 /<skill-name>
/<skill-name>
中断当前工作
Ctrl+C 或发送新消息
/stop

 或发送新消息
平台特定状态
/platforms /status

/sethome

🔧 配置 Hermes

配置文件位置

Hermes 的配置通常存储在 ~/.hermes/config.toml 或环境变量中。

主要配置项

# 示例配置[provider.openai]api_key = "sk-你的API密钥"[model]provider = "openai"model_name = "gpt-4-turbo"[tools]enabled = ["terminal""web_search""file_system"][memory]enabled = truestorage_path = "~/.hermes/memory"[gateway.telegram]enabled = truetoken = "你的Telegram机器人令牌"

环境变量

# 设置 OpenAI API 密钥export OPENAI_API_KEY="sk-你的API密钥"# 设置 OpenRouter API 密钥  export OPENROUTER_API_KEY="sk-你的OpenRouter密钥"# 设置其他提供商export ANTHROPIC_API_KEY="你的Anthropic密钥"export GOOGLE_API_KEY="你的Google密钥"

🛠️ 工具系统

Hermes 支持 40+ 内置工具,包括:

基础工具

  • terminal – 终端命令执行
  • file_system – 文件系统操作
  • web_search – 网络搜索
  • browser – 浏览器自动化

开发工具

  • code_interpreter – 代码解释器
  • git – Git 操作
  • docker – Docker 容器管理

系统工具

  • process_manager – 进程管理
  • system_info – 系统信息
  • network_tools – 网络工具

启用工具

# 查看可用工具hermes tools list# 启用特定工具hermes tools enable terminal web_search file_system# 禁用工具hermes tools disable browser

🧠 技能系统

查看技能

# 列出所有技能hermes skills list# 查看特定技能hermes skills show <skill-name>

创建技能

Hermes 可以从复杂的任务中自主创建技能,也可以通过手动定义创建。

📚 官方文档结构

所有官方文档位于:https://hermes-agent.nousresearch.com/docs/[5]

章节
内容
快速开始[6]
安装 → 设置 → 2分钟内开始第一次对话
CLI 使用[7]
命令、快捷键、个性、会话
配置[8]
配置文件、提供商、模型、所有选项
消息网关[9]
Telegram、Discord、Slack、WhatsApp、Signal、Home Assistant
安全[10]
命令批准、DM 配对、容器隔离
工具和工具集[11]
40+ 工具、工具集系统、终端后端
技能系统[12]
程序性记忆、技能中心、创建技能
记忆[13]
持久记忆、用户档案、最佳实践
MCP 集成[14]
连接任何 MCP 服务器以扩展功能
Cron 调度[15]
带平台交付的定时任务
上下文文件[16]
塑造每次对话的项目上下文
架构[17]
项目结构、代理循环、关键类
贡献[18]
开发设置、PR 流程、代码风格
CLI 参考[19]
所有命令和标志
环境变量[20]
完整的环境变量参考

🔄 从 OpenClaw 迁移

Hermes 可以自动导入 OpenClaw 的设置、记忆、技能和 API 密钥。

首次设置时迁移

设置向导会自动检测 ~/.openclaw 并在配置开始前提供迁移选项。

安装后迁移

# 交互式迁移(完整预设)hermes claw migrate# 预览迁移内容hermes claw migrate --dry-run# 仅迁移用户数据(不迁移密钥)hermes claw migrate --preset user-data# 覆盖现有冲突hermes claw migrate --overwrite

迁移内容包括:

  • SOUL.md – 个性文件
  • 记忆 – MEMORY.md 和 USER.md 条目
  • 技能 – 用户创建的技能 → ~/.hermes/skills/openclaw-imports/
  • 命令白名单 – 批准模式
  • 消息设置 – 平台配置、允许的用户、工作目录
  • API 密钥 – 白名单密钥(Telegram、OpenRouter、OpenAI、Anthropic、ElevenLabs)
  • TTS 资源 – 工作区音频文件
  • 工作区指令 – AGENTS.md(使用 --workspace-target

🐛 故障排除

常见问题

1. 安装失败

# 运行诊断工具hermes doctor# 检查系统要求python --version  # 需要 Python 3.11+node --version    # 需要 Node.js

2. API 密钥问题

# 设置环境变量export OPENAI_API_KEY="sk-你的密钥"# 或在配置文件中设置hermes config set provider.openai.api_key "sk-你的密钥"

3. 工具启用失败

# 检查工具状态hermes tools status# 重新启用工具hermes tools enable --force terminal

4. 网络连接问题

# 检查网络连接hermes doctor --network# 测试 API 端点curl https://api.openai.com/v1/models -H "Authorization: Bearer $OPENAI_API_KEY"

🚀 快速开始指南

2分钟快速开始

# 1. 安装 Hermescurl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash# 2. 重新加载 shellsource ~/.bashrc# 3. 运行设置向导hermes setup# 4. 开始对话hermes

5分钟进阶设置

# 1. 配置模型提供商hermes model# 2. 启用常用工具hermes tools enable terminal web_search file_system code_interpreter# 3. 设置 Telegram 网关hermes gateway setup telegramhermes gateway start telegram# 4. 配置定时任务hermes cron add --name "daily-backup" --schedule "0 2 * * *" --command"backup home"

📊 与 OpenClaw 的对比

特性
Hermes
OpenClaw
核心架构
围绕学习代理的网关
围绕消息网关的代理
学习能力
内置学习循环,自主创建和改进技能
主要依赖预定义工具和技能
部署方式
单机、Docker、SSH、Singularity、Modal、Daytona、Vercel Sandbox
主要是本地部署
成本模型
支持服务器无持久化,空闲时成本接近零
通常是持续运行
模型支持
200+ 模型,多提供商支持
主要支持主流提供商
平台集成
Telegram、Discord、Slack、WhatsApp、Signal、Email
类似,但具体实现可能不同
迁移支持
提供完整的 OpenClaw 迁移工具
不提供到其他系统的迁移

💡 最佳实践

1. 从简单开始

# 先使用基本配置hermes setup --minimal# 逐步添加功能hermes tools enable terminalhermes tools enable web_search

2. 利用学习能力

  • 让 Hermes 从复杂任务中自主创建技能
  • 定期使用 /skills 查看学到的技能
  • 使用 /compress 优化上下文使用

3. 安全配置

# 启用命令批准hermes config set security.command_approval true# 设置工作目录限制hermes config set security.working_directory "~/hermes-workspace"

4. 性能优化

# 监控使用情况hermes usage# 压缩旧对话hermes compress --days 7# 清理临时文件hermes doctor --clean

🎯 生产部署

部署选项

1. 单机部署

# 安装为系统服务sudo hermes install --systemd# 启动服务sudo systemctl start hermes

2. Docker 部署

# 使用官方 Docker 镜像docker run -d \  -v ~/.hermes:/root/.hermes \  -e OPENAI_API_KEY="sk-你的密钥" \  ghcr.io/nousresearch/hermes-agent:latest

3. 服务器无部署(Modal)

# 部署到 Modalhermes deploy modal

4. VPS 部署($5/月)

# 在 VPS 上安装ssh user@vps-ip "curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash"

📝 总结

Hermes 的核心优势

  1. 真正的自主学习:内置学习循环,从经验中创建和改进技能
  2. 灵活的部署:从 $5 VPS 到 GPU 集群,支持服务器无架构
  3. 广泛的模型支持:200+ 模型,无供应商锁定
  4. 完整的多平台集成:CLI、Telegram、Discord、Slack、WhatsApp、Signal
  5. 平滑的 OpenClaw 迁移:完整的配置和记忆迁移工具

开始使用建议

  1. 先试用 CLIhermes 命令开始交互式对话
  2. 逐步配置:从基本配置开始,逐步添加工具和集成
  3. 利用官方文档:https://hermes-agent.nousresearch.com/docs/[21]
  4. 加入社区:https://discord.gg/NousResearch[22]

注意事项

  1. Windows 支持是早期 beta:建议使用 WSL2 获得最佳体验
  2. 注意 API 成本:监控使用情况,设置预算限制
  3. 安全第一:在生产环境中启用命令批准和访问控制

现在你有了基于官方文档的正确信息! 按照这个 playbook 的步骤,你可以正确安装和使用 Hermes AI 智能体。如果遇到问题,请查阅官方文档或加入 Discord 社区寻求帮助。

本文基于 Hermes 官方 GitHub 仓库(https://github.com/NousResearch/hermes-agent)编写,确保信息的准确性。[23]

引用链接

[1]https://github.com/NousResearch/hermes-agent)和官方文档编写,提供正确的安装和使用指南。: https://github.com/NousResearch/hermes-agent%EF%BC%89%E5%92%8C%E5%AE%98%E6%96%B9%E6%96%87%E6%A1%A3%E7%BC%96%E5%86%99%EF%BC%8C%E6%8F%90%E4%BE%9B%E6%AD%A3%E7%A1%AE%E7%9A%84%E5%AE%89%E8%A3%85%E5%92%8C%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97%E3%80%82

[2]https://github.com/NousResearch/hermes-agent

[3]https://hermes-agent.nousresearch.com/docs/

[4]https://discord.gg/NousResearch

[5]https://hermes-agent.nousresearch.com/docs/

[6]快速开始: https://hermes-agent.nousresearch.com/docs/getting-started/quickstart

[7]CLI 使用: https://hermes-agent.nousresearch.com/docs/user-guide/cli

[8]配置: https://hermes-agent.nousresearch.com/docs/user-guide/configuration

[9]消息网关: https://hermes-agent.nousresearch.com/docs/user-guide/messaging

[10]安全: https://hermes-agent.nousresearch.com/docs/user-guide/security

[11]工具和工具集: https://hermes-agent.nousresearch.com/docs/user-guide/features/tools

[12]技能系统: https://hermes-agent.nousresearch.com/docs/user-guide/features/skills

[13]记忆: https://hermes-agent.nousresearch.com/docs/user-guide/features/memory

[14]MCP 集成: https://hermes-agent.nousresearch.com/docs/user-guide/features/mcp

[15]Cron 调度: https://hermes-agent.nousresearch.com/docs/user-guide/features/cron

[16]上下文文件: https://hermes-agent.nousresearch.com/docs/user-guide/features/context-files

[17]架构: https://hermes-agent.nousresearch.com/docs/developer-guide/architecture

[18]贡献: https://hermes-agent.nousresearch.com/docs/developer-guide/contributing

[19]CLI 参考: https://hermes-agent.nousresearch.com/docs/reference/cli-commands

[20]环境变量: https://hermes-agent.nousresearch.com/docs/reference/environment-variables

[21]https://hermes-agent.nousresearch.com/docs/

[22]https://discord.gg/NousResearch

[23]https://github.com/NousResearch/hermes-agent)编写,确保信息的准确性。: https://github.com/NousResearch/hermes-agent%EF%BC%89%E7%BC%96%E5%86%99%EF%BC%8C%E7%A1%AE%E4%BF%9D%E4%BF%A1%E6%81%AF%E7%9A%84%E5%87%86%E7%A1%AE%E6%80%A7%E3%80%82