稷然如此

  • 首页
  • 文章分类
    • AI
    • Android
    • Java
    • Golang
    • Shell
    • Vue
    • C#
    • Python
    • 数据库
    • 组件
    • 其他
    • Game
  • 常用命令
    • Docker
    • Git
    • Linux
  • 操作系统
    • CentOS
    • Ubuntu
    • Windows
    • Kylin
    • Euler
  • 工具
    • IntelliJ IDEA
    • Visual Studio Code
稷然如此
不积跬步,无以至千里
  1. 首页
  2. 文章分类
  3. AI
  4. 正文

Open Euler 部署 Hermes Agent

2026年5月28日 12点热度 0人点赞

1.简介

什么是 Hermes Agent?
Hermes Agent 是一个跑在终端里的 AI Agent,和 Claude Code(Anthropic)、OpenAI Codex 属于同一类别 —— 能自主调用工具、操作文件系统、执行命令。但它有几个独特优势:
特性说明
多模型支持OpenRouter、Anthropic、DeepSeek、MiniMax 等 20+ 提供商自由切换
跨平台消息Telegram、Discord、Slack、飞书、微信……同一 Agent 接入所有平台
持久记忆跨 session 记住你的身份、偏好、环境配置
技能学习把复杂工作流存成可复用技能,下一次直接加载
定时任务内置 Cron 调度,不用额外配置
官网: https://hermes-agent.nousresearch.com/
GitHub: https://github.com/NousResearch/hermes-agent

2.环境准备

支持的操作系统:
    • Linux(Ubuntu 20.04+、Debian、Arch 等)
    • macOS(Intel & Apple Silicon)
    • Windows WSL2(推荐用 Ubuntu 子系统)
前置要求:
    • Python 3.10+(检查:python3 --version)
    • Git 安装参考:Open Euler 安装 Git
    • tar (解压缩)安装参考:Open Euler 安装 tar
    • curl(用于下载安装脚本)
    • pip(Python 包管理)
    • 一个 LLM 提供商的 API Key(见下文)
推荐模型提供商
如果你已经有以下任意服务的 API Key,直接填入就能用:
提供商说明获取地址
OpenRouter聚合 100+ 模型,按量付费https://openrouter.ai/
AnthropicClaude 系列https://console.anthropic.com/
DeepSeek性价比高https://platform.deepseek.com/
MiniMax国内可用https://platform.minimaxi.com/
硅基流动国内可用https://siliconflow.cn/

3.安装

1.一键安装
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
脚本会自动:
    • 检测你的系统环境
    • 创建虚拟环境 ~/.hermes/venv/
    • 安装依赖包
    • 下载主程序
    • 添加 hermes 命令到 PATH
2.手动安装
# 克隆仓库
git clone https://github.com/NousResearch/hermes-agent.git ~/.hermes/hermes-agent
cd ~/.hermes/hermes-agent

# 创建虚拟环境
python3 -m venv venv
source venv/bin/activate

# 安装
pip install -e .

4.验证

hermes --version

5.配置

启动配置向导:
hermes setup
交互式向导会依次询问:
1. 选择模型提供商(OpenRouter / Anthropic / DeepSeek / ...)
2. 输入 API Key
3. 选择终端配色主题
4. 配置消息平台(可选,跳过也行)
5. 启用需要的工具集
跟着提示走,2 分钟搞定基础配置。

6.目录结构

安装后,Hermes 在 ~/.hermes/ 下生成以下结构:
~/.hermes/
├── config.yaml          # 主配置文件
├── .env                 # API Key 等敏感信息
├── skills/             # 安装的技能包
├── sessions/           # 对话历史记录
├── logs/               # 日志文件
└── hermes-agent/       # 源代码(git 安装时才有)
手动配置文件
# 查看当前配置
hermes config

# 编辑配置
hermes config edit

# 查看配置路径
hermes config path
config.yaml 核心配置项:
model:
  default: anthropic/claude-sonnet-4-6
  provider: openrouter
  api_key: ${OPENROUTER_API_KEY}

agent:
  max_turns: 90
  tool_use_enforcement: true

terminal:
  backend: local
  timeout: 180

memory:
  memory_enabled: true
  user_profile_enabled: true
.env 文件示例:
# OpenRouter
OPENROUTER_API_KEY=sk-or-v1-xxxxx

# 或 Anthropic
ANTHROPIC_API_KEY=sk-ant-xxxxx

# 或 DeepSeek
DEEPSEEK_API_KEY=sk-xxxxx

7.快速上手

1.交互式对话
安装配置完成后,直接输入:
hermes
你会看到欢迎  banner,然后就可以用自然语言和它对话了:
$ hermes
[Hermes Agent v2.x.x]
Type /help for commands.

You: 帮我查看当前目录有什么文件
2.单次查询模式
不需要交互,直接问一个问题:
hermes chat -q "What is the capital of France?"

8.基础操作演示

1.读取文件
You: 读取 ~/.bashrc 文件的前 20 行
2.执行终端命令
You: 在当前目录创建一个名为 hello.py 的 Python 文件,内容是打印 "Hello, Hermes!"
3.搜索文件
You: 在当前目录找出所有 .md 文件
4.写代码并运行
You: 用 Python 写一个函数,计算斐波那契数列第 n 项,然后测试 n=10

9.核心功能详解

1.工具集
Hermes 的能力来自「工具集」,你需要先启用才能用。
# 查看可用工具
hermes tools list

# 启用/禁用工具
hermes tools enable terminal    # 启用终端工具
hermes tools enable web         # 启用网页搜索
hermes tools enable file        # 启用文件操作
工具集一览:
工具集功能
terminal执行 Shell 命令
file读取、写入、搜索文件
web网页搜索、内容提取
browser浏览器自动化
code_execution沙盒 Python 执行
vision图片分析
image_genAI 图片生成
tts文字转语音
memory持久记忆
session_search搜索历史对话
delegation子 Agent 委托
cronjob定时任务
messaging跨平台发消息
注意: 工具集修改后需要 /reset(开新 session)才生效,因为 Hermes 会缓存当前的工具列表。
2.技能
Skills 是 Hermes 的「学习」机制 —— 把解决过的问题流程存成文档,下次遇到直接加载。
# 列出已安装技能
hermes skills list

# 搜索技能市场
hermes skills search "python"
hermes skills browse

# 安装技能
hermes skills install technical-blog-writing

# 在会话中加载技能,加载后,Hermes 会读取该技能的完整说明(包括工作流、最佳实践),并在当前任务中应用。
You: /skill technical-blog-writing
制作自己的技能
当你用 Hermes 完成一个复杂任务后,可以问它:
You: 把这个工作流存成一个技能,方便以后复用
Hermes 会自动整理成技能文档保存。下次直接 /skill 你的技能名 就能加载。
3.记忆系统
Hermes 有持久记忆,会跨 session 记住:
      • 用户信息:你是谁、偏好什么
      • 环境信息:项目结构、配置细节
      • 学到的东西:你纠正过它的方式、常用的工作流
# 查看记忆状态
hermes memory status
配置记忆提供商,默认用内置 SQLite,也可切换到 Honcho 或 Mem0:
hermes honcho setup    # 如果装了 honcho 插件
4.消息网关
Gateway 让 Hermes 接入 IM 平台,在 Telegram、Discord、飞书里和它对话。
# 启动 Gateway
hermes gateway run

# 配置消息平台
hermes gateway setup
支持的平台:
平台说明
Telegram最简单,5 分钟配置完成
Discord需要开发者模式
Slack需要创建 App
飞书企业应用
微信通过企业微信接入
WhatsApp
Signal
EmailSMTP/IMAP
作为系统服务运行,这样服务器重启后 Gateway 也会自动启动。
hermes gateway install     # 安装为 systemd 服务
hermes gateway start       # 启动
hermes gateway status      # 查看状态
5.定时任务
定时任务常用于:
      • 每日自动总结
      • 定时监控服务状态
      • 定时抓取数据
      • 定时发送报告
# 创建定时任务
hermes cron create "0 9 * * *" "总结昨天的日志写入 ~/daily-log.md"

# 列出所有任务
hermes cron list

# 手动触发一次
hermes cron run <job_id>

# 删除任务
hermes cron remove <job_id>
6.多会话管理
# 查看历史会话
hermes sessions list

# 恢复会话
hermes --continue # 恢复最近一次
hermes --resume 20260225_143052_a1b2c3 # 按 ID 恢复

# 导出会话
hermes sessions export ~/conversations.jsonl

# 清理旧会话
hermes sessions prune --older-than 30 days

10.进阶用法

1.子 Agent 委托(delegate_task)
把复杂任务拆解,并行分给多个子 Agent:
# 示例:同时让三个子 Agent 并行工作
# Agent A: 调研竞品
# Agent B: 写架构设计
# Agent C: 准备测试数据
2.MCP 服务器接入
MCP(Model Context Protocol)让 Hermes 能接入更多外部工具:
# 添加 MCP 服务器
hermes mcp add <name> --url <server_url>
# 或
hermes mcp add <name> --command "<command>"

# 列出已配置的 MCP 服务器
hermes mcp list

# 测试连接
hermes mcp test <name>
3.多 Profile 管理
如果你有多个项目或多个身份,可以用 Profile 实现完全隔离的配置:
# 创建新 Profile
hermes profile create work

# 切换
hermes profile use work

# 克隆现有配置
hermes profile create personal --clone-from default
每个 Profile 有独立的:
      • config.yaml
      • .env
      • skills/
      • sessions/
4.Webhook 触发
外部服务可以触发 Hermes 执行任务:
# 创建一个 Webhook 路由
hermes webhook subscribe mytask

# 测试这个 Webhook
curl -X POST http://localhost:18989/webhooks/mytask \
  -d '{"prompt": "分析上传的日志文件"}'

11.工作流示例

示例 1:技术博客写作
# 1. 启动 Hermes,加载写作技能
hermes -s technical-blog-writing

# 2. 告诉它你要写什么
You: 我要写一篇关于 Docker 容器安全的博客,面向有基础的开发者

# 3. 它会按技能规范产出:
#    - 正确的结构
#    - 可运行的代码示例
#    - 结尾签名块
#    - 保存到 workspace/articles/
#    - 上传到飞书云盘
示例 2:代码审查
hermes

You: 审查 ~/myproject/src/ 目录下的所有 Python 文件,找出潜在的安全问题
示例 3:自动化日常任务
# 创建一个每天早上 9 点执行的任务
hermes cron create "0 9 * * 1-5" \
  "检查服务器状态,把异常日志发到我邮箱"

12.常见问题排查

1.hermes: command not found
# 检查安装
which hermes
ls ~/.hermes/venv/bin/hermes

# 重新加载 PATH
source ~/.bashrc
# 或
source ~/.zshrc
2.API Key 不生效
# 检查 .env 文件是否正确
cat ~/.hermes/.env

# 测试 Key 是否有效
hermes doctor
3.工具不响应
# 检查工具是否启用
hermes tools list

# 重启新 session
/exit
hermes
4.Gateway 连接失败
# 查看日志
tail -50 ~/.hermes/logs/gateway.log

# 飞书用户特别注意
# 需要安装 lark-oapi 包:
~/.hermes/venv/bin/pip install lark-oapi
5.模型调用报错
# 检查配置
hermes config

# 切换模型
hermes model

# 查看详细错误
hermes doctor

13.总结

官方资源
资源链接
官方文档https://hermes-agent.nousresearch.com/docs/
GitHubhttps://github.com/NousResearch/hermes-agent
Skills 市场https://hermes-agent.nousresearch.com/docs/reference/skills-catalog
模型提供商列表https://hermes-agent.nousresearch.com/docs/integrations/providers
消息平台配置https://hermes-agent.nousresearch.com/docs/user-guide/messaging/
Hermes Agent 的核心价值:
    • 开箱即用 —— 安装简单,配置容易,5 分钟跑起来
    • 本地优先 —— 所有数据存在本地,API Key 自己管
    • 技能积累 —— 越用越聪明,技能越攒越多
    • 跨平台 —— 终端、IM、API,想怎么聊就怎么聊
    • 建议从今天开始,把一个日常重复任务交给 Hermes 自动处理,体验一下「AI Agent 本地化」的生产力。
注:转载自 https://blog.csdn.net/weixin_45494794/article/details/160340316,哪天收费就看不到了!!!
标签: hermes agent
最后更新:2026年5月28日

Akim

犇 骉 古法 AI 双修者 Java、C#、Python、Go、Android、Vue、Bootstrap

点赞
< 上一篇
文章目录
  • 1.简介
  • 2.环境准备
  • 3.安装
  • 4.验证
  • 5.配置
  • 6.目录结构
  • 7.快速上手
  • 8.基础操作演示
  • 9.核心功能详解
  • 10.进阶用法
  • 11.工作流示例
  • 12.常见问题排查
  • 13.总结

Copyright © 2026 aianran.com All Rights Reserved.

免责申明 | 隐私政策 | 服务条款 | 关于我们

黔ICP备2023008200号-1

贵公网安备 52010202003594号