Hermes Agent 部署及初始配置指南
1. 环境准备
- 操作系统要求:
- 推荐使用 Ubuntu Server 24.04 LTS 版本,后期可更换为 26.04 LTS。
- 硬件配置为 2 核心、2GB 内存、20GB 存储。
- 必要的软件依赖:
- 使用官方一键脚本进行部署,不修改原位置,使用默认国际源。
- 初始配置:
- 执行以下命令以更新系统并清理缓存:
sudo apt update && sudo apt -y --auto-remove --purge full-upgrade && sudo apt -y --purge autoremove && sudo apt clean -y- 网络配置:
- 不开放外部访问,维护使用 Web 页面 SSH 进行。
- 交互使用聊天工具。
- 配置允许访问互联网。
2. 安装步骤
- 系统安装推荐在普通用户身份下进行。
- 下载安装包:
- 使用以下命令下载并执行安装脚本:
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash- 安装用户需具备 sudo 权限,因为在一键安装脚本中还需要进行部分系统环境变量和工具的配置。
注:Hermes Agent 自身是不需要 root 权限的。也不建议 root 用户安装。
3. 启动与验证
- 配置前准备:
- 刷新一下系统环境变量。
- 如果使用 Bash:
source ~/.bashrc- 如果使用 Zsh:
source ~/.zshrc- 安装二维码显示工具:
~/.hermes/hermes-agent/venv/bin/python -m ensurepip ~/.hermes/hermes-agent/venv/bin/python -m pip install --upgrade pip qrcode aiohttp cryptography- 将 Gateway 配置为系统级自动运行:
sudo .hermes/hermes-agent/venv/bin/hermes gateway install --system- 初始配置 Agent 服务:
- 常见配置与命令如上图。
4. 配置 Hermes Agent
- 以配置飞书为例
- 执行
hermes setup命令进行配置。- 选择接入配置,按照需要进行选择。
![]()
- 完成上级模型连接配置,选择部署位置
- 选择默认的在本地运行。
- 选择配置接入的消息工具:
**空格选择回车继续,配置飞书为例**
- 选择二维码接入,因为之前已经配置了二维码插件。
- SSH终端显示二维码,并等待客户端配置。
- 客户端飞书扫描二维码,创建完成后会弹出下一步菜单。选择使用设备码进行安全验证。
- 选择群聊中智能体如何响应消息:只有 @ 智能体才会获得回复。
- 设置本地频道:默认保持为空,回车后会弹出完成设置的界面。
![]()
- 配置技能
✅ 已启用工具(无需额外配置)
工具 功能 使用示例 🔍 Web Search & Scraping 网络搜索和内容提取 web_search “Python 教程” 🌐 Browser Automation 浏览器自动化(导航、点击、输入) navigate https://example.com 💻 Terminal & Processes 命令执行和进程管理 terminal ls -la 📁 File Operations 文件读写、搜索、补丁 read ~/config.json ⚡ Code Execution 代码执行(Python/JS等) execute_code “print(‘hello’)” 👁️ Vision / Image Analysis 图像分析和识别 vision_analyze image.jpg 🎨 Image Generation AI 图像生成 image_generate “a cat” 🔊 Text-to-Speech 文字转语音 text_to_speech “Hello” 📚 Skills 技能管理和执行 skills list 📋 Task Planning 任务规划和跟踪 todo “完成报告” 💾 Memory 跨会话持久记忆 自动保存上下文 🔎 Session Search 搜索历史对话 session_search “API配置” ❓ Clarifying Questions 主动提问澄清需求 自动触发 👥 Task Delegation 任务委派给子 Agent delegate_task “分析数据” ⏰ Cron Jobs 定时任务 cron “0 9 * * *” “备份数据” 📨 Cross-Platform Messaging 跨平台消息发送 send_message “任务完成” 🖱️ Computer Use (macOS) 桌面自动化控制 click x=100 y=200 🔧 需要额外配置的工具
- 🎬 Video Analysis(需要视频能力模型)
配置支持视频的模型 hermes config set model.video.enabled true hermes config set model.video.provider openai hermes config set model.video.model gpt-4-vision-preview
- 🎬 Video Generation(需要专门 API)
配置视频生成 API(如 Runway、Pika) hermes config set video_generation.provider runway hermes config set video_generation.api_key YOUR_RUNWAY_API_KEY
- 🐦 X (Twitter) Search(需要 OAuth)
方法1:xAI API export XAI_API_KEY="your_xai_key" 方法2:OAuth 认证 hermes twitter auth 按提示完成 Twitter OAuth 授权
- 🧠 Mixture of Agents(无需 API Key,但需要多模型)
config.yaml mixture_of_agents: enabled: true aggregator: "deepseek/deepseek-chat" agents: - model: "openai/gpt-4" - model: "anthropic/claude-3" - model: "google/gemini-pro"
- 🧩 Context Engine(运行时动态工具)
启用上下文引擎 hermes config set context_engine.enabled true hermes config set context_engine.provider custom
- 🏠 Home Assistant(智能家居)
配置 Home Assistant 连接 hermes config set homeassistant.url http://localhost:8123 hermes config set homeassistant.token YOUR_LONG_LIVED_TOKEN
- 🎵 Spotify(音乐控制)
Spotify 开发者应用配置 hermes spotify auth 需要创建应用:https://developer.spotify.com
- 🤖 Yuanbao(元宝集成)
配置元宝 API hermes config set yuanbao.app_id YOUR_APP_ID hermes config set yuanbao.secret_key YOUR_SECRETbash
⚡ 快速操作指南
启用/禁用工具
bash交互式工具管理
hermes tools
或命令行启用
hermes tools enable web_search
hermes tools disable browser_automation
检查工具状态
bash查看所有工具及其配置状态
hermes tools list –verbose
测试特定工具
hermes test tool web_search
工具使用示例
bashWeb 搜索
hermes chat “搜索 Python 异步编程教程”
文件操作
hermes chat “读取 ~/.hermes/config.yaml 并分析配置”
定时任务
hermes chat “设置每天上午9点备份日志”
图像生成
hermes chat “生成一只在太空中的猫的图片”
代码执行
hermes chat “执行 Python 代码计算斐波那契数列前20项”
🎯 常用工作流
- 自动化报告生成
bash
hermes chat “””
- 搜索今天 AI 新闻
- 截取相关文章内容
- 生成总结报告
- 发送到飞书群
- 保存到文件
“””
2. 监控任务
bash
hermes chat “””
创建 cron 任务:
- 每小时检查服务器状态
- 如果 CPU > 80% 发送告警
- 记录日志到文件
“””
- 多步数据处理
bash
hermes chat “””
- 读取 data.csv
- 分析数据趋势
- 生成图表
- 将结果保存为 report.pdf
- 发送邮件通知
“””
🔒 安全建议
对于敏感工具(Terminal、File Operations、Computer Use),建议:bash
启用审批模式
hermes config set approvals.mode manual
设置命令白名单
hermes config set terminal.allowed_commands “ls,cat,grep,ps”
限制文件访问路径
hermes config set file.allowed_paths “/home/user/projects,/tmp”
🚀 快速测试
bash测试所有工具是否正常
hermes doctor –tools
交互式测试
hermes shell –enable-all-tools
运行示例技能
hermes skills run example_workflow
使用 hermes config edit 可以集中管理这些配置。5. 客户端验证配置
- 确保网关服务已启动:
- 执行
hermes profile list检查。
- 重启 Gateway 服务:
- 使用以下命令:
sudo /home/alan/.hermes/hermes-agent/venv/bin/hermes gateway restart- 或者:
sudo systemctl restart hermes-gateway
- 检查客户端接收列表:
- 执行
hermes pairing list,发现列表为空。
- 等待客户端发送消息,然后再次刷新命令。
- 执行
hermes pairing list。
- 客户端准入方式:
- a. 使用客户端收到的验证码进行批准(无需重启服务)。
- 客户端收到一个设备验证码,执行命令批准:
hermes pairing approve feishu 客户端收到的验证码- b. 直接修改配置文件,填写用户ID。
- 如果已经获取到用户ID,直接在
.hermes/.env中填写对应的字段。tail .hermes/.env
- 重启服务后客户端正常访问。
- 清除待验证列表:
- 执行
hermes pairing clear-pending。
6. 常见问题与解决方案
- 安装失败处理:
- 检查网络连接是否正常。
- 确保脚本具有可执行权限。
- 服务启动异常处理:
- 检查服务状态并查看日志。
- 如果服务未启动,尝试重新安装或检查依赖项。
顺序 命令说明 命令 1 更新系统并清理缓存 sudo apt update && sudo apt -y --auto-remove --purge full-upgrade && sudo apt -y --purge autoremove && sudo apt clean -y2 安装 Hermes Agent `curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh 3 刷新系统环境变量 source ~/.bashrc或source ~/.zshrc4 安装二维码显示工具 ~/.hermes/hermes-agent/venv/bin/python -m ensurepip~/.hermes/hermes-agent/venv/bin/python -m pip install --upgrade pip qrcode aiohttp cryptography5 配置 Gateway 为系统自动运行 sudo /home/alan/.hermes/hermes-agent/venv/bin/hermes gateway install --system6 配置 Hermes Agent 服务 hermes setup7 重启 Gateway 服务 sudo .hermes/hermes-agent/venv/bin/hermes gateway restartsudo systemctl restart hermes-gateway8 客户端验证 hermes pairing list9 客户端准入 hermes pairing approve feishu 客户端收到的验证码10 清除待验证列表 hermes pairing clear-pending11 检查日志文件 tail /var/log/hermes-agent/agent.log12 查看 Hermes Agent 状态 hermes gateway status13 查看 Hermes Agent 配置 hermes config list14 重新配置 Hermes Agent hermes setup15 查看 Hermes Agent 配置文件 tail .hermes/.env16 检查 Hermes Agent 系统配置 hermes profile list
如果觉得文章对你有用,请随意赞赏
















