feat(odyssey): 消化《n8n 调用 Hermes Agents 的工作流架构》素材,新增 1 素材页 + 4 实体页 + 1 主题页
This commit is contained in:
67
wiki/entities/Hermes API Server.md
Normal file
67
wiki/entities/Hermes API Server.md
Normal file
@@ -0,0 +1,67 @@
|
||||
---
|
||||
tags: [实体]
|
||||
created: 2026-09-14
|
||||
updated: 2026-09-14
|
||||
sources: [raw/notes/2026-09-14-n8n调用hermes-agents工作流架构.md]
|
||||
---
|
||||
|
||||
# Hermes API Server
|
||||
|
||||
> [[Hermes Agent]] 的内置组件,把 Agent 暴露成 OpenAI 兼容的 HTTP 端点,默认端口 8642。
|
||||
|
||||
## 简介
|
||||
|
||||
Hermes API Server 是 [[Hermes Agent]] 自带的 HTTP 服务层,遵循 OpenAI 的 `chat/completions` 协议。任何能调用 OpenAI 接口的客户端——[[n8n]]、脚本、其他 Agent——都能不加改造地调用它。这是 Hermes 接入外部编排系统的关键,也是「不需要中间件」这个结论的来源。
|
||||
|
||||
## 关键信息
|
||||
|
||||
- **类型**:概念 / 组件
|
||||
- **领域**:AI Agent 服务化
|
||||
- **相关概念**:[[Hermes Agent]]、[[Hermes Profile]]、[[n8n]]
|
||||
- **默认端口**:`8642`
|
||||
- **协议**:OpenAI 兼容(`/v1/chat/completions`、`/v1/health`)
|
||||
|
||||
## 详细内容
|
||||
|
||||
### 开启与配置
|
||||
|
||||
```bash
|
||||
hermes config set API_SERVER_ENABLED true
|
||||
hermes config set API_SERVER_KEY <your-secret-key>
|
||||
hermes gateway restart
|
||||
```
|
||||
|
||||
`API_SERVER_KEY` 是必填项,客户端通过 `Authorization: Bearer <key>` 携带。若要跨机器访问,还需把 `API_SERVER_HOST` 设为 `0.0.0.0`(默认只监听本机)。
|
||||
|
||||
### 调用格式
|
||||
|
||||
```json
|
||||
{
|
||||
"model": "hermes-agent",
|
||||
"messages": [{ "role": "user", "content": "Hello!" }]
|
||||
}
|
||||
```
|
||||
|
||||
`model` 字段填实例 / profile 名,返回体是标准 OpenAI 响应结构,带 `usage` 的 token 统计。
|
||||
|
||||
### 多轮会话连续性
|
||||
|
||||
v0.7.0 起支持 `X-Hermes-Session-Id` 请求头:
|
||||
|
||||
```
|
||||
X-Hermes-Session-Id: my-workflow-session-001
|
||||
```
|
||||
|
||||
同一个 id 的多次请求共享同一个 session,因此 chat-completions 客户端也能跨请求保留上下文。这让 [[n8n]] 里用多个 HTTP Request 节点串起来的流程可以具备记忆,适合多步推理任务链。
|
||||
<!-- confidence: EXTRACTED -->
|
||||
|
||||
## 不同素材中的观点
|
||||
|
||||
- [[wiki/sources/2026-09-14-n8n调用hermes-agents工作流架构]]:API Server 是「完全原生支持」的核心,架构中位于 n8n 与各 Agent 实例之间。
|
||||
|
||||
## 相关页面
|
||||
|
||||
- [[Hermes Agent]]
|
||||
- [[Hermes Profile]]
|
||||
- [[n8n]]
|
||||
- [[多 Agent 工作流编排]]
|
||||
51
wiki/entities/Hermes Agent.md
Normal file
51
wiki/entities/Hermes Agent.md
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
tags: [实体]
|
||||
created: 2026-09-14
|
||||
updated: 2026-09-14
|
||||
sources: [raw/notes/2026-09-14-n8n调用hermes-agents工作流架构.md]
|
||||
---
|
||||
|
||||
# Hermes Agent
|
||||
|
||||
> Nous Research 出品的 Agent 平台,内置 OpenAI 兼容的 API Server,可被外部工作流引擎直接当作 LLM 端点调用。
|
||||
|
||||
## 简介
|
||||
|
||||
Hermes Agent 是一个可本地部署的 Agent 运行时。它同时具备两副面孔:给人用的命令行 / 聊天 Agent,以及给机器调用的 HTTP 服务。后者由内置的 [[Hermes API Server]] 提供,因此把它接进外部编排工具时不需要写任何适配代码。
|
||||
|
||||
## 关键信息
|
||||
|
||||
- **类型**:工具 / 平台
|
||||
- **领域**:AI Agent 运行时、工作流自动化
|
||||
- **相关概念**:[[Hermes API Server]]、[[Hermes Profile]]、[[n8n]]
|
||||
- **版本门槛**:基础 API Server 特性需 v0.4.0+;多轮会话 header 需 v0.7.0+
|
||||
|
||||
## 详细内容
|
||||
|
||||
### 服务化能力
|
||||
|
||||
Hermes Agent 将自身暴露为一个 OpenAI 兼容的 HTTP 端点,默认端口 `8642`。开启步骤:
|
||||
|
||||
```bash
|
||||
hermes config set API_SERVER_ENABLED true
|
||||
hermes config set API_SERVER_KEY <your-secret-key>
|
||||
hermes gateway install # 安装为系统服务
|
||||
hermes gateway start # 启动
|
||||
```
|
||||
|
||||
健康检查返回 `{"status":"ok","platform":"hermes-agent","version":"..."}` 即就绪。
|
||||
|
||||
### 多实例能力
|
||||
|
||||
通过 [[Hermes Profile]] 可在同一台机器上运行多个互相隔离的 Hermes 实例,各自占用不同端口、持有独立 API key。这是 [[多 Agent 工作流编排]] 中「一个角色一个 Agent」的实现基础。
|
||||
|
||||
## 不同素材中的观点
|
||||
|
||||
- [[wiki/sources/2026-09-14-n8n调用hermes-agents工作流架构]]:强调「完全不需要额外写任何代码」「完全原生支持,不需要任何额外中间件」。
|
||||
|
||||
## 相关页面
|
||||
|
||||
- [[Hermes API Server]]
|
||||
- [[Hermes Profile]]
|
||||
- [[n8n]]
|
||||
- [[多 Agent 工作流编排]]
|
||||
58
wiki/entities/Hermes Profile.md
Normal file
58
wiki/entities/Hermes Profile.md
Normal file
@@ -0,0 +1,58 @@
|
||||
---
|
||||
tags: [实体]
|
||||
created: 2026-09-14
|
||||
updated: 2026-09-14
|
||||
sources: [raw/notes/2026-09-14-n8n调用hermes-agents工作流架构.md]
|
||||
---
|
||||
|
||||
# Hermes Profile
|
||||
|
||||
> [[Hermes Agent]] 的多实例隔离机制:每个 profile 是一套独立的配置、端口和 API key。
|
||||
|
||||
## 简介
|
||||
|
||||
Profile 让同一台机器上并存多个互不干扰的 Hermes 实例。每个 profile 有自己的配置目录、自己的 [[Hermes API Server]] 端口、自己的 API key,因此可以被当作一个「专职 Agent」对外提供服务。它是 [[多 Agent 工作流编排]] 中角色分工的落地方式。
|
||||
|
||||
## 关键信息
|
||||
|
||||
- **类型**:概念 / 机制
|
||||
- **领域**:AI Agent 运行时、多实例隔离
|
||||
- **相关概念**:[[Hermes Agent]]、[[Hermes API Server]]、[[n8n]]
|
||||
- **命令形态**:`hermes profile create <name>`,`hermes -p <name> <subcommand>`
|
||||
|
||||
## 详细内容
|
||||
|
||||
### 创建与配置
|
||||
|
||||
```bash
|
||||
hermes profile create agent-researcher
|
||||
hermes -p agent-researcher config set API_SERVER_ENABLED true
|
||||
hermes -p agent-researcher config set API_SERVER_PORT 8643
|
||||
hermes -p agent-researcher config set API_SERVER_KEY key-researcher
|
||||
```
|
||||
|
||||
关键点:`-p <profile>` 前缀让所有后续命令作用于该 profile,因此端口和密钥都是 per-profile 的。
|
||||
|
||||
### 多角色分工示例
|
||||
|
||||
素材给出的分工骨架——调研、写作、编码各占一个 profile,各自独立端口:
|
||||
|
||||
| Profile | 端口 | 职责 |
|
||||
|---|---|---|
|
||||
| agent-researcher | 8643 | 搜索 / 调研 |
|
||||
| agent-writer | 8644 | 内容生成 |
|
||||
| agent-coder | 8645 | 代码任务 |
|
||||
|
||||
启动方式:`hermes -p <name> gateway &`,三个 profile 各起一个 gateway。
|
||||
|
||||
<!-- confidence: INFERRED -->
|
||||
|
||||
## 不同素材中的观点
|
||||
|
||||
- [[wiki/sources/2026-09-14-n8n调用hermes-agents工作流架构]]:Profile 被用作「为每个用户/角色创建独立的 Hermes 实例」的手段,每实例独立端口与 API key。
|
||||
|
||||
## 相关页面
|
||||
|
||||
- [[Hermes Agent]]
|
||||
- [[Hermes API Server]]
|
||||
- [[多 Agent 工作流编排]]
|
||||
60
wiki/entities/n8n.md
Normal file
60
wiki/entities/n8n.md
Normal file
@@ -0,0 +1,60 @@
|
||||
---
|
||||
tags: [实体]
|
||||
created: 2026-09-14
|
||||
updated: 2026-09-14
|
||||
sources: [raw/notes/2026-09-14-n8n调用hermes-agents工作流架构.md]
|
||||
---
|
||||
|
||||
# n8n
|
||||
|
||||
> 开源工作流自动化平台,通过 HTTP Request 节点把多个 Agent 串成业务流程。
|
||||
|
||||
## 简介
|
||||
|
||||
n8n 是一个可视化的工作流 / 自动化编排工具。在这个知识库的语境里,它的角色是**调用方**:用 HTTP Request 节点去请求 [[Hermes API Server]],从而把 [[Hermes Profile]] 提供的多个专职 Agent 组织成一条业务流水线。
|
||||
|
||||
## 关键信息
|
||||
|
||||
- **类型**:工具 / 平台
|
||||
- **领域**:工作流自动化、系统集成
|
||||
- **相关概念**:[[Hermes Agent]]、[[Hermes API Server]]、[[Hermes Profile]]
|
||||
- **用到的节点**:HTTP Request
|
||||
|
||||
## 详细内容
|
||||
|
||||
### 调用 Hermes Agent 的节点配置
|
||||
|
||||
| 字段 | 值 |
|
||||
|---|---|
|
||||
| Method | `POST` |
|
||||
| URL | `http://<host>:8643/v1/chat/completions` |
|
||||
| Header: Authorization | `Bearer <该 profile 的 key>` |
|
||||
| Header: Content-Type | `application/json` |
|
||||
| Header: X-Hermes-Session-Id | 可选,用于跨节点共享上下文 |
|
||||
|
||||
Body 用 n8n 表达式把上游节点的数据注入:
|
||||
|
||||
```json
|
||||
{
|
||||
"model": "agent-researcher",
|
||||
"messages": [
|
||||
{ "role": "system", "content": "你是一个专门负责网络调研的Agent,请搜索并总结信息" },
|
||||
{ "role": "user", "content": "{{ $json.task }}" }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
因为服务端是 OpenAI 兼容协议,n8n 侧不需要任何自定义 SDK 或适配节点,一个通用 HTTP Request 节点即可。
|
||||
|
||||
### 在本知识库中的延伸
|
||||
|
||||
nexus 笔记里还有一份同构素材描述了 n8n 调用另一 Agent 平台的方案,可作为跨平台横向对比的素材。
|
||||
|
||||
## 不同素材中的观点
|
||||
|
||||
- [[wiki/sources/2026-09-14-n8n调用hermes-agents工作流架构]]:n8n 处于架构的入口端,向下扇出到多个端口的 Agent 实例。
|
||||
|
||||
## 相关页面
|
||||
|
||||
- [[Hermes API Server]]
|
||||
- [[多 Agent 工作流编排]]
|
||||
Reference in New Issue
Block a user