教程:构建每日简报机器人
在本教程中,你将创建一个个人简报机器人,它每天早晨自动唤醒,研究你关心的主题,总结发现内容,并将简洁的简报直接发送到你的 Telegram 或 Discord。
最终,你将拥有一个完全自动化的流程,结合了 网络搜索、定时调度、任务委派 和 消息发送 —— 无需编写任何代码。
我们将构建什么
以下是整个流程:
- 早上 8:00 —— 定时调度器触发你的任务
- Hermes 启动 一个全新的代理会话,加载你的提示(prompt)
- 网络搜索 获取你关注主题的最新资讯
- 内容摘要 将信息提炼为清晰的简报格式
- 消息发送 将简报推送到你的 Telegram 或 Discord
整个过程全自动运行。你只需在喝早咖啡时阅读你的简报即可。
前提条件
开始之前,请确保你已具备以下条件:
- 已安装 Hermes 代理 —— 参见 安装指南
- 已运行网关(Gateway) —— 网关守护进程负责执行定时任务:
hermes gateway install # Install as a user service
sudo hermes gateway install --system # Linux servers: boot-time system service
# or
hermes gateway # Run in foreground - Firecrawl API 密钥 —— 在环境变量中设置
FIRECRAWL_API_KEY以启用网络搜索 - 消息系统配置(可选但推荐)—— Telegram 或 Discord 已设置好主频道
你仍然可以使用 deliver: "local" 完成本教程。简报将保存至 ~/.hermes/cron/output/,你可以随时阅读。
第一步:手动测试工作流
在自动化之前,先确保简报功能正常。启动一个聊天会话:
hermes
然后输入以下提示:
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
如果成功,说明你已准备好进入自动化阶段。
尝试不同的提示,直到获得你满意的输出效果。可以加入如“使用表情符号标题”或“每段摘要控制在两句话以内”等指令。最终确定的提示将用于定时任务。
第二步:创建定时任务
现在让我们将此流程设置为每天早晨自动运行。你可以通过两种方式实现。
选项 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 工具为你创建定时任务。
选项 B:CLI 斜杠命令
使用 /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."
黄金法则:自包含的提示
定时任务在 完全全新的会话 中运行 —— 不会保留你之前对话的记忆,也不会了解你“之前设置过什么”。你的提示必须包含 执行任务所需的一切信息。
糟糕的提示:
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.
良好提示明确指定了 搜索内容、文章数量、输出格式 和 语气风格。它将代理完成任务所需的所有信息整合在一句话中。
第三步:自定义简报内容
一旦基础简报功能正常,你就可以开始创意发挥了。
多主题简报
在一个简报中涵盖多个领域:
/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."
使用委派实现并行研究
为了加快简报生成速度,可指示 Hermes 将每个主题委派给子代理:
/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."
每个子代理独立并行搜索,主代理随后将所有结果整合为一份精炼的简报。更多细节请参见 委派文档。
仅工作日调度
不需要周末简报?使用仅匹配周一至周五的 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..."
通过记忆添加个人上下文
如果你启用了 记忆功能,可以存储跨会话持久化的偏好设置。但请记住 —— 定时任务在全新会话中运行,不包含对话记忆。要添加个人上下文,需直接将信息嵌入提示中:
/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."
在提示中明确说明简报是为谁准备的,能显著提升相关性。告诉代理你的角色、兴趣点以及哪些内容可以跳过。
第四步:管理你的任务
列出所有已调度任务
在聊天中输入:
/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") 删除它。
检查网关状态
确保调度器正在运行:
hermes cron status
如果网关未运行,你的任务将无法执行。建议将其安装为后台服务以保证可靠性:
hermes gateway install
# or on Linux servers
sudo hermes gateway install --system
更进一步
你已经成功构建了一个可用的每日简报机器人。以下是你可以继续探索的方向:
- 计划任务(Cron) — 有关调度格式、重复限制和交付选项的完整参考
- 委托 — 深入探讨并行子代理工作流
- 消息平台 — 配置 Telegram、Discord 或其他交付目标
- 记忆 — 跨会话的持久化上下文
- 技巧与最佳实践 — 更多提示工程建议
简报机器人模式适用于任何任务:竞争对手监控、GitHub 仓库摘要、天气预报、投资组合跟踪、服务器健康检查,甚至每日笑话。只要您能用提示描述它,就可以将其安排执行。