Hermes Agent 完整配置教程

347 字

Hermes Agent 完整配置教程

来源类型: 微信公众号文章
日期: 2026-06-02
标签: AI, OpenClaw, 记忆系统, 办公效率, 网络安全, 编程, 芯片, 大模型
原文链接: https://mp.weixin.qq.com/s/bh-qQcvQ2eOcOWcP7olGTw

摘要

tags: - Hermes - AI-Agent - 配置教程 - Nous-Research created: 2026-04-10 ## Hermes Agent 完整配置教程 Hermes Agent 是 Nous Research 开发的开源 AI 智能体框架,可在终端、消息平台(Telegram/Discord/Slack 等)和 IDE 中运行。支持任意 LLM 提供商(OpenRouter、Anthropic、OpenAI、本地模型等 18+ 提供商)。 ## 安装与初始化 # 一键安装 curl -fsSL https://raw.githubusercontent...

核心内容

tags:

  • Hermes
  • AI-Agent
  • 配置教程
  • Nous-Research created: 2026-04-10

Hermes Agent 完整配置教程

Hermes Agent 是 Nous Research 开发的开源 AI 智能体框架,可在终端、消息平台(Telegram/Discord/Slack 等)和 IDE 中运行。支持任意 LLM 提供商(OpenRouter、Anthropic、OpenAI、本地模型等 18+ 提供商)。

安装与初始化

一键安装

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

交互式初始设置向导

hermes setup

查看健康状态

hermes doctor

启动交互聊天

hermes

目录结构

所有配置和文件都在 ~/.hermes/ 目录下:

~/.hermes/
├── config.yaml # 主配置文件(模型、终端、TTS、压缩等)
├── .env # API 密钥和敏感信息
├── auth.json # OAuth 凭证(Nous Portal 等)
├── SOUL.md # Agent 身份定义(系统提示词第一位)
├── memories/ # 持久记忆(MEMORY.md、USER.md)
├── skills/ # 已安装的技能
├── cron/ # 定时任务
├── sessions/ # 会话记录
└── logs/ # 日志(gateway.log、errors.log,自动脱敏)

Profiles 使用 ~/.hermes/profiles/<名称>/ 目录,结构相同。

配置文件详解 (config.yaml)

使用 hermes config edit 打开编辑,或用 hermes config set KEY VAL 设置。

配置优先级(从高到低)

  • .env 中的环境变量
  • config.yaml 中的显式配置
  • 默认值

核心配置段

model — 模型与提供商

model:
default: "anthropic/claude-sonnet-4" # 默认模型
provider: "openrouter" # 提供商
base_url: "" # 自定义端点(优先于 provider)
api_key: "" # 自定义端点的 API Key
context_length: 0 # 0 = 自动检测

agent — Agent 行为

agent:
max_turns: 90 # 单次会话最大工具调用轮数
tool_use_enforcement: true # 强制使用工具

terminal — 终端后端

terminal:
backend: local # local | docker | ssh | modal | singularity | daytona
cwd: "" # 工作目录(默认当前目录)
timeout: 180 # 命令超时秒数
notify_on_complete_threshold: 60 # 超过此秒数的后台任务完成后通知
allowlist: [] # 允许的命令白名单
blocklist: [] # 阻止的命令黑名单
persistent_shell: true # 使用持久 shell(保留环境变量和状态)

Docker 后端额外配置:

terminal:
backend: docker
docker:
image: "nousresearch/hermes-agent:latest"
container_name: "hermes-agent"
auto_remove: false
volumes: [] # 挂载卷
network_mode: "" # 网络模式
credential_forwarding: true # 自动转发 Docker 凭证

SSH 后端额外配置:

terminal:
backend: ssh
ssh:
host: "" # SSH 主机
port: 22
user: ""
identity_file: "~/.ssh/id_rsa"

Modal 后端额外配置:

terminal:
backend: modal
modal:
image: "modal-labs/modal-python:3.11"
secret_names: [] # Modal secrets
timeout: 300

compression — 上下文压缩

compression:
enabled: true
threshold: 0.50 # 上下文使用率达到 50% 时触发
target_ratio: 0.20 # 压缩到原始大小的 20%
model: "" # 空 = 使用主模型,也可单独指定
provider: "" # 空 = 使用主提供商

三个参数如何配合:

  • threshold:何时开始压缩
  • target_ratio:压缩到什么程度
  • threshold 越低、target_ratio 越小 = 压缩越激进

display — 显示设置

display:

...(内容截断,完整内容请查看原文)


本页由自动化脚本生成,待人工审核补充