Hermes Agent和普通聊天机器人的区别在于它有记忆和自我改进能力——它会从每次对话中生成技能,记住你的偏好,跨会话保持上下文。部署在VPS上之后,你不在电脑旁边也能通过Telegram控制它工作。
配置要求不高:Ubuntu 22.04或Debian 12,1核1GB起步,推荐2核2GB,不需要GPU。
安装方式一:官方一键脚本(推荐新手)
最简单的方式,一行命令处理所有依赖:
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
脚本会自动安装Python、Node.js、ripgrep、ffmpeg等依赖,克隆仓库,配置虚拟环境,设置全局hermes命令,最后启动配置向导。全程跟着提示走,不需要手动操作。
安装方式二:手动安装(想了解每一步的用户)
先更新系统:
apt update && apt upgrade -y
安装uv(官方推荐的Python包管理器,比pip快很多):
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.cargo/env
克隆仓库,注意必须带--recurse-submodules,否则子模块缺失会导致安装失败:
git clone --recurse-submodules https://github.com/NousResearch/hermes-agent.git
cd hermes-agent
创建Python 3.11虚拟环境并安装依赖:
uv venv venv --python 3.11
export VIRTUAL_ENV="$(pwd)/venv"
uv pip install -e ".[all]"
如果需要浏览器工具或WhatsApp支持,额外安装Node依赖:
npm install
创建配置目录:
mkdir -p ~/.hermes/{cron,sessions,logs,memories,skills,pairing,hooks,image_cache,audio_cache}
cp cli-config.yaml.example ~/.hermes/config.yaml
touch ~/.hermes/.env
配置API Key,推荐用OpenRouter(支持200多个模型,一个Key用到底):
echo 'OPENROUTER_API_KEY=sk-or-v1-你的Key' >> ~/.hermes/.env
设置全局命令:
mkdir -p ~/.local/bin
ln -sf "$(pwd)/venv/bin/hermes" ~/.local/bin/hermes
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
验证安装是否正常:
hermes doctor
初始化配置
hermes setup
向导会引导你配置:选择LLM提供商(OpenRouter、Anthropic、OpenAI或本地端点)、粘贴API Key、选择代码执行后端(推荐选Docker,安全隔离)。
如果你之前用过OpenClaw,Hermes会自动检测并提供迁移选项,记忆、技能、API Key可以一键导入。
启动和基本操作
启动命令行界面:
hermes
常用命令:
hermes # 启动CLI交互界面
hermes gateway # 启动消息网关(Telegram/Discord等)
hermes status # 查看运行状态
hermes logs # 查看日志(支持过滤)
hermes doctor # 检查环境配置是否正常
24小时后台运行
关闭终端之后服务需要继续运行,用systemd管理是最可靠的方式:
sudo nano /etc/systemd/system/hermes-gateway.service
写入:
[Unit]
Description=Hermes Agent Gateway
After=network.target
[Service]
Type=simple
User=你的用户名
WorkingDirectory=/home/你的用户名
ExecStart=/home/你的用户名/.local/bin/hermes gateway
Restart=always
RestartSec=10
Environment=PATH=/home/你的用户名/.local/bin:/usr/bin:/bin
[Install]
WantedBy=multi-user.target
启用并启动:
sudo systemctl daemon-reload
sudo systemctl enable hermes-gateway
sudo systemctl start hermes-gateway
sudo systemctl status hermes-gateway
看到active (running)说明已经在后台运行了,重启服务器也会自动恢复。
接入Telegram
在Telegram搜索BotFather,发送/newbot,按提示设置Bot名称,获取Token。
把Token写入配置:
echo 'TELEGRAM_BOT_TOKEN=你的Token' >> ~/.hermes/.env
在~/.hermes/config.yaml里启用Telegram:
gateway:
telegram:
enabled: true
重启gateway服务:
sudo systemctl restart hermes-gateway
找到你建的Bot,发送/start,收到回复说明接入成功。之后可以在手机Telegram里直接给Agent下指令,它在VPS上执行,你随时查看进度。
常见问题
安装时提示Python版本不对:uv会自动下载Python 3.11,不需要手动安装,但需要确认uv已经正确安装并在PATH里。
hermes doctor报错:按输出提示处理,通常是某个依赖没装或者环境变量没配。
gateway启动后Telegram收不到消息:检查Bot Token是否正确,确认~/.hermes/.env里的变量格式没有多余空格或引号。
查看详细日志排查问题:
journalctl -u hermes-gateway -f
# 或者
hermes logs --tail 100
完整文档在官方站点:hermes-agent.nousresearch.com/docs,部署遇到问题去GitHub Issues搜一下,活跃度很高,大多数常见问题都有人回答过。