教程:構建每日簡報機器人
在本教程中,你將創建一個個人簡報機器人,它每天早晨自動喚醒,研究你關心的主題,總結髮現內容,並將簡潔的簡報直接發送到你的 Telegram 或 Discord。
最終,你將擁有一個完全自動化的流程,結合了 網絡搜索、定時調度、任務委派 和 消息發送 —— 無需編寫任何代碼。
我們將構建什麼
以下是整個流程:
- 早上 8:00 —— 定時調度器觸發你的任務
- Hermes 啟動 一個全新的 Agent 會話,加載你的提示(prompt)
- 網絡搜索 獲取你關注主題的最新資訊
- 內容摘要 將信息提煉為清晰的簡報格式
- 消息發送 將簡報推送到你的 Telegram 或 Discord
整個過程全自動運行。你只需在喝早咖啡時閱讀你的簡報即可。
前提條件
開始之前,請確保你已具備以下條件:
- 已安裝 Hermes Agent —— 參見 安裝指南
- 已運行網關(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.
良好提示明確指定了 搜索內容、文章數量、輸出格式 和 語氣風格。它將 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."
使用委派實現並行研究
為了加快簡報生成速度,可指示 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 隨後將所有結果整合為一份精煉的簡報。更多細節請參見 委派文檔。
僅工作日調度
不需要週末簡報?使用僅匹配週一至週五的 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."
在提示中明確說明簡報是為誰準備的,能顯著提升相關性。告訴 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") 刪除它。
檢查網關狀態
確保調度器正在運行:
hermes cron status
如果網關未運行,你的任務將無法執行。建議將其安裝為後臺服務以保證可靠性:
hermes gateway install
# 或在 Linux 服務器上
sudo hermes gateway install --system
更進一步
你已經成功構建了一個可用的每日簡報機器人。以下是你可以繼續探索的方向:
- 計劃任務(Cron) — 有關調度格式、重複限制和交付選項的完整參考
- 委託 — 深入探討並行子 Agent 工作流
- 消息平臺 — 配置 Telegram、Discord 或其他交付目標
- 記憶 — 跨會話的持久化上下文
- 技巧與最佳實踐 — 更多提示工程建議
簡報機器人模式適用於任何任務:競爭對手監控、GitHub 倉庫摘要、天氣預報、投資組合跟蹤、服務器健康檢查,甚至每日笑話。只要您能用提示描述它,就可以將其安排執行。