部署 OpenViking
使用 Docker Compose 部署 OpenViking 服务:
services:
openviking:
image: ghcr.io/volcengine/openviking:latest
container_name: openviking
ports:
- "1933:1933"
- "8020:8020"
volumes:
# 持久化配置和数据目录
- ./.openviking/ov.conf:/app/ov.conf
- ./.openviking/data:/app/data
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://127.0.0.1:1933/health || exit 1"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
restart: unless-stopped生成 OpenViking user_key
第一步:确认 root_api_key 配置
检查 ov.conf 中是否已配置 root_api_key。如果没有,需要先设置一个强密码:
{
"server": {
"host": "0.0.0.0",
"port": 1933,
"root_api_key": "your-secret-root-key-here"
}
}第二步:重启服务
修改配置后,重启 OpenViking 服务使配置生效。
第三步:创建账户并获取 user_key
在能访问 OpenViking 的机器上执行以下 curl 命令:
curl -X POST http://localhost:1933/api/v1/admin/accounts \
-H "X-API-Key: your-secret-root-key-here" \
-H "Content-Type: application/json" \
-d '{"account_id": "hermes-team", "admin_user_id": "hermes-user"}'注意:
your-secret-root-key-here需要替换为第一步中设置的root_api_key。
执行后会返回包含 user_key 的 JSON 响应,记录下来备用。
第四步:配置 Hermes
回到 Hermes 所在机器,执行以下命令开始配置:
hermes memory setup选择 OpenViking 作为记忆存储 provider,然后参考下表填写对应的值:
| Hermes 配置项 | 对应填写值 | 说明 |
|---|---|---|
| OpenViking server URL | http://192.168.1.12:1933 | OpenViking 服务地址 |
| OpenViking API key | ...KLrh | 第三步获取的 user_key |
| OpenViking tenant account ID | hermes-team | 创建账户时的 account_id |
| OpenViking user ID | hermes-user | 创建账户时的 admin_user_id |
| OpenViking agent ID | hermes | Hermes 使用的 agent 标识符 |