🔧 前置准备(必做!)
先启动Gateway,这个是任务调度的心脏,不启动的话任务永远不会执行!
hermes gateway start
✅ 验证:hermes gateway status 显示 running 就对了
📝 第一步:创建3个专业Agent(1分钟)
每个Agent只干一件事,绝对专一,直接复制粘贴:
# 🌤️ 天气Agent:只负责报天气
hermes profile create weather --clone
# 😊 心情Agent:只负责选心情
hermes profile create mood --clone
# ✍️ 问候Agent:只负责写问候语
hermes profile create greeting --clone
✅ 验证:hermes profile list 能看到这三个新Profile就对了
🎭 第二步:给每个Agent写人设(2分钟)
每个Agent的SOUL都超简单,复制粘贴到对应路径就行:
👉 🌤️ 天气Agent的SOUL
路径:~/.hermes/profiles/weather/SOUL.md
你是天气播报员,只从这三个里随机选一个返回:
☀️ 晴天 | ☁️ 多云 | 🌧️ 小雨
不要加任何其他内容!不要解释!
👉 😊 心情Agent的SOUL
路径:~/.hermes/profiles/mood/SOUL.md
你是心情占卜师,只从这三个里随机选一个返回:
😊 开心 | 😌 平静 | 💪 元气满满
不要加任何其他内容!不要解释!
👉 ✍️ 问候Agent的SOUL
路径:~/.hermes/profiles/greeting/SOUL.md
你是问候创作者,把天气和心情整合成一句20字以内的早安问候。
示例:
"早安!今天多云,心情平静,祝你顺利☁️"
🚀 第三步:手动跑通完整流程(2分钟)
跟着敲,每一步都有确定性结果!
# ========== 1. 初始化看板 ==========
hermes kanban init
# ========== 2. 创建两个并行任务 ==========
hermes kanban create "查询今天天气"
# ✅ 输出示例:Created t_04d94e84 (ready, assignee=-)
hermes kanban create "预测今天心情"
# ✅ 输出示例:Created t_478b9a98 (ready, assignee=-)
# ❗ 注意:任务ID是 t_xxxx 这种格式!不是t1 t2!每次都不一样!
# 把你自己得到的两个任务ID记下来,后面要用!
# ========== 3. 分配任务给对应Agent ==========
# 替换成你自己的任务ID!
hermes kanban assign t_04d94e84 weather
hermes kanban assign t_478b9a98 mood
# ========== 4. 触发执行 ==========
hermes kanban dispatch
# ========== 5. 等10秒看结果! ==========
hermes kanban list
# ✅ 两个任务的状态应该从 ready 变成 done 了!
# 看天气Agent的输出
hermes kanban log t_04d94e84
# 看心情Agent的输出
hermes kanban log t_478b9a98
# ========== 6. 创建第三个任务,建立依赖! ==========
hermes kanban create "生成问候语"
# ✅ 得到第三个任务ID,比如:t_44c9cd3c
hermes kanban assign t_44c9cd3c greeting
# 建立依赖:问候任务必须等天气和心情都做完才开始
hermes kanban link t_04d94e84 t_44c9cd3c # 依赖天气
hermes kanban link t_478b9a98 t_44c9cd3c # 依赖心情
# ========== 7. 再次触发执行 ==========
hermes kanban dispatch
# ========== 8. 见证奇迹! ==========
hermes kanban log t_44c9cd3c
🎉 你会得到这个!
大概10秒后,你会看到:
╭─ ⚕ Hermes ───────────────────────────────────╮
早安!今天多云,心情开心,愿你一天顺利☁️
╰──────────────────────────────────────────────╯
✅ 搞定!你已经跑通了一个完整的多Agent协作系统!
🚀 接下来可以怎么玩?
-
加个Cron定时:每天7点自动生成问候,直接发微信/飞书/Telegram
hermes cron add "0 7 * * *" "生成今日问候" --deliver wechat -
加个名言Agent:每天随机加一句名人名言,让问候更有料
-
加个审核Agent:检查问候语有没有问题,没问题再发
-
套用到任何场景:新闻摘要、代码审查、产品调研、竞品监控...只要是多步骤的任务都能这么玩
💬 最后说两句
这个小例子虽然简单,但所有多Agent协作的核心机制都包含了:
- Profile隔离
- 并行执行
- 任务依赖
- 看板流转
- 数据自动传递
按照同样的模式,你可以搭出10个、20个Agent的复杂工作流,处理越来越复杂的任务。
你们想用这个机制搞什么自动化?评论区聊聊! 觉得有用的话点赞收藏关注一下~下次搞更酷的协作者全自动模式!🚀
📋 本教程用到的所有指令汇总
| 指令 | 作用 |
|---|---|
hermes gateway start | 启动Gateway任务调度器 |
hermes gateway status | 查看Gateway运行状态 |
hermes profile create <name> --clone | 创建新的Agent Profile,克隆当前配置 |
hermes profile list | 查看所有Agent Profile |
hermes kanban init | 初始化看板数据库 |
hermes kanban create "任务标题" | 在看板上创建新任务 |
hermes kanban assign <任务ID> <Profile名> | 把任务分配给指定的Agent |
hermes kanban dispatch | 触发一次任务调度,执行ready状态的任务 |
hermes kanban list | 查看看板上所有任务的状态 |
hermes kanban log <任务ID> | 查看指定任务的执行日志和结果 |
hermes kanban link <父任务ID> <子任务ID> | 建立任务依赖关系,子任务等父任务完成才执行 |
hermes cron add "cron表达式" "任务描述" --deliver <渠道> | 创建定时任务,结果自动推送到指定渠道 |
#Hermes #AI代理 #多Agent #自动化 #效率工具 #程序员日常