快速定位
| 目标 | 最短入口 | 备注 |
|---|
| 进入交互式对话 | hermes | 启动交互式 CLI |
| 单次查询 | hermes chat -q "<prompt>" | 非交互式快速提问 |
| 选提供商/模型 | hermes chat --model <model> 或会话内 /model | CLI 层用 --model flag,会话内用 slash command |
| 配工具集 | hermes chat --toolsets <toolsets> 或会话内 /tools | CLI 层用 --toolsets flag,会话内用 slash command |
| 一次性配置 | hermes setup | 把模型、工具、网关一起配完 |
| 诊断问题 | hermes doctor | 检查缺失依赖与配置 |
| 连消息平台 | hermes gateway setup | Telegram / Discord / Slack / WhatsApp / Signal / Email / Home Assistant / 飞书 / 企业微信 / Matrix / Mattermost / DingTalk |
| 继续会话 | hermes --continue | 恢复最近一次会话 |
| 切换模型 | /model | 会话中实时切换,支持所有网关平台 |
| 后台任务 | /background <prompt> | 不阻塞当前会话 |
基础概念
| 概念 | 一句话理解 | 你要记住什么 |
|---|
| profile | 一个独立的 Hermes 运行实例 | 配置、API key、memory、sessions、skills、gateway 状态彼此隔离 |
| gateway | 连接消息平台的常驻进程 | 负责收消息、发消息、路由会话、回传后台任务结果 |
| channel | 消息平台里的聊天入口或房间维度 | 在 Telegram / Discord / Slack / WhatsApp 等平台上,Hermes 会按 channel 维度接入和路由会话 |
| session | 一段可恢复的对话记录 | CLI、DM、群聊、频道都会落到 session;支持 --continue、标题、历史检索 |
| group_sessions_per_user | 群/频道是否按用户拆分 session | true 时同一房间不同人不共享 transcript/history,默认更安全 |
| memory | 跨 session 的长期记忆 | MEMORY.md / USER.md 存偏好和稳定事实,不等于 session 历史 |
| toolset | 本轮可用的工具集合 | 决定这一轮能不能用 web、terminal、file、browser 等能力 |
| skill | 可复用的任务知识包 | 复杂任务先找 skill,再执行命令,减少重复摸索 |
关系速记
| 关系 | 说明 |
|---|
| profile | 最大的隔离边界。 |
| gateway | 负责把外部平台接进 Hermes。 |
| channel / session | channel 是外部平台里的入口,session 是这个入口下可恢复的会话。 |
| memory | 跨 session 保留偏好和事实,不会替代 session 历史。 |
| group_sessions_per_user: true | 当前默认值,适合多人共用同一 channel 时避免上下文互相污染。 |
最短路径
hermes chat -q "Hello" # 单次查询
hermes # 交互式对话
hermes chat --model <model> # 指定模型
hermes setup # 全量配置向导
子代理与分工
一句话理解
子代理是 Hermes 把复杂任务拆成独立小任务后,交给另一个带独立上下文和独立 terminal session 的 agent 去执行的机制。
适用边界
| 场景 | 是否适合 |
|---|
| 需要判断、对比、调研、复杂修复 | 适合 |
| 单次工具调用 | 不适合 |
| 机械流水线、固定步骤脚本 | 不适合 |
| 需要用户交互的任务 | 不适合 |
核心规则
| 规则 | 说明 |
|---|
| delegate_task | 同步执行,不是后台队列 |
| 上下文 | 子代理看不到父会话历史,只看 goal / context / toolsets |
| 资源继承 | 子代理继承父代理的 API key、provider 配置和 credential pool |
| 并发 | 默认 3 个并发子代理,可在 delegation.max_concurrent_children 调整 |
| 深度 | 默认 delegation.max_spawn_depth = 1,也就是平铺模式 |
| 嵌套 | 只有 role="orchestrator" 的子代理才能继续派生 |
| 叶子模式 | 默认 role="leaf",不能再调用 delegate_task、clarify、memory、send_message、execute_code |
| 终止 | 父任务被中断时,所有活跃子代理也会被取消 |
| 监控 | TUI 里用 /agents 查看运行中的子代理树,/tasks 是别名 |
最短入口
/agents
/tasks
常用调用
delegate_task(
goal="Review the authentication module for security issues and fix any found",
context="Project at /home/user/webapp. Focus on SQL injection, JWT validation, password handling, and session management.",
toolsets=["terminal", "file"]
)
delegate_task(
goal="Survey three code review approaches and recommend one",
role="orchestrator",
context="...",
toolsets=["web"]
)
并行批处理
delegate_task(tasks=[
{"goal": "Research topic A", "toolsets": ["web"]},
{"goal": "Research topic B", "toolsets": ["web"]},
{"goal": "Fix the build", "toolsets": ["terminal", "file"]}
])
和 execute_code 的区别
| 场景 | 更适合 |
|---|
| 需要推理、判断、研究 | delegate_task |
| 需要机械式脚本处理、固定步骤流水线 | execute_code |
起步流
先把运行后端定下来
| 场景 | 推荐值 | 说明 |
|---|
| 本机信任环境 | local | 最省事 |
| 不可信代码 | docker | 容器隔离 |
| 远程机器 | ssh | 把执行放到别处 |
| HPC / 共享机 | singularity | 无 root 容器 |
| 云沙箱 | modal / daytona | 适合长期任务 |
hermes config set terminal.backend docker
hermes config set terminal.backend ssh
先把模型配对
| 提供商 | 适合什么 | 常见入口 |
|---|
| Nous Portal | 官方默认方案,400+ 模型 | hermes model |
| OpenAI Codex | ChatGPT OAuth | hermes model |
| Anthropic | Claude 直接接入 | hermes model |
| Google AI Studio | Gemini 原生接入 | hermes model |
| OpenRouter | 多模型路由 | hermes model |
| GitHub Copilot | 订阅型接入 | OAuth / token |
| Z.AI / GLM | 国内可用模型 | API key |
| Kimi / Moonshot | 编程与长上下文 | API key |
| MiniMax | 国际 / 中国区(支持 OAuth) | API key |
| Alibaba Cloud | Qwen 系列 | API key |
| Hugging Face | 聚合开源模型 | HF token |
| DeepSeek | 直接接入 | API key |
| xAI (Grok) | 直接接入 | API key |
| Vercel AI Gateway | 网关路由 | API key |
| LM Studio | 本地模型推理 | local |
| GMI Cloud | 云端推理 | API key |
| Azure AI Foundry | 企业级模型服务 | Azure 凭证 |
| Custom Endpoint | 自建 OpenAI-compatible API | base URL + key |
先把工具范围收口
| 工具集 | 典型能力 |
|---|
| web | 搜索和抓取网页 |
| terminal | 执行命令、管理进程 |
| file | 读写、搜索、补丁编辑 |
| browser | 浏览器自动化(含 Camofox 反检测) |
| vision | 图片理解 |
| image_gen | 图像生成(含 ComfyUI v5) |
| tts | 语音输出 |
| skills | 技能搜索、查看、管理 |
| memory | 记忆与用户画像 |
| session_search | 会话检索 |
| cronjob | 定时任务 |
| delegation | 子代理分工 |
| clarify | 追问澄清 |
| mcp | 外部工具接入 |
| code_execution | 沙箱 Python 执行 |
| todo | 任务规划 |
| homeassistant | 智能家居控制 |
| spotify | Spotify 播放控制、搜索、队列、播放列表 |
| google_meet | 加入会议、转录、发言 |
| comfyui | ComfyUI v5 工作流(内置) |
| touchdesigner | TouchDesigner 集成(内置) |
| humanizer | 去除 AI 文本痕迹 |
高频场景
1. 先建项目上下文
cd your-repo
hermes
/help
/tools
2. 先规划再执行
hermes config set terminal.backend docker
请先给出执行计划,再开始修改
3. 先用技能复用流程
hermes skills search kubernetes
hermes skills search react --source skills-sh
hermes skills install openai/skills/k8s
/skills
/github-pr-workflow
4. 先做消息平台接入
hermes gateway setup
可接入 Telegram、Discord、Slack、WhatsApp、Signal、Email、Home Assistant、飞书、企业微信、Matrix、Mattermost、DingTalk。
5. 先开语音模式
pip install "hermes-agent[voice]"
pip install faster-whisper
/voice on
/voice tts
6. 先加定时任务
/cron add 30m "提醒我检查构建"
/cron add "every 2h" "检查服务状态"
/cron add "every 1h" "汇总新的信息流" --skill blogwatcher
7. 先用子代理拆任务
子代理完整说明见上方「子代理与分工」卡片,这里保留入口以便快速定位:/agents、/tasks。
8. 先接 MCP
mcp_servers:
github:
command: npx
args: ["-y", "@modelcontextprotocol/server-github"]
env:
GITHUB_PERSONAL_ACCESS_TOKEN: "ghp_xxx"
9. 先接编辑器
pip install -e '.[acp]'
hermes acp
10. 先用后台任务
/background 分析 /var/log 下今天的错误日志
11. 先用 Profile 隔离多实例
hermes profile create work
hermes -p work
hermes profile list
12. 先配凭证池轮转
credential_pool:
openrouter:
- sk-or-key1
- sk-or-key2
credential_pool_strategies:
openrouter: least_used
速查卡
CLI 命令
| 命令 | 作用 |
|---|
| hermes | 启动交互式 CLI |
| hermes --version | 查看当前版本 |
| hermes update | 检查并更新到最新版本 |
| hermes chat -q "<prompt>" | 单次非交互式查询 |
| hermes chat --model <model> | 指定模型(CLI 层) |
| hermes chat --toolsets <toolsets> | 指定工具集(CLI 层) |
| hermes setup | 全量配置向导 |
| hermes doctor | 排查问题 |
| hermes gateway | 启动消息网关 |
| hermes gateway setup | 配置消息平台 |
| hermes memory setup | 配置外部记忆提供商 |
| hermes memory status | 查看记忆状态 |
| hermes skills search <q> | 搜索技能 |
| hermes skills install <id> | 安装技能 |
| hermes acp | 作为 ACP server 运行 |
| hermes mcp serve | 作为 MCP server 运行 |
| hermes profile create <name> | 创建隔离实例 |
| hermes profile list | 列出所有 Profile |
| hermes profile switch <name> | 切换 Profile |
| hermes config | 查看当前配置 |
| hermes config set KEY VAL | 设置配置项 |
| hermes config check | 检查缺失配置 |
| hermes logs | 查看集中日志 |
| hermes sessions list | 浏览历史会话 |
| hermes -z <prompt> | 非交互式单次执行模式 |
| hermes --continue / hermes -c | 继续最近会话 |
| hermes -w | Git worktree 隔离模式 |
| hermes -s skill1,skill2 | 启动时预装技能 |
| hermes update --check | 更新预检 |
| hermes fallback | 管理 fallback providers |
| hermes curator status | 按使用率排名 skills |
CLI 内命令
| 命令 | 作用 |
|---|
| /help | 查看所有命令 |
| /tools | 查看工具 |
| /model | 切换模型(跨平台可用) |
| /personality <name> | 切换人格预设 |
| /save | 保存会话 |
| /voice on | 开启语音 |
| /voice tts | 让回复也语音播报 |
| /voice status | 查看语音状态 |
| /cron add ... | 添加定时任务 |
| /skills | 浏览可用技能 |
| /background <prompt> | 后台任务 |
| /reasoning high | 提高推理强度 |
| /reasoning show | 显示推理过程 |
| /busy | 忙碌输入模式 |
| /btw | /background 的别名 |
| /reload-skills | 无需重启重载 skills |
| /compress | 手动压缩上下文 |
| /rollback | 回滚文件快照 |
| /stop | 中断当前 agent 运行 |
| /approve / /deny | 审批危险命令 |
| /queue | 排队等待而非中断 |
| /statusbar | 切换状态栏 |
| /cost | 查看用量与费用 |
| /skin | 切换 CLI 皮肤 |
| /verbose | 切换工具输出详细度 |
| /title <name> | 命名当前会话 |
| /usage | 查看 token 用量明细 |
| /new / /reset | 新建/重置会话 |
消息网关平台(统一斜杠命令)
Hermes Agent 使用统一的斜杠命令系统,在所有消息平台上行为一致:
| 支持平台 | 说明 |
|---|
| Telegram | BotFather 创建的 Bot |
| Discord | Bot 账号,支持 slash command |
| Slack | Bot token + workspace OAuth |
| WhatsApp | WhatsApp Business API bridge |
| Signal | Signal 消息 |
| Matrix | Matrix 协议(Element 等) |
| Mattermost | 自托管 Mattermost |
| Email | SMTP/IMAP 邮件集成 |
| 飞书 (Feishu/Lark) | 字节跳动企业消息 |
| 企业微信 (WeCom) | 腾讯企业微信 |
| DingTalk | 阿里巴巴钉钉 |
| Home Assistant | 智能家居集成 |
| QQ | 腾讯 QQ |
| BlueBubbles | iMessage bridge |
| Signal | 支持 |
关键配置
| 配置 | 作用 |
|---|
| terminal.backend | 选择执行后端 |
| approvals.mode | manual / smart / off |
| checkpoints.enabled | 危险操作前自动快照 |
| memory.memory_enabled | 启用 MEMORY.md |
| memory.user_profile_enabled | 启用 USER.md |
| compression.enabled | 长会话自动压缩 |
| compression.threshold | 压缩触发阈值(默认 0.50) |
| compression.summary_model | 压缩用的摘要模型 |
| delegation.provider | 子代理用什么提供商 |
| delegation.model | 子代理默认模型 |
| delegation.base_url | 子代理专用 API 地址 |
| delegation.api_key | 子代理专用密钥 |
| delegation.api_mode | 自动推断或手动指定 API 模式 |
| delegation.child_timeout_seconds | 子代理空闲超时,默认 600 秒 |
| delegation.max_concurrent_children | 默认并发 3 个子代理,可调且没有硬上限 |
| delegation.max_spawn_depth | 默认 1,控制是否允许嵌套派生 |
| delegation.orchestrator_enabled | 是否允许 orchestrator 继续派生 |
| clarify.timeout | 追问等待时长 |
| timezone | 日志与定时任务时区 |
| mcp_servers | 外部工具服务 |
| tts.provider | 语音输出提供商 |
| agent.reasoning_effort | 推理强度:none / low / medium / high / xhigh |
| agent.tool_use_enforcement | 工具调用强制引导:auto / true / false |
| agent.max_turns | 每轮最大迭代次数(默认 90) |
| display.streaming | CLI 实时流式输出 |
| display.tool_progress | 工具进度显示:off / new / all / verbose |
| display.show_reasoning | 显示推理过程 |
| display.show_cost | 状态栏显示费用 |
| streaming.enabled | 网关流式输出(Telegram/Discord/Slack) |
| group_sessions_per_user | 群聊按用户隔离会话 |
| credential_pool | 同提供商多 API Key 轮转 |
| credential_pool_strategies | 轮转策略:fill_first / round_robin / least_used |
| fallback_providers | 有序回退提供商链 |
| auxiliary.curator | 配置自主 curator 模型 |
| prompt_caching.cache_ttl | 缓存 TTL(默认 5m,可选 1h) |
| redaction.enabled | 密钥脱敏(默认关闭) |
| strict_mention | 防止线程自动参与(Slack) |
| channel_skill_bindings | 绑定 skills 到特定 Slack 频道 |
| tts.providers.<name> | 可插拔 TTS 提供者注册表 |
| context_from | 链式 cron 任务输出 |
| pre_gateway_dispatch | 分发前拦截 hook |
| security.redact_secrets | 工具输出中自动脱敏密钥(默认关闭) |
| security.tirith_enabled | 命令执行前安全扫描 |
| security.website_blocklist | 阻止访问指定域名 |
| privacy.redact_pii | 网关 PII 脱敏 |
| web.backend | 搜索后端:firecrawl / parallel / tavily / exa |
| browser.camofox | Camofox 反检测浏览器 |
| quick_commands | 自定义快捷命令 |
| human_delay | 模拟人类回复节奏 |
记忆与上下文
| 文件 | 作用 | 作用域 |
|---|
| SOUL.md | 主要人格与语气 | ~/.hermes/SOUL.md 或 $HERMES_HOME/SOUL.md |
| .hermes.md / HERMES.md | 项目级最高优先级说明 | 向上查找 git root |
| AGENTS.md | 项目约定与工程规则 | 递归目录树 |
| CLAUDE.md | Claude 兼容上下文 | 仅当前目录 |
| .cursorrules | Cursor 规则 | 仅当前目录 |
| MEMORY.md | agent 个人记忆 | ~/.hermes/memories/ |
| USER.md | 用户画像 | ~/.hermes/memories/ |
安全默认值
| 主题 | 建议 |
|---|
| 不可信代码 | 用 docker / ssh 后端 |
| 危险命令 | 保持 approvals.mode: manual 或 smart |
| 消息网关 | 用 allowlist 或 DM pairing,不要开全量放行 |
| 密钥 | 放 ~/.hermes/.env,不要写进仓库 |
| 容器前向变量 | 只转发你能接受暴露的变量 |
| 密钥泄露 | security.redact_secrets: true 自动脱敏 |
| MCP 安全 | MCP OAuth 2.1 PKCE + OSV 恶意软件扫描 |
| 浏览器泄露 | URL 与 LLM 回复扫描密钥模式,阻止泄露 |
辅助模型配置
| 任务 | 配置路径 | 默认 |
|---|
| 图片分析 | auxiliary.vision | Gemini Flash |
| 网页摘要 | auxiliary.web_extract | Gemini Flash |
| 命令审批 | auxiliary.approval | Gemini Flash |
| 上下文压缩 | compression.summary_model | Gemini Flash |
| 会话检索 | auxiliary.session_search | Gemini Flash |
| 记忆刷写 | auxiliary.flush_memories | Gemini Flash |
每个辅助任务均支持 provider / model / base_url 三旋钮配置。
结构图
hermes-agent/
├── run_agent.py
├── cli.py
├── toolsets.py
├── hermes_state.py
├── batch_runner.py
├── agent/
│ ├── prompt_builder.py
│ ├── context_compressor.py
│ ├── auxiliary_client.py
│ └── skills_hub.py
├── tools/
│ ├── registry.py
│ ├── approval.py
│ ├── terminal_tool.py
│ ├── file_operations.py
│ ├── web_tools.py
│ ├── vision_tools.py
│ ├── delegate_tool.py
│ ├── session_search_tool.py
│ ├── cronjob_tools.py
│ └── skill_manager_tool.py
├── gateway/
│ ├── run.py
│ ├── config.py
│ └── platforms/
├── plugins/
└── skills/ / optional-skills/ / environments/ / tests/
风险控制
hermes config set approvals.mode smart
hermes config set terminal.backend docker
hermes config set security.redact_secrets true
hermes config set security.tirith_enabled true
收尾
| 想做什么 | 看哪里 |
|---|
| 快速上手 | hermes + hermes model + hermes tools |
| 场景化自动化 | gateway / skills / cron |
| 深入定制 | config.yaml / SOUL.md / AGENTS.md |
| 扩展能力 | MCP / ACP / plugins |
| 多实例隔离 | hermes profile |
| 排障 | hermes doctor / hermes logs |