阅读时间 5 分钟

Hermes profiles:在一台设备上给多人提供独立 AI 助手

什么是 profiles

Hermes 的 profiles 功能,提供的是一组彼此隔离的运行环境。每个 profile 都有自己的配置、密钥、人格设定、记忆、会话、技能、定时任务和状态库。换句话说,它不是在同一个会话里分出几个角色,而是在同一台设备上建立多个独立的 Hermes 空间。

这类隔离带来的直接结果是:不同用途、不同身份、不同用户之间不会互相污染上下文。一个 profile 可以专门给自己用,一个给家人用,一个给朋友用,也可以按项目、按角色、按工作流拆开。

它是怎样工作的

创建 profile 之后,Hermes 会自动为它生成独立的命令入口。比如创建一个名为 coder 的 profile 后,就可以直接使用:

  • coder chat
  • coder setup
  • coder gateway start

这意味着 profile 不只是一个配置文件夹,而是一个可以直接启动和管理的独立 agent 单位。

Profile 管理命令

创建 Profile


# 创建空白 profile
hermes profile create mybot

# 复制当前配置(推荐)
hermes profile create work --clone

# 完整复制(包括记忆、会话)
hermes profile create backup --clone-all

# 从指定 profile 复制
hermes profile create work2 --clone --clone-from coder
选项 说明
--clone 复制 config.yaml、.env、SOUL.md,但使用新的会话和记忆
--clone-all 复制全部内容,相当于完整快照
--clone-from 指定源 profile,而非当前 profile

列出和切换


# 查看所有 profiles
hermes profile list

# 设置默认 profile
hermes profile use coder
hermes profile use default  # 恢复默认

使用 Profile 的方式

方式一:命令别名(自动生成)

创建 profile 后,Hermes 会自动在 ~/.local/bin/ 下生成同名命令:

coder chat              # 启动 coder profile 的聊天
coder setup            # 配置 coder
coder gateway start    # 启动 coder 的网关服务
coder doctor           # 检查 coder 的健康状态

方式二:-p 参数

hermes -p coder chat
hermes --profile work doctor

查看详情

hermes profile show coder

输出示例:

Profile: work
Path:    ~/.hermes/profiles/work
Model:   anthropic/claude-sonnet-4
Gateway: stopped
Skills:  12
.env:    exists
SOUL.md: exists
Alias:   ~/.local/bin/work

导入和导出


# 导出 profile 为压缩包
hermes profile export coder -o backup.tar.gz

# 导入 profile
hermes profile import backup.tar.gz --name coder-new

删除 Profile

hermes profile delete coder
hermes profile delete coder --yes  # 跳过确认

:::warning

删除操作不可恢复,会同时停止网关、移除服务并删除所有数据。

:::

Profile 文件结构

每个 profile 存储在 ~/.hermes/profiles/<name>/,包含:

~/.hermes/profiles/coder/
├── config.yaml          # 模型、工具等配置
├── .env                 # API 密钥、token
├── SOUL.md              # 人格设定
├── memories/            # 持久化记忆
├── sessions/            # 会话历史
├── skills/              # 技能文件
├── logs/                # 网关日志
└── home/                # 子进程 HOME 目录

适合什么场景

1. 给不同人提供独立助手

最直接的用途,是在同一台设备上给家人或朋友各自创建一个独立的 Hermes。每个人都能拥有自己的配置、记忆和使用习惯,不需要理解底层运维细节。

2. 多项目隔离

如果你同时维护多个项目,可以把每个项目放进不同 profile。这样模型设置、技能、会话历史和 cron 任务都不会互相干扰。

3. 多角色并行

你可以把一个 profile 作为个人助理,另一个作为代码助手,再另一个作为研究助手。它们的行为风格、插件、记忆和任务状态都可以单独配置。

4. 实验和备份

当你想测试一套新配置、新技能,或者想保留当前状态做一个可回退的副本时,--clone-all 很适合。它可以把当前环境完整复制出来,再在新 profile 上继续试验。

能解决什么问题

profiles 主要解决的是"单一 agent 不够分、上下文容易串、配置难隔离"的问题。

具体来说,它可以减少:

  • 会话历史混在一起
  • 不同用户的记忆冲突
  • API 密钥和模型配置互相覆盖
  • 定时任务、技能、插件互相影响
  • 一个 agent 既要扮演多个身份,又没有清晰边界

因此,profiles 更像是一种"隔离式多租户"能力:同一台机器上,可以同时运行多个互不干扰的 Hermes 实例。

和 subagent 的区别

profiles 和 subagent 不是一回事。

  • profiles:长期独立环境,适合多人、多身份、多项目
  • subagent:临时派出去执行单个任务的工作单元,适合并行研究、拆分任务、快速协作

可以把 profiles 理解为"各自独立的房间",把 subagent 理解为"临时派出去做事的人"。

一个比较实用的理解

如果你希望一台设备上同时服务不同人,而且每个人都像拥有自己的专属 AI 助手,那么 profiles 就是 Hermes 提供的基础能力。它让复杂的多用户使用方式变成可管理、可隔离、可复制的结构。

这也是它和很多只强调单会话工作流的方案相比,最有价值的地方之一。