博客
首页归档关于搜索

关联站点

CodeRunCommon AuthNav2文件中转站搜索引擎ZBookSBTI 人格测试OSS对象存储在线翻译云笔记

鄂ICP备19019526号

© 2026 博客

  1. 首页
  2. 5 分钟快速上手 Hermes Agent

5 分钟快速上手 Hermes Agent

2026年5月11日·约 15 分钟·4429 字·9 次阅读
AIAI 日报大模型技术前沿
5 分钟快速上手 Hermes Agent

目录

  • 一、环境要求与系统依赖
  • 1.1 操作系统支持
  • 1.2 自动安装的系统依赖
  • 1.3 硬件要求
  • 二、一键安装详解
  • 2.1 Linux / macOS / WSL2 安装
  • 2.2 Windows 原生安装(PowerShell)
  • 2.3 WSL2 详细安装(Windows 用户推荐)
  • 2.4 Android/Termux 安装
  • 2.5 手动安装(开发者路径)
  • 三、交互式配置向导
  • 3.1 运行配置向导
  • 3.2 配置步骤详解
  • 3.3 配置文件详解
  • 3.4 环境变量参考
  • 3.5 切换模型
  • 四、第一次对话
  • 4.1 启动 Hermes Agent
  • 4.2 首次对话示例
  • 4.3 基础 Slash 命令速查
  • 4.4 高级命令
  • 五、接入消息平台(完整指南)
  • 5.1 支持的平台
  • 5.2 配置消息网关
  • 5.3 Telegram 接入详解
  • 5.4 Discord 接入详解
  • 5.5 Slack 接入详解
  • 5.6 系统服务配置(systemd)
  • 六、常见问题排坑指南
  • 6.1 安装问题
  • 6.2 配置问题
  • 6.3 运行问题
  • 6.4 消息网关问题
  • 七、常用命令完整参考
  • 7.1 核心命令
  • 7.2 网关命令
  • 7.3 记忆命令
  • 7.4 技能命令
  • 7.5 开发命令
  • 八、环境配置进阶
  • 8.1 代理配置
  • 8.2 多模型配置
  • 8.3 安全配置
  • 8.4 性能调优
  • 九、保持更新
  • 9.1 自动更新
  • 9.2 回滚
  • 9.3 从源码更新
  • 十、总结

5 分钟快速上手 Hermes Agent

从安装到第一次对话,零基础也能跑起来。

上一篇我们认识了 Hermes Agent 是什么,这一篇直接动手——5 分钟内让它跑起来,开始你的第一次对话。


一、环境要求与系统依赖

1.1 操作系统支持

Hermes Agent 支持多种操作系统,但成熟度略有差异:

操作系统支持状态说明推荐度
Linux (Ubuntu/Debian)✅ 完全支持最推荐的部署环境⭐⭐⭐⭐⭐
Linux (Arch/Manjaro)✅ 完全支持需要手动处理部分依赖⭐⭐⭐⭐
macOS✅ 完全支持和 Linux 一样稳定⭐⭐⭐⭐⭐
WSL2✅ 完全支持Windows 用户首选路径⭐⭐⭐⭐⭐
Windows 原生 (PowerShell)⚠️ Early Beta可用但可能有坑⭐⭐
Android/Termux⚠️ 社区支持需要按照 Termux Guide⭐⭐

1.2 自动安装的系统依赖

安装脚本会自动处理以下依赖:

依赖版本用途自动安装
uv最新Python 包管理器,极速安装✅
Python3.10+运行时环境✅
Node.js18+部分工具(如 Playwright)✅
ripgrep最新快速文本搜索✅
ffmpeg最新语音合成/处理✅
MinGit便携版Windows Git 环境✅ (Windows)

1.3 硬件要求

配置最低要求推荐配置说明
内存2GB8GB+取决于模型大小
磁盘1GB10GB+记忆数据会增长
网络稳定快速稳定模型 API 调用需要

注意:Hermes Agent 本身是客户端,模型调用依赖第三方 API。确保网络稳定。


二、一键安装详解

2.1 Linux / macOS / WSL2 安装

打开终端,运行这一行命令:

curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash

安装脚本执行流程:

[1/6] 检测操作系统... ✓ Ubuntu 22.04
[2/6] 安装 uv... ✓ v0.4.14
[3/6] 安装 Python 3.11... ✓
[4/6] 克隆 Hermes Agent... ✓
[5/6] 安装项目依赖... ✓ 47 packages
[6/6] 配置 PATH... ✓

✅ 安装完成!
运行 'source ~/.bashrc' 刷新环境
然后输入 'hermes' 启动

安装脚本做了什么:

# 等价于手动执行以下步骤:
1. 安装 uv(如果未安装)
   curl -LsSf https://astral.sh/uv/install.sh | sh

2. 克隆仓库
   git clone https://github.com/NousResearch/hermes-agent.git

3. 使用 uv 安装依赖
   cd hermes-agent
   uv sync

4. 添加到 PATH(写入 ~/.bashrc)
   echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc

5. 创建必要目录
   mkdir -p ~/.hermes/memory

安装完成后,刷新终端配置:

source ~/.bashrc  # Bash
source ~/.zshrc   # Zsh (macOS 默认)

2.2 Windows 原生安装(PowerShell)

在 PowerShell 中运行:

irm https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.ps1 | iex

安装内容:

  • 自动安装 uv、Python 3.11、Node.js
  • 下载便携版 MinGit(~45MB,不影响系统 Git)
  • 配置 %LOCALAPPDATA%\hermes\ 目录
  • 添加到系统 PATH

PowerShell 安装流程:

正在下载 uv...
正在安装 Python 3.11...
正在安装 Node.js 18...
正在下载 MinGit (便携版)...
正在配置 Hermes Agent...
正在验证安装...

✅ 安装完成!
运行 'hermes' 启动

⚠️ 注意:Windows 原生支持还在早期 Beta 阶段,遇到问题请在 GitHub Issues 反馈。建议优先使用 WSL2。

2.3 WSL2 详细安装(Windows 用户推荐)

如果你在 Windows 上,推荐使用 WSL2:

Step 1: 启用 WSL2

# 在 PowerShell(管理员)中运行
wsl --install
# 重启电脑

Step 2: 安装 Ubuntu

在 Microsoft Store 搜索 "Ubuntu 22.04 LTS" 并安装。

Step 3: 在 WSL2 中安装 Hermes

# 打开 Ubuntu 终端,运行:
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash

Step 4: 配置 Windows 终端(可选,推荐)

推荐使用 Windows Terminal,获得更好的体验:

# 在 PowerShell 中安装
winget install Microsoft.WindowsTerminal

2.4 Android/Termux 安装

在 Termux 中安装(需要 Termux:Widget):

# 安装 Termux
pkg update && pkg upgrade -y
pkg install python nodejs git curl

# 克隆并安装
git clone https://github.com/NousResearch/hermes-agent.git
cd hermes-agent
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync

# 添加快捷方式到 Termux Widget
echo '#!/bin/bash
cd ~/hermes-agent && uv run hermes' > ~/.shortcuts/hermes
chmod +x ~/.shortcuts/hermes

2.5 手动安装(开发者路径)

如果你想从源码开发或定制:

# 1. 克隆仓库
git clone https://github.com/NousResearch/hermes-agent.git
cd hermes-agent

# 2. 检查 uv
which uv || curl -LsSf https://astral.sh/uv/install.sh | sh

# 3. 同步依赖
uv sync

# 4. 验证安装
uv run hermes doctor

# 5. 启动
uv run hermes

使用 uv run vs 直接 hermes:

方式说明
hermes需要 hermes 在 PATH 中(安装后使用)
uv run hermes使用项目虚拟环境(开发时使用)
./hermes直接运行二进制(不推荐)

三、交互式配置向导

3.1 运行配置向导

安装完成后,运行配置向导:

hermes setup

这是一个交互式的全量配置流程,会引导你完成所有设置:

┌─────────────────────────────────────────────────────────────┐
│           Hermes Agent 配置向导                              │
│              Setup Wizard v0.9.0                            │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  1️⃣  选择模型提供商                                        │
│      [1] Nous Portal (推荐,免费额度)                        │
│      [2] OpenRouter (200+ 模型)                            │
│      [3] OpenAI (GPT-4/GPT-3.5)                           │
│      [4] Anthropic (Claude 系列)                          │
│      [5] 本地模型 (vLLM)                                   │
│      [6] 其他                                              │
│                                                             │
│  > 选择 [1-6]: _                                           │
│                                                             │
└─────────────────────────────────────────────────────────────┘

3.2 配置步骤详解

Step 1: 选择模型提供商

提供商特点免费额度配置难度
Nous Portal原生 OAuth✅ 有⭐ 最简单
OpenRouter200+ 模型❌ 无⭐⭐
OpenAIGPT-4/3.5❌ 无⭐⭐
AnthropicClaude 3❌ 无⭐⭐
Kimi/Moonshot国产性价比✅ 有⭐⭐
本地 vLLM完全私有✅ 零成本⭐⭐⭐⭐

推荐顺序:

  1. 新手:从 Nous Portal 开始(有免费额度)
  2. 进阶:OpenRouter(更多模型选择)
  3. 高级:本地 vLLM(完全私有)

Step 2: 配置 API Key

Nous Portal:
  → 打开 https://portal.nousresearch.com
  → 使用 GitHub 登录
  → 获取 API Key
  → 粘贴到终端

OpenRouter:
  → 打开 https://openrouter.ai/keys
  → 创建 API Key
  → 粘贴到终端

Step 3: 设置工作目录

工作目录:[~/.hermes/workspace]
  这是 Hermes 存储记忆、技能的目录
  可以自定义到其他位置
  
  建议使用默认位置,除非你有特殊需求

Step 4: 选择启用的工具集

工具集选择:
  [1] 最小集(shell, read, write)
  [2] 标准集(+ browser, web_search, github)
  [3] 完整集(+ docker, database, email)
  [4] 自定义
  
  建议选择 [2] 标准集

Step 5: 从 OpenClaw 迁移(可选)

检测到 OpenClaw 数据,是否迁移?
  [1] 是,迁移所有数据
  [2] 只迁移记忆
  [3] 不迁移
  
  → 选择后自动运行迁移工具

3.3 配置文件详解

配置完成后,Hermes 生成 ~/.hermes/config.yaml:

# ~/.hermes/config.yaml

# 模型配置
model:
  provider: openrouter
  model: anthropic/claude-3-haiku-20240307
  api_key: "${OPENROUTER_API_KEY}"  # 从环境变量读取
  
# 工作目录
workspace:
  root: ~/.hermes/workspace
  memory_dir: ~/.hermes/memory
  skills_dir: ~/.hermes/memory/skills
  
# 工具配置
tools:
  enabled:
    - shell
    - read
    - write
    - browser
    - web_search
    - github
  security:
    allow_sudo: false
    allowed_commands:
      - git
      - npm
      - pip
    blocked_patterns:
      - "rm -rf /"
      - "curl.*sh"
      
# 消息网关(可选)
gateway:
  enabled: false
  platforms: []
  
# 记忆配置
memory:
  fts5:
    tokenizer: unicode61
  compression:
    enabled: true
    threshold_tokens: 50000
    
# 日志
logging:
  level: INFO
  file: ~/.hermes/logs/hermes.log

3.4 环境变量参考

Hermes 支持通过环境变量配置敏感信息:

变量名说明示例
OPENROUTER_API_KEYOpenRouter API Keysk-...
OPENAI_API_KEYOpenAI API Keysk-...
ANTHROPIC_API_KEYAnthropic API Keysk-ant-...
KIMI_API_KEYKimi API Keysk-...
GITHUB_TOKENGitHub Tokenghp_...
TELEGRAM_BOT_TOKENTelegram Bot Token123456:ABC...
DISCORD_BOT_TOKENDiscord Bot TokenMTIz...
HERMES_LOG_LEVEL日志级别DEBUG

设置环境变量:

# Linux/macOS/WSL2
export OPENROUTER_API_KEY="sk-or-..."

# Windows (PowerShell)
$env:OPENROUTER_API_KEY="sk-or-..."

# 永久保存(Linux/macOS)
echo 'export OPENROUTER_API_KEY="sk-or-..."' >> ~/.bashrc
source ~/.bashrc

3.5 切换模型

配置完成后,可以随时切换模型:

# 交互式选择
hermes model

# 命令行指定
hermes model openrouter:anthropic/claude-3-haiku-20240307
hermes model openai:gpt-4-turbo

# 查看可用模型
hermes model list

四、第一次对话

4.1 启动 Hermes Agent

配置完成后,启动 Hermes Agent:

hermes

你会看到一个完整的 TUI(终端用户界面):

╔═══════════════════════════════════════════════════════════╗
║                                                           ║
║     🤖  Hermes Agent v0.9.0                              ║
║                                                           ║
║     模型: anthropic/claude-3-haiku                       ║
║     记忆: 活跃 (32 条会话, 8 个技能)                      ║
║     网关: Telegram ✅ | Discord ✅                       ║
║                                                           ║
╠═══════════════════════════════════════════════════════════╣
║                                                           ║
║  > 你好,帮我介绍一下你的能力                             ║
║                                                           ║
║  你好!我是 Hermes,你的 AI 助手。                         ║
║                                                           ║
║  我有以下核心能力:                                        ║
║  • 执行终端命令                                           ║
║  • 读写文件和代码                                         ║
║  • 搜索网页和信息                                         ║
║  • GitHub 操作                                            ║
║  • ...                                                    ║
║                                                           ║
║                                                           ║
║  ─────────────────────────────────────────────────────  ║
║  /help 查看所有命令                                       ║
╚═══════════════════════════════════════════════════════════╝

4.2 首次对话示例

示例 1:了解能力

你:你好,帮我介绍一下你的能力

Hermes:你好!我是 Hermes,一个会学习、会记忆的 AI 助手。

核心能力:
• 持久记忆:我会记住我们讨论的内容,下次对话依然连贯
• 工具调用:可以执行终端命令、读写文件、搜索网页等
• 自动技能:解决复杂问题后会创建可复用的技能
• 多平台:支持 Telegram、Discord、Slack 等

有什么我可以帮你的吗?

示例 2:技术问答

你:帮我解释一下什么是 ReAct 模式

Hermes:ReAct = Reason + Act,是一种让 AI 进行复杂推理的方法:

循环:思考 → 行动 → 观察 → 思考 → ...

示例:
1. Thought:我需要获取这个文件的内容
2. Action:调用 read 工具
3. Observation:文件包含 100 行代码
4. Thought:需要分析代码结构
5. Action:调用分析工具
...

相比单纯的"思考",ReAct 能与外部世界交互,
形成"推理-行动-反馈"的闭环。

示例 3:实际任务

你:帮我创建一个简单的 Python HTTP 服务器

Hermes:
好的,我来创建一个简单的 HTTP 服务器文件。

[调用 write 工具,写入 server.py]
[执行并测试]

完成!已创建 server.py:

```python
from http.server import HTTPServer, SimpleHTTPRequestHandler

def run(port=8000):
    server = HTTPServer(('0.0.0.0', port), SimpleHTTPRequestHandler)
    print(f'服务器运行在 http://localhost:{port}')
    server.serve_forever()

if __name__ == '__main__':
    run()

运行方式:

python server.py

然后访问 http://localhost:8000


### 4.3 基础 Slash 命令速查

在对话中,可以使用以下斜杠命令:

| 命令 | 功能 | 示例 |
|------|------|------|
| `/new` | 开始新对话 | `/new` |
| `/reset` | 重置对话 | `/reset` |
| `/model [name]` | 切换模型 | `/model gpt-4` |
| `/personality [name]` | 设置性格 | `/personality creative` |
| `/retry` | 重试上次回复 | `/retry` |
| `/undo` | 撤销上一轮 | `/undo` |
| `/compress` | 压缩上下文 | `/compress` |
| `/usage` | 查看 token 使用 | `/usage` |
| `/skills` | 浏览可用技能 | `/skills` |
| `/skills search [keyword]` | 搜索技能 | `/skills search api` |
| `/memory` | 查看记忆状态 | `/memory` |
| `/memory stats` | 记忆统计 | `/memory stats` |
| `/search [query]` | 搜索历史 | `/search api authentication` |
| `/stop` | 中断当前任务 | `/stop` |
| `/status` | 查看平台状态 | `/status` |
| `/doctor` | 运行诊断 | `/doctor` |
| `/help` | 显示帮助 | `/help` |

### 4.4 高级命令

| 命令 | 功能 | 示例 |
|------|------|------|
| `/model list` | 列出所有模型 | `/model list` |
| `/model cost [model]` | 查看模型价格 | `/model cost gpt-4` |
| `/skills create` | 创建技能 | `/skills create` |
| `/skills update [name]` | 更新技能 | `/skills update api-analysis` |
| `/memory export` | 导出记忆 | `/memory export backup.json` |
| `/memory import [file]` | 导入记忆 | `/memory import backup.json` |
| `/config show` | 显示配置 | `/config show` |
| `/config set [key] [value]` | 修改配置 | `/config set model gpt-4` |
| `/gateway status` | 网关状态 | `/gateway status` |
| `/gateway restart` | 重启网关 | `/gateway restart` |

---

## 五、接入消息平台(完整指南)

### 5.1 支持的平台

| 平台 | 状态 | 安全性 | 配置难度 |
|------|------|--------|---------|
| **Telegram** | ✅ 稳定 | ⭐⭐⭐⭐⭐ | ⭐ |
| **Discord** | ✅ 稳定 | ⭐⭐⭐⭐ | ⭐⭐ |
| **Slack** | ✅ 稳定 | ⭐⭐⭐⭐ | ⭐⭐ |
| **WhatsApp** | ⚠️ Beta | ⭐⭐⭐ | ⭐⭐⭐ |
| **Signal** | ⚠️ Beta | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ |
| **IRC** | ⚠️ 早期 | ⭐⭐⭐ | ⭐⭐ |
| **Matrix** | ⚠️ 早期 | ⭐⭐⭐⭐ | ⭐⭐ |
| **WeChat** | 🔜 规划中 | - | - |

### 5.2 配置消息网关

```bash
hermes gateway setup

交互式向导会引导你连接各个平台:

┌─────────────────────────────────────────────────────────────┐
│              Hermes Gateway 配置向导                          │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  选择要配置的平台:                                          │
│                                                             │
│  [ ] Telegram                                               │
│  [ ] Discord                                                │
│  [ ] Slack                                                  │
│  [ ] WhatsApp                                               │
│  [ ] Signal                                                 │
│                                                             │
│  按空格选择,回车确认                                        │
│                                                             │
└─────────────────────────────────────────────────────────────┘

5.3 Telegram 接入详解

Step 1: 创建 Bot

  1. 在 Telegram 搜索 @BotFather
  2. 发送 /newbot
  3. 按提示设置 Bot 名称
  4. 获得 Bot Token(格式:123456789:ABCdefGHIjklMNOpqrsTUVwxyz)

Step 2: 获取你的 User ID

  1. 在 Telegram 搜索 @userinfobot
  2. 发送任意消息
  3. 获取你的 Chat ID(数字格式,如 123456789)

Step 3: 配置 Hermes

hermes gateway setup
# 选择 Telegram
# 粘贴 Bot Token
# 输入允许的 User ID(可选,用于白名单)

手动配置(编辑 config.yaml):

gateway:
  enabled: true
  platforms:
    - type: telegram
      bot_token: "${TELEGRAM_BOT_TOKEN}"
      allowed_users:  # 可选,白名单
        - 123456789
        - 987654321
      max_message_length: 4096
      rate_limit:
        messages_per_minute: 10

Step 4: 启动网关

# 前台运行(测试用)
hermes gateway

# 后台运行
hermes gateway start

# 安装为系统服务(推荐)
hermes gateway install

Step 5: 开始对话

在 Telegram 找到你创建的 Bot,发送消息即可:

你:你好,介绍一下自己

Hermes:你好!我是 Hermes...

5.4 Discord 接入详解

Step 1: 创建 Discord Application

  1. 打开 https://discord.com/developers/applications
  2. 点击 "New Application"
  3. 设置名称
  4. 在 "Bot" 页面获取 Bot Token

Step 2: 配置权限

在 OAuth2 → URL Generator:
  Scopes: ✅ bot
  Bot Permissions: 
    ✅ Send Messages
    ✅ Read Message History
    ✅ Use Slash Commands

复制生成的 URL,访问并授权给服务器。

Step 3: 配置 Hermes

gateway:
  enabled: true
  platforms:
    - type: discord
      bot_token: "${DISCORD_BOT_TOKEN}"
      allowed_guilds:  # 可选,限制服务器
        - "server-id-1"
      allowed_channels:  # 可选,限制频道
        - "channel-id-1"

Step 4: 启动

hermes gateway

5.5 Slack 接入详解

Step 1: 创建 Slack App

  1. 打开 https://api.slack.com/apps
  2. 点击 "Create New App" → "From scratch"
  3. 设置名称和工作区

Step 2: 配置 Bot

Features → Bot User:
  ✅ Always Show My Bot as Online
  
OAuth & Permissions:
  添加 Scopes:
    - chat:write
    - channels:history
    - groups:history
    - im:history
    - mpim:history

Step 3: 安装到工作区

OAuth & Permissions → Install to Workspace
复制 Bot User OAuth Token

Step 4: 配置 Hermes

gateway:
  enabled: true
  platforms:
    - type: slack
      bot_token: "${SLACK_BOT_TOKEN}"
      signing_secret: "${SLACK_SIGNING_SECRET}"
      app_token: "${SLACK_APP_TOKEN}"

5.6 系统服务配置(systemd)

安装为 systemd 服务:

hermes gateway install

手动创建服务(Linux):

# 创建服务文件
sudo nano /etc/systemd/system/hermes.service
[Unit]
Description=Hermes Agent Gateway
After=network.target

[Service]
Type=simple
User=your-username
WorkingDirectory=/home/your-username
ExecStart=/home/your-username/.local/bin/hermes gateway
Restart=always
RestartSec=10
Environment=OPENROUTER_API_KEY=sk-or-...

[Install]
WantedBy=multi-user.target
# 启用并启动
sudo systemctl daemon-reload
sudo systemctl enable hermes
sudo systemctl start hermes

# 查看状态
sudo systemctl status hermes

# 查看日志
journalctl -u hermes -f

六、常见问题排坑指南

6.1 安装问题

Q: 安装时提示 "Permission denied"

问题:curl: (23) Failed to write body to ... Permission denied
原因:没有写入权限
解决:确保使用普通用户安装,不要用 sudo

Q: WSL2 下找不到 hermes 命令

# 刷新 shell 配置
source ~/.bashrc

# 或者手动检查 PATH
echo $PATH | grep -q .local/bin && echo "OK" || echo "Missing"

# 如果确实没有,添加 PATH
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

# 验证
which hermes

Q: Windows PowerShell 安装报错

问题:无法加载文件 ... install.ps1,因为在此系统上禁止运行脚本
原因:PowerShell 执行策略限制
解决:
  1. 以管理员身份打开 PowerShell
  2. 运行:Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
  3. 重新运行安装脚本

Q: 提示 "uv: command not found"

# 手动安装 uv
curl -LsSf https://astral.sh/uv/install.sh | sh
source ~/.bashrc  # 或 source ~/.zshrc

6.2 配置问题

Q: 模型配置失败

# 检查 API Key
hermes config show

# 测试 API Key
curl -s https://openrouter.ai/api/v1/models \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" | head

# 重新配置
hermes model

Q: 提示 "Invalid API key"

原因 1:API Key 格式错误
解决:检查 Key 是否完整,复制时不要遗漏字符

原因 2:API Key 过期或额度用完
解决:登录对应平台检查

原因 3:环境变量未加载
解决:确认 export 已执行

Q: 无法连接代理

# 设置代理
export HTTP_PROXY="http://proxy.example.com:8080"
export HTTPS_PROXY="http://proxy.example.com:8080"

# 或者在配置文件中设置
hermes config set http_proxy "http://proxy.example.com:8080"

6.3 运行问题

Q: 启动时报错 "Database is locked"

# 修改配置,增加超时
memory:
  fts5:
    timeout: 30000  # 毫秒

Q: 工具调用失败

# 运行诊断
hermes doctor

# 检查工具状态
hermes tools list

# 重新安装工具
hermes tools reinstall

Q: 内存占用过高

# 启用内存压缩
memory:
  compression:
    enabled: true
    threshold_tokens: 30000

# 清理旧会话
/memory cleanup --older-than 30d

6.4 消息网关问题

Q: Telegram Bot 无响应

排查步骤:
1. 检查 Bot Token 是否正确
2. 检查 Bot 是否已被停用
3. 检查 allowed_users 白名单
4. 查看网关日志
# 查看网关日志
journalctl -u hermes -n 50 --no-pager

# 测试 Bot Token
curl -s "https://api.telegram.org/bot<YOUR_TOKEN>/getMe"

Q: Discord 无法识别命令

排查步骤:
1. 确认 Bot 已加入服务器
2. 检查权限设置
3. 重新注册 Slash Commands
# 重新注册 Slash Commands
hermes gateway --reinstall-commands

七、常用命令完整参考

7.1 核心命令

命令功能示例
hermes启动交互式 CLIhermes
hermes setup运行全量配置向导hermes setup
hermes model选择/切换模型hermes model
hermes model [name]直接指定模型hermes model gpt-4
hermes model list列出所有模型hermes model list
hermes tools配置工具集hermes tools
hermes config set [k] [v]设置配置项hermes config set log debug
hermes config show显示配置hermes config show

7.2 网关命令

命令功能示例
hermes gateway启动消息网关hermes gateway
hermes gateway setup配置消息平台hermes gateway setup
hermes gateway install安装为系统服务hermes gateway install
hermes gateway start启动网关服务hermes gateway start
hermes gateway stop停止网关服务hermes gateway stop
hermes gateway restart重启网关hermes gateway restart
hermes gateway status查看网关状态hermes gateway status

7.3 记忆命令

命令功能示例
/memory查看记忆状态/memory
/memory stats详细统计/memory stats
/memory list列出所有记忆/memory list
/memory search [q]搜索记忆/memory search api
/memory add [text]添加记忆/memory add 我的项目是 X
/memory update [id] [text]更新记忆/memory update 1 新内容
/memory delete [id]删除记忆/memory delete 1
/memory cleanup [--days N]清理旧记忆/memory cleanup --days 30
/memory export [file]导出记忆/memory export backup.json
/memory import [file]导入记忆/memory import backup.json

7.4 技能命令

命令功能示例
/skills浏览所有技能/skills
/skills list列出技能/skills list
/skills search [keyword]搜索技能/skills search api
/skills info [name]查看技能详情/skills info api-analysis
/skills create创建技能/skills create
/skills update [name]更新技能/skills update api-analysis
/skills delete [name]删除技能/skills delete old-skill
/skills run [name]运行技能/skills run api-analysis
/skills share [name]分享技能/skills share api-analysis

7.5 开发命令

命令功能示例
hermes update更新到最新版本hermes update
hermes update --check检查更新hermes update --check
hermes doctor运行诊断检查hermes doctor
hermes doctor --fix自动修复问题hermes doctor --fix
hermes claw migrate从 OpenClaw 迁移hermes claw migrate
hermes shell打开调试 shellhermes shell
hermes version查看版本hermes version

八、环境配置进阶

8.1 代理配置

# ~/.hermes/config.yaml
network:
  http_proxy: "http://proxy.example.com:8080"
  https_proxy: "http://proxy.example.com:8080"
  no_proxy: "localhost,127.0.0.1"

8.2 多模型配置

# ~/.hermes/config.yaml
models:
  default: openrouter:anthropic/claude-3-haiku
  
  # 按场景选择
  presets:
    research: openrouter:anthropic/claude-3-opus
    fast: openrouter:anthropic/claude-3-haiku
    coding: openrouter:openai/gpt-4-turbo
    
  # 路由规则
  routing:
    - pattern: ".*代码.*"
      model: coding
    - pattern: ".*研究.*"
      model: research
    - default: fast

8.3 安全配置

# ~/.hermes/config.yaml
security:
  # 允许的用户(白名单)
  allowed_users:
    - 123456789  # Telegram User ID
    - 987654321  # Discord User ID
    
  # 工具权限
  tools:
    shell:
      allowed_commands:
        - git
        - npm
        - pip
        - python
      blocked_patterns:
        - "rm -rf /"
        - "curl.*sh"
        - "wget.*sh"
    docker:
      enabled: true
      readonly: true
    github:
      enabled: true
      max_rate_per_hour: 50

8.4 性能调优

# ~/.hermes/config.yaml
performance:
  # 并发设置
  max_concurrent_tools: 3
  
  # 缓存
  cache:
    enabled: true
    ttl_seconds: 3600
    max_size_mb: 100
    
  # 模型超时
  model_timeout: 120
  
  # 记忆压缩
  memory:
    auto_compress: true
    compress_threshold_tokens: 40000
    keep_recent_messages: 20

九、保持更新

9.1 自动更新

# 检查更新
hermes update --check

# 更新到最新版本
hermes update

# 更新到特定版本
hermes update --version 0.9.1

9.2 回滚

# 查看历史版本
git tag

# 回滚到上一个版本
git checkout v0.9.0

# 或者使用 uv
uv sync --python 3.11

9.3 从源码更新

cd ~/hermes-agent
git pull
uv sync

十、总结

恭喜!你现在应该已经:

✅ 成功安装 Hermes Agent ✅ 完成基础配置 ✅ 在 CLI 中进行了第一次对话 ✅ (可选)接入了一个消息平台

下一步,深入了解 Hermes Agent 的核心能力:

文章内容
持久记忆系统让它真正"认识"你
自动技能创建解决难题后永不遗忘
定时任务设置自动化工作流

系列文章预告:

下一篇:《持久记忆系统——让 AI 真正"认识"你》


有任何问题,欢迎在评论区留言或加入 Discord 社区讨论。

相关文章

  • 【AI 日报】2026年05月12日 AI 最新动态5月12日
  • AI原生架构(十):通向ASI之路——AI原生应用的未来展望5月12日
  • AI原生架构(九):AI应用运行时——驾驭不确定性的执行基座5月12日

系列:Hermes-Agent系列

  • 1. 5 分钟快速上手 Hermes Agent
  • 2. 持久记忆系统——让 AI 真正“认识”你
  • 3. 技术架构全解析——Hermes Agent 是如何设计的
  • 4. Skills 系统深度解剖——掌握 Hermes Agent 的技能生态
  • 6. Cron 定时任务——用自然语言设置自动化
  • 6. MLOps 与研究能力——Hermes Agent 的隐藏王炸
  • 7. 与 OpenClaw 对比及迁移指南——系列完结篇
  • 8. Hermes-Agent(八):消息网关深度指南——统一多平台接入的核心枢纽
  • 9. 最佳实践与生态展望——Hermes Agent 深度使用指南
持久记忆系统——让 AI 真正“认识”你 →

评论

加载评论中…

发表评论

返回首页