跳到主要内容

教程:日报机器人

这个机器人每天早晨自动启动、调研你关心的话题、汇总要点,然后把简报发到你的 Telegram 或 Discord。结合了网络搜索cron 定时任务委派消息推送——无需编写任何代码。

我们要搭建什么

流程如下:

  1. 早上 8:00 — cron 定时器触发任务
  2. Hermes 启动一个全新的智能体会话,加载你的提示词
  3. 网络搜索拉取你关注话题的最新资讯
  4. 摘要生成将内容精炼成整洁的简报格式
  5. 消息推送将简报发送到你的 Telegram 或 Discord

整个流程无需干预,你只需端着晨间咖啡读简报就好。

前置条件

开始之前,请确认以下条件已满足:

  • 已安装 Hermes Agent — 参见安装指南
  • Gateway 已运行 — Gateway 守护进程负责执行 cron 任务:
    hermes gateway install # 安装为用户级服务
    sudo hermes gateway install --system # Linux 服务器:系统开机自启服务
    # 或者
    hermes gateway # 在前台运行
  • 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

如果这一步顺利,就可以开始自动化了。

提示

持续调整格式 多试几个提示词,直到得到你满意的输出格式。可以加入"使用 emoji 标题"或"每条摘要不超过两句话"等指令。调好之后,把最终提示词填入 cron 任务即可。

第二步:创建 Cron 任务

现在来设置每天早晨自动运行的定时任务。有两种方式可以选择。

方式 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 斜杠命令

使用 /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."

黄金法则:提示词必须自给自足

警告

核心概念 cron 任务运行在全新的会话中——没有之前对话的记忆,也不知道你"之前设置过什么"。提示词必须包含智能体完成任务所需的一切信息

糟糕的提示词:

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 任务在没有对话记忆的全新会话中运行。要加入个人上下文,请直接写入提示词:

/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") 将其删除。

检查 Gateway 状态

确认调度器确实在运行:

hermes cron status

如果 Gateway 没有运行,定时任务不会执行。建议将其安装为后台服务以保证可靠性:

hermes gateway install
# 或在 Linux 服务器上
sudo hermes gateway install --system

延伸阅读

日报机器人已经跑起来了。下面是一些可以继续探索的方向:

提示

还能定时做什么? 日报机器人的模式适用于任何场景:竞品监控、GitHub 仓库摘要、天气预报、投资组合跟踪、服务器健康检查,甚至每日一句笑话。只要能用提示词描述的任务,都可以定时执行。