乐于分享
好东西不私藏

Hermes Agent 安装使用教程

Hermes Agent 安装使用教程

Hermes Agent 安装使用教程

Hermes Agent 是由 Nous Research 开发的开源自主 AI 代理,核心特性是具有内置学习循环,能够在与用户的对话中不断学习和成长。

◆ ◆ ◆

一、环境要求

项目
最低配置
推荐配置
操作系统
Linux/macOS/WSL2
Ubuntu 22.04 / macOS Sonoma
Python
3.10+
3.11+
内存
2GB+
4GB+
磁盘
2GB+
5GB+
必需工具
curl、git
curl、git、docker

注意:Windows 原生不支持,需安装 WSL2

◆ ◆ ◆

二、安装方式

方式一:一键安装(推荐)

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

安装脚本会自动:

  1. 1.检测 Python 版本(3.10+)
  2. 2.安装 uv 包管理器
  3. 3.安装 Node.js
  4. 4.安装 ffmpeg
  5. 5.创建虚拟环境 ~/.hermes-venv
  6. 6.克隆仓库到 ~/.hermes/hermes-agent
  7. 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. 1.访问 https://openrouter.ai 注册账号
  2. 2.进入 Dashboard → API Keys
  3. 3.创建新 Key(格式:sk-or-v1-xxx
# 交互式配置hermes setup# 或手动配置hermes config set OPENROUTER_API_KEY sk-or-v1-xxx

Ollama(本地免费)

# 安装并运行 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. 1.搜索 @BotFather,创建机器人
  2. 2.获取 Bot Token
  3. 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 ~/.zshrc

API 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