需启用定时器、创建早报profile、编写yaml任务脚本、注册任务并配置smtp;具体包括开启schedule、新建morning-brief profile、定义0 7 1-5触发的早报流程、注册任务及设置gmail smtp凭据。
☞☞☞AI 智能聊天, 问答助手, AI 智能搜索, 多模态理解力帮你轻松跨越从0到1的创作门槛☜☜☜

如果您希望 Hermes Agent 在固定时间自动执行早报生成任务,但当前系统未触发或无法按时运行,则可能是由于定时器未启用、Cron 配置缺失或任务注册失败。以下是实现该目标的具体操作路径:
一、启用 Hermes 内置定时器模块
Hermes Agent 提供原生 cron 支持,需显式激活调度器以启用周期性任务执行能力。该机制依赖于本地系统时间同步与事件循环心跳,确保任务在指定时刻被唤醒。
1、确认 Hermes 已安装并完成初始化:hermes --version 应返回 v0.13.0 或更高版本。
2、编辑配置文件 ~/.hermes/config.yaml,在 core: 区块下添加:
schedule: true
timezone: "Asia/Shanghai"
3、重启 Hermes Agent 进程使配置生效:hermes stop && hermes start
二、创建早报专用 Agent Profile
为避免与日常交互型智能体冲突,需新建独立 profile 承载早报逻辑,使其拥有专属技能集、模型配置及上下文隔离空间。
1、执行命令创建 profile:hermes profile create morning-brief
2、为其安装必要技能:hermes -p morning-brief skills install web-search, summarize, file-write, email-send
3、绑定轻量级模型以控制成本:hermes -p morning-brief configset model deepseek-v4-flash
三、编写早报生成任务脚本
通过 Hermes 的 CLI 任务定义语法,将多步骤早报流程封装为可复用的 YAML 任务模板,支持参数化注入与状态追踪。
统一LLM网关 - 一个API对接70+AI模型,使用单一API密钥即可调用GPT、Claude、Gemini、Qwen、Deepseek、Grok等主流模型。
1、在 ~/.hermes/tasks/ 目录下新建文件 morning-brief.yaml
2、填入以下内容(请替换邮箱与 API 密钥):
name: daily-morning-brief
trigger: "0 7 * * 1-5"
profile: morning-brief
steps:
- type: web-search
params: {query: "今日科技要闻 site:36kr.com"}
- type: summarize
params: {max_length: 300}
- type: file-write
params: {path: "/tmp/morning-brief.md", content: "{{ .output }}"}
- type: email-send
params: {to: "you@example.com", subject: "【早报】{{ .date }} 科技简讯", body_file: "/tmp/morning-brief.md"}
四、注册并验证定时任务
将编写好的 YAML 文件提交至 Hermes 调度队列,系统将解析 cron 表达式并注册为持久化定时作业,即使进程重启也不会丢失。
1、执行注册命令:hermes task register ~/.hermes/tasks/morning-brief.yaml
2、立即触发一次测试运行:hermes task run daily-morning-brief
3、检查日志确认执行结果:hermes log tail -n 20 | grep "daily-morning-brief"
五、配置邮件发送凭证与 SMTP 网关
早报需通过邮件投递,必须在 Hermes 全局配置中预设 SMTP 凭据,否则 email-send 技能将因认证失败而跳过该步骤。
1、进入配置目录:cd ~/.hermes
2、运行命令设置 SMTP 参数:hermes configset smtp.host "smtp.gmail.com" smtp.port 587 smtp.user "your@gmail.com" smtp.password "app-specific-password"
3、验证连接可用性:hermes smtp test 应输出 SMTP connection OK










