Hermes Agent 安装使用教程

Hermes Agent 是由 Nous Research 开发的开源自主 AI 代理,核心特性是具有内置学习循环,能够在与用户的对话中不断学习和成长。
◆ ◆ ◆
一、环境要求
注意:Windows 原生不支持,需安装 WSL2
◆ ◆ ◆
二、安装方式
方式一:一键安装(推荐)
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash安装脚本会自动:
- 1.检测 Python 版本(3.10+)
- 2.安装 uv 包管理器
- 3.安装 Node.js
- 4.安装 ffmpeg
- 5.创建虚拟环境
~/.hermes-venv - 6.克隆仓库到
~/.hermes/hermes-agent - 7.生成初始配置文件
安装完成后:
source ~/.bashrc # Bash 用户source ~/.zshrc # Zsh 用户方式二:pip 安装
# 安装 uv(推荐)curl -LsSf https://astral.sh/uv/install.sh | sh# 用 uv 安装uv pip install hermes-agent# 或用 pippip install hermes-agent方式三:Docker 安装
# 拉取镜像docker pull nousresearch/hermes-agent:latest# 创建数据目录mkdir -p ~/.hermes# 运行容器docker run -d \ --name hermes-agent \ -v ~/.hermes:/home/hermes/.hermes \ -p 8080:8080 \ nousresearch/hermes-agent:latest方式四:源码安装
# 克隆仓库git clone https://github.com/NousResearch/hermes-agent.gitcd hermes-agent# 安装 uvcurl -LsSf https://astral.sh/uv/install.sh | sh# 创建虚拟环境uv venv venv --python 3.11source venv/bin/activate# 安装依赖uv pip install -e .◆ ◆ ◆
三、配置 LLM 提供商
OpenRouter(推荐)
- 1.访问 https://openrouter.ai 注册账号
- 2.进入 Dashboard → API Keys
- 3.创建新 Key(格式:
sk-or-v1-xxx)
# 交互式配置hermes setup# 或手动配置hermes config set OPENROUTER_API_KEY sk-or-v1-xxxOllama(本地免费)
# 安装并运行 Ollamaollama pull qwen2.5-coder:32bollama serve# 配置 Hermeshermes model# 选择 "Custom endpoint"# 填入 http://localhost:11434/v1自定义端点
修改 ~/.hermes/config.yaml:
model: default: your-model provider: custom base_url: http://localhost:8000/v1◆ ◆ ◆
四、基础命令
# 开始对话hermes# 交互式配置hermes setup# 选择模型hermes model# 配置工具hermes tools# 设置单个配置hermes config set KEY VALUE# 检查环境hermes doctor# 更新版本hermes update# 查看版本hermes --version斜杠命令(对话中)
/help 查看帮助/new 开始新对话/model 切换模型/personality 设置人设/cron 定时任务◆ ◆ ◆
五、Gateway 部署(Telegram/Discord)
Telegram 接入
- 1.搜索 @BotFather,创建机器人
- 2.获取 Bot Token
- 3.获取用户 ID(搜索 @userinfobot)
hermes gateway setup# 选择 Telegram# 输入 Bot Token 和用户 ID安装为系统服务
hermes gateway install# 查看状态systemctl --user status hermes-gateway◆ ◆ ◆
六、目录结构
~/.hermes/├── config.yaml # 主配置文件├── .env # API 密钥├��─ auth.json # OAuth 凭证├── memories/ # 记忆文件├── skills/ # 自定义技能├── logs/ # 日志└── hermes-agent/ # 程序源码◆ ◆ ◆
七、验证安装
# 检查版本hermes --version# 运行环境诊断hermes doctor# 开始对话hermes# 第一次对话示例hermes> 你好,帮我写一个 Python 函数判断质数◆ ◆ ◆
八、常见问题
Command not found
source ~/.bashrc # 或 source ~/.zshrcAPI Key 无效
- ◆检查 Key 是否正确复制
- ◆确认 Key 未过期
内存不足
- ◆减少并发任务数
- ◆使用更小的模型
◆ ◆ ◆
九、总结
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash | |
hermes setup | |
hermes | |
hermes update |
官方文档:https://hermes-agent.nousresearch.comGitHub:https://github.com/NousResearch/hermes-agent
夜雨聆风