字节笔记本
2026年5月16日
Hermes Agent Daily Briefing Bot:打造每日自动简报机器人
Hermes Agent 是 NousResearch 推出的开源 AI Agent 框架,支持 Web 搜索、Cron 定时调度、子 Agent 委派和多平台消息推送。本教程将带你从零构建一个每日自动简报机器人,每天早上自动搜索你关心的主题、生成摘要并推送到 Telegram 或 Discord。
我们要构建什么
整体流程如下:
- 早上 8:00 — Cron 调度器触发任务
- Hermes 启动 一个全新的 Agent 会话,加载你的 Prompt
- Web 搜索 拉取你关注主题的最新资讯
- 摘要生成 将搜索结果提炼为简洁的简报格式
- 消息推送 将简报发送到你的 Telegram 或 Discord
整个过程完全自动运行,你只需在喝早咖啡时阅读简报即可。
前置条件
开始之前,请确保你已具备以下条件:
- Hermes Agent 已安装 — 参见 Installation guide
- Gateway 已运行 — Gateway 守护进程负责执行 Cron 任务:
bash
hermes gateway install # 安装为用户服务 sudo hermes gateway install --system # Linux 服务器:开机自启系统服务 # 或者 hermes gateway # 前台运行 - Firecrawl API Key — 在环境变量中设置
FIRECRAWL_API_KEY用于 Web 搜索 - 消息平台已配置(可选但推荐)— 已设置 Telegram 或 Discord 的 Home Channel
没有配置消息平台?没问题。你可以使用
deliver: "local"跟随本教程,简报会保存到~/.hermes/cron/output/目录,随时可以查看。
第一步:手动测试工作流
在自动化之前,先手动验证简报功能是否正常。启动一个聊天会话:
hermes然后输入以下 Prompt:
Search for the latest news about AI agents and open source LLMs.
Summarize the top 3 stories in a concise briefing format with links.Hermes 会搜索网络、阅读结果并生成类似如下的内容:
☀️ Your AI Briefing — March 8, 2026
1. Qwen 3 Released with 235B Parameters
Alibaba's latest open-weight model matches GPT-4.5 on several
benchmarks while remaining fully open source.
→ https://qwenlm.github.io/blog/qwen3/
2. LangChain Launches Agent Protocol Standard
A new open standard for agent-to-agent communication gains
adoption from 15 major frameworks in its first week.
→ https://blog.langchain.dev/agent-protocol/
3. EU AI Act Enforcement Begins for General-Purpose Models
The first compliance deadlines hit, with open source models
receiving exemptions under the 10M parameter threshold.
→ https://artificialintelligenceact.eu/updates/
---
3 stories • Sources searched: 8 • Generated by Hermes Agent如果输出正常,就可以进入自动化阶段了。
反复调优格式:尝试不同的 Prompt 直到获得满意的输出。可以添加诸如"使用 emoji 标题"或"每条摘要不超过两句话"等指令。最终确定的 Prompt 将直接用于 Cron 任务。
第二步:创建 Cron 任务
现在将简报设置为每天早上自动运行。有两种创建方式。
创建 Cron 任务前,请确保 Hermes 已全局配置了默认 Model 和 Provider。如果某个任务需要使用不同的模型,在创建时设置单独的 Model/Provider 覆盖即可。
方式 A:自然语言(聊天中创建)
直接用自然语言告诉 Hermes 你想要什么:
Every morning at 8am, search the web for the latest news about AI agents
and open source LLMs. Summarize the top 3 stories in a concise briefing
with links. Use a friendly, professional tone. Deliver to telegram.Hermes 会通过统一的 cronjob 工具自动创建 Cron 任务。
方式 B:CLI Slash 命令
使用 /cron 命令获得更精细的控制:
/cron add "0 8 * * *" "Search the web for the latest news about AI agents and open source LLMs. Find at least 5 recent articles from the past 24 hours. Summarize the top 3 most important stories in a concise daily briefing format. For each story include: a clear headline, a 2-sentence summary, and the source URL. Use a friendly, professional tone. Format with emoji bullet points and end with a total story count."
黄金法则:自包含 Prompt
核心概念:Cron 任务在全新的会话中运行——没有之前对话的记忆,也没有"之前设置过"的上下文。你的 Prompt 必须包含 Agent 完成任务所需的所有信息。
反面示例:
Do my usual morning briefing.
正面示例:
Search the web for the latest news about AI agents and open source LLMs.
Find at least 5 recent articles from the past 24 hours. Summarize the
top 3 most important stories in a concise daily briefing format. For each
story include: a clear headline, a 2-sentence summary, and the source URL.
Use a friendly, professional tone. Format with emoji bullet points.正面示例明确指定了搜索什么、找多少篇文章、什么格式和什么语气,Agent 一次就能完成全部工作。
第三步:自定义简报
基本简报运行正常后,可以进一步发挥创意。
多主题简报
在一份简报中覆盖多个领域:
/cron add "0 8 * * *" "Create a morning briefing covering three topics. For each topic, search the web for recent news from the past 24 hours and summarize the top 2 stories with links.
Topics:
1. AI and machine learning — focus on open source models and agent frameworks
2. Cryptocurrency — focus on Bitcoin, Ethereum, and regulatory news
3. Space exploration — focus on SpaceX, NASA, and commercial space
Format as a clean briefing with section headers and emoji. End with today's date and a motivational quote."使用 Delegation 实现并行研究
为了让简报生成更快,可以让 Hermes 将每个主题委派给子 Agent:
/cron add "0 8 * * *" "Create a morning briefing by delegating research to sub-agents. Delegate three parallel tasks:
1. Delegate: Search for the top 2 AI/ML news stories from the past 24 hours with links
2. Delegate: Search for the top 2 cryptocurrency news stories from the past 24 hours with links
3. Delegate: Search for the top 2 space exploration news stories from the past 24 hours with links
Collect all results and combine them into a single clean briefing with section headers, emoji formatting, and source links. Add today's date as a header."每个子 Agent 独立且并行地搜索,然后主 Agent 将所有结果整合为一份精炼的简报。详见 Delegation 文档。
仅工作日调度
不需要周末简报?使用针对周一到周五的 Cron 表达式:
/cron add "0 8 * * 1-5" "Search for the latest AI and tech news..."
每日双次简报
获取早晨概览和晚间回顾:
/cron add "0 8 * * *" "Morning briefing: search for AI news from the past 12 hours..."
/cron add "0 18 * * *" "Evening recap: search for AI news from the past 12 hours..."通过 Memory 添加个人上下文
如果你启用了 Memory 功能,可以存储跨会话持久化的偏好。但请注意——Cron 任务在全新会话中运行,没有对话记忆。要添加个人上下文,请直接写入 Prompt:
/cron add "0 8 * * *" "You are creating a briefing for a senior ML engineer who cares about: PyTorch ecosystem, transformer architectures, open-weight models, and AI regulation in the EU. Skip stories about product launches or funding rounds unless they involve open source.
Search for the latest news on these topics. Summarize the top 3 stories with links. Be concise and technical — this reader doesn't need basic explanations."定制 Persona:在 Prompt 中包含简报的目标读者信息,能显著提升内容相关性。告诉 Agent 你的角色、兴趣和需要跳过的内容类型。
第四步:管理你的任务
查看所有已调度任务
在聊天中:
/cron list
或在终端中:
hermes cron list输出类似:
ID | Name | Schedule | Next Run | Deliver
------------|-------------------|-------------|--------------------|--------
a1b2c3d4 | Morning Briefing | 0 8 * * * | 2026-03-09 08:00 | telegram
e5f6g7h8 | Evening Recap | 0 18 * * * | 2026-03-08 18:00 | telegram删除任务
在聊天中:
/cron remove a1b2c3d4
或者用自然语言:
Remove my morning briefing cron job.
Hermes 会使用 cronjob(action="list") 查找任务,再用 cronjob(action="remove") 删除它。
检查 Gateway 状态
确认调度器正在运行:
hermes cron status如果 Gateway 没有运行,任务将不会执行。将其安装为后台服务以确保可靠性:
hermes gateway install
# 或在 Linux 服务器上
sudo hermes gateway install --system进阶探索
你已经构建了一个可运行的每日简报机器人。以下是后续可以探索的方向:
- Scheduled Tasks (Cron) — 调度格式、重复限制和推送选项的完整参考
- Delegation — 并行子 Agent 工作流的深入指南
- Messaging Platforms — 设置 Telegram、Discord 或其他推送目标
- Memory — 跨会话的持久化上下文
- Tips & Best Practices — 更多 Prompt 工程技巧
简报机器人模式适用于任何场景:竞品监控、GitHub 仓库摘要、天气预报、投资组合跟踪、服务器健康检查,甚至每日笑话。只要你能用 Prompt 描述出来,就能将它定时调度。