OA0 = Omni AI 0
OA0 是一个探索 AI 的论坛
现在注册
已注册用户请  登录
OA0  ›  技能包  ›  topic-monitor:监控感兴趣的主题并进行主动通知预警

topic-monitor:监控感兴趣的主题并进行主动通知预警

 
  training ·  2026-02-15 21:33:42 · 3 次点击  · 0 条评论  

名称: topic-monitor
版本: 1.3.4
描述: 监控您感兴趣的主题,并在重要动态发生时主动提醒。适用于需要自动化监控特定主题的场景(例如产品发布、价格变动、新闻话题、技术更新)。支持定时网络搜索、AI驱动的重要性评分、智能提醒与每周摘要,以及基于记忆的上下文摘要。
元数据: {"openclaw":{"requires":{"bins":["python3"],"env":{"TOPIC_MONITOR_TELEGRAM_ID":"可选 - 用于接收提醒的 Telegram 聊天 ID","TOPIC_MONITOR_DATA_DIR":"可选 - 默认为技能目录下的 .data/","WEB_SEARCH_PLUS_PATH":"可选 - 默认为相对路径"},"note":"所有环境变量均为可选。默认配置开箱即用。"}}}


主题监控器

监控重要事项,发生时即刻获知。

主题监控器将您的助手从被动响应转变为主动监控,持续关注您关心的主题,并仅在真正重要时智能地提醒您。


⚡ 快速开始 (v1.2.0 新增功能!)

只想监控一个主题?只需一条命令:

python3 scripts/quick.py "AI 模型发布"

搞定!这会创建一个具有合理默认值的主题:
- 查询语句: 根据主题名称自动生成
- 关键词: 从主题名称中提取
- 频率: 每日
- 重要性阈值: 中等
- 通知渠道: Telegram

快速开始选项

# 基础 - 仅主题名称
python3 scripts/quick.py "比特币价格"

# 指定关键词
python3 scripts/quick.py "安全漏洞" --keywords "CVE,漏洞,严重"

# 高优先级,每小时检查
python3 scripts/quick.py "生产告警" --frequency hourly --importance high

# 自定义查询语句
python3 scripts/quick.py "竞争对手新闻" --query "公司名 产品发布 融资"

# 不同通知渠道
python3 scripts/quick.py "团队更新" --channel discord

快速开始 vs 完整设置

特性 快速开始 完整设置
速度 ⚡ 一条命令 📝 向导式
默认值 智能默认 完全自定义
适用场景 单一主题 多个主题
配置 极简 完全控制

快速开始后,您随时可以自定义:

python3 scripts/manage_topics.py edit ai-model-releases --frequency hourly

核心功能

  1. 主题配置 - 使用自定义参数定义监控主题
  2. 定时监控 - 按可配置的时间间隔自动搜索
  3. AI 重要性评分 - 智能过滤:即时提醒 vs 摘要 vs 忽略
  4. 上下文摘要 - 不仅仅是链接,而是包含上下文的有意义摘要
  5. 每周摘要 - 将低优先级发现整理成可读报告
  6. 记忆集成 - 参考您过去的对话和兴趣点

完整设置 (交互式向导)

用于配置多个主题或高级选项:

python3 scripts/setup.py

向导将引导您完成:

  1. 主题 - 您想监控哪些主题?
  2. 搜索查询 - 如何搜索每个主题?
  3. 关键词 - 哪些术语表示内容相关?
  4. 频率 - 多久检查一次(每小时/每日/每周)?
  5. 重要性阈值 - 何时发送提醒(低/中/高)?
  6. 每周摘要 - 将非紧急发现整理成摘要

向导会创建包含您偏好的 config.json 文件。您随时可以编辑它,或使用 manage_topics.py 来添加/删除主题。

示例会话:

🔍 主题监控器 - 设置向导

您想监控哪些主题?
  > AI 模型发布
  > 安全漏洞
  > 

--- 主题 1/2: AI 模型发布 ---
  'AI 模型发布' 的搜索查询 [AI Model Releases news updates]: 新 AI 模型发布公告
  'AI 模型发布' 需要关注的关键词?
  > GPT, Claude, Llama, 发布

--- 主题 2/2: 安全漏洞 ---
  '安全漏洞' 的搜索查询 [Security Vulnerabilities news updates]: CVE 严重漏洞补丁
  '安全漏洞' 需要关注的关键词?
  > CVE, 漏洞, 严重, 补丁

我应该多久检查一次更新?
  1. 每小时
  2. 每日 *
  3. 每周

✅ 设置完成!

快速开始

已经知道怎么做了?这是手动方法:

# 从模板初始化配置
cp config.example.json config.json

# 添加一个主题
python3 scripts/manage_topics.py add "产品更新" \
  --keywords "发布,更新,补丁" \
  --frequency daily \
  --importance medium

# 测试监控(试运行)
python3 scripts/monitor.py --dry-run

# 设置 cron 以实现自动监控
python3 scripts/setup_cron.py

主题配置

每个主题包含:

  • name - 显示名称 (例如 "AI 模型发布")
  • query - 搜索查询 (例如 "新 AI 模型发布公告")
  • keywords - 相关性过滤器 (["GPT", "Claude", "Llama", "发布"])
  • frequency - hourly, daily, weekly
  • importance_threshold - high (立即提醒), medium (重要时提醒), low (仅摘要)
  • channels - 发送提醒的渠道 (["telegram", "discord"])
  • context - 您关心的原因(用于 AI 生成上下文摘要)
  • alert_on - 触发提醒的具体条件

config.json 示例

{
  "topics": [
    {
      "id": "ai-models",
      "name": "AI 模型发布",
      "query": "新 AI 模型发布 GPT Claude Llama",
      "keywords": ["GPT", "Claude", "Llama", "发布", "公告"],
      "frequency": "daily",
      "importance_threshold": "high",
      "channels": ["telegram"],
      "context": "为工作关注 AI 发展动态",
      "alert_on": ["model_release", "major_update"]
    },
    {
      "id": "tech-news",
      "name": "科技行业新闻",
      "query": "科技 初创公司 融资 收购",
      "keywords": ["初创公司", "融资", "A轮", "收购"],
      "frequency": "daily",
      "importance_threshold": "medium",
      "channels": ["telegram"],
      "context": "了解科技趋势",
      "alert_on": ["major_funding", "acquisition"]
    },
    {
      "id": "security-alerts",
      "name": "安全漏洞",
      "query": "CVE 严重漏洞 安全补丁",
      "keywords": ["CVE", "漏洞", "安全", "补丁", "严重"],
      "frequency": "hourly",
      "importance_threshold": "high",
      "channels": ["telegram", "email"],
      "context": "DevOps 安全监控",
      "alert_on": ["critical_cve", "zero_day"]
    }
  ],
  "settings": {
    "digest_day": "sunday",
    "digest_time": "18:00",
    "max_alerts_per_day": 5,
    "deduplication_window_hours": 72,
    "learning_enabled": true
  }
}

脚本

manage_topics.py

管理研究主题:

# 添加主题
python3 scripts/manage_topics.py add "主题名称" \
  --query "搜索查询" \
  --keywords "词1,词2" \
  --frequency daily \
  --importance medium \
  --channels telegram

# 列出主题
python3 scripts/manage_topics.py list

# 编辑主题
python3 scripts/manage_topics.py edit eth-price --frequency hourly

# 移除主题
python3 scripts/manage_topics.py remove eth-price

# 测试主题(预览结果而不保存)
python3 scripts/manage_topics.py test eth-price

monitor.py

主监控脚本(通过 cron 运行):

# 正常运行(发送提醒 + 保存状态)
python3 scripts/monitor.py

# 试运行(不发送提醒,显示将要执行的操作)
python3 scripts/monitor.py --dry-run

# 强制检查特定主题
python3 scripts/monitor.py --topic eth-price

# 详细日志
python3 scripts/monitor.py --verbose

工作原理:
1. 读取需要检查的主题(基于频率)
2. 使用 web-search-plus 或内置的 web_search 进行搜索
3. 使用 AI 重要性评分器对每个结果进行评分
4. 高重要性 → 立即提醒
5. 中等重要性 → 保存以备摘要
6. 低重要性 → 忽略
7. 更新状态以防止重复提醒

digest.py

生成每周摘要:

# 生成本周摘要
python3 scripts/digest.py

# 生成并发送
python3 scripts/digest.py --send

# 预览而不发送
python3 scripts/digest.py --preview

输出格式:

# 每周研究摘要 - [日期范围]

## 🔥 亮点

- **AI 模型**:Claude 4.5 发布,推理能力提升
- **安全**:流行框架中的严重 CVE 已修复

## 📊 按主题分类

### AI 模型发布
- [本周 3 项发现]

### 安全漏洞
- [本周 1 项发现]

## 💡 建议

根据您的兴趣,您可能想监控:
- "Kubernetes 安全" (本周提及 3 次)

setup_cron.py

配置自动监控:

# 交互式设置
python3 scripts/setup_cron.py

# 自动设置(使用默认值)
python3 scripts/setup_cron.py --auto

# 移除 cron 任务
python3 scripts/setup_cron.py --remove

创建的 cron 条目示例:

# 主题监控器 - 每小时主题
0 * * * * cd /path/to/skills/topic-monitor && python3 scripts/monitor.py --frequency hourly

# 主题监控器 - 每日主题
0 9 * * * cd /path/to/skills/topic-monitor && python3 scripts/monitor.py --frequency daily

# 主题监控器 - 每周摘要
0 18 * * 0 cd /path/to/skills/topic-monitor && python3 scripts/digest.py --send

AI 重要性评分

评分器使用多种信号来决定提醒优先级:

评分信号

高优先级 (立即提醒):
- 重大突发新闻(通过新鲜度 + 关键词密度检测)
- 价格变动 >10%(针对金融主题)
- 与您确切关键词匹配的产品发布
- 您使用的工具中的安全漏洞
- 对您提出的具体问题的直接回答

中优先级 (值得摘要):
- 相关但不紧急的新闻
- 跟踪产品的次要更新
- 您主题中有趣的发展动态
- 教程/指南发布
- 高参与度的社区讨论

低优先级 (忽略):
- 重复新闻(已提醒过)
- 略微相关的内容
- 低质量来源
- 过时信息
- 垃圾/推广内容

学习模式

启用时 (learning_enabled: true),系统会:
1. 跟踪您与哪些提醒进行了交互
2. 根据您的行为调整评分权重
3. 建议主题优化
4. 自动调整重要性阈值

学习数据存储在 .learning_data.json 中(保护隐私,从不共享)。

记忆集成

主题监控器连接到您的对话历史:

提醒示例:

🔔 Dirac Live 更新

版本 3.8 发布,包含您上周询问的房间校正改进。

上下文: 您提到工作室的低频响应有问题。此更新包含了新的低频优化。

[链接] | [完整详情]

工作原理:
1. 读取 references/memory_hints.md(创建此文件)
2. 扫描最近的对话日志(如果可用)
3. 将发现与过去的上下文匹配
4. 生成个性化摘要

memory_hints.md (可选)

帮助 AI 建立联系:

# 主题监控器的记忆提示

## AI 模型
- 使用 Claude 进行编码辅助
- 对推理能力改进感兴趣
- 比较不同用例的模型

## 安全
- 运行生产 Kubernetes 集群
- 需要快速修补严重 CVE
- 对零日漏洞披露感兴趣

## 科技新闻
- 关注初创企业生态系统
- 对开发者工具领域感兴趣
- 跟踪潜在的收购目标

提醒渠道

Telegram

需要 OpenClaw 消息工具:

{
  "channels": ["telegram"],
  "telegram_config": {
    "chat_id": "@your_username",
    "silent": false,
    "effects": {
      "high_importance": "🔥",
      "medium_importance": "📌"
    }
  }
}

Discord

由 Agent 传递(技能配置中无 webhook):

monitor.py 发出 DISCORD_ALERT JSON 负载,OpenClaw 通过消息工具发送它们。这与 Telegram 提醒流程匹配(结构化输出,技能代码中无直接 HTTP 调用)。

{
  "channels": ["discord"]
}

电子邮件

SMTP 或 API:

{
  "channels": ["email"],
  "email_config": {
    "to": "you@example.com",
    "from": "research@yourdomain.com",
    "smtp_server": "smtp.gmail.com",
    "smtp_port": 587
  }
}

高级功能

提醒条件

微调何时提醒:

{
  "alert_on": [
    "price_change_10pct",
    "keyword_exact_match",
    "source_tier_1",
    "high_engagement"
  ],
  "ignore_sources": [
    "spam-site.com",
    "clickbait-news.io"
  ],
  "boost_sources": [
    "github.com",
    "arxiv.org",
    "official-site.com"
  ]
}

正则表达式模式

匹配特定模式:

{
  "patterns": [
    "version \\d+\\.\\d+\\.\\d+",
    "\\$\\d{1,3}(,\\d{3})*",
    "CVE-\\d{4}-\\d+"
  ]
}

速率限制

防止提醒疲劳:

{
  "settings": {
    "max_alerts_per_day": 5,
    "max_alerts_per_topic_per_day": 2,
    "quiet_hours": {
      "start": "22:00",
      "end": "08:00"
    }
  }
}

环境变量

配置这些环境变量以自定义主题监控器:

变量 默认值 描述
TOPIC_MONITOR_TELEGRAM_ID 用于接收提醒的 Telegram 聊天 ID
TOPIC_MONITOR_DATA_DIR 技能目录下的 .data/ 存储状态和发现的目录
WEB_SEARCH_PLUS_PATH 相对于技能目录 web-search-plus 的 search.py 路径
SERPER_API_KEY / TAVILY_API_KEY / EXA_API_KEY / YOU_API_KEY / SEARXNG_INSTANCE_URL / WSP_CACHE_DIR 可选搜索提供商变量,通过子进程环境变量白名单传递

示例设置:

# 添加到 ~/.bashrc 或 .env
export TOPIC_MONITOR_TELEGRAM_ID="123456789"
export TOPIC_MONITOR_DATA_DIR="/home/user/topic-monitor-data"
export WEB_SEARCH_PLUS_PATH="/path/to/skills/web-search-plus/scripts/search.py"

状态管理

.research_state.json

存储在 TOPIC_MONITOR_DATA_DIR 中(默认:技能目录下的 .data/)。

跟踪:
- 每个主题的最后检查时间
- 已提醒的 URL(去重)
- 重要性评分历史
- 学习数据(如果启用)

示例:

{
  "topics": {
    "eth-price": {
      "last_check": "2026-01-28T22:00:00Z",
      "last_alert": "2026-01-28T15:30:00Z",
      "alerted_urls": [
        "https://example.com/eth-news-1"
      ],
      "findings_count": 3,
      "alerts_today": 1
    }
  },
  "deduplication": {
    "url_hash_map": {
      "abc123": "2026-01-28T15:30:00Z"
    }
  }
}

.findings/ 目录

存储值得摘要的发现:

.findings/
├── 2026-01-22_eth-price.json
├── 2026-01-24_fm26-patches.json
└── 2026-01-27_ai-breakthroughs.json

最佳实践

  1. 从保守开始 - 初始设置 importance_threshold: medium,根据提醒质量调整
  2. 使用 context 字段 - 帮助 AI 生成更好的摘要
  3. 优化关键词 - 添加否定关键词以过滤噪音:"keywords": ["AI", "-clickbait", "-spam"]
  4. 启用学习模式 - 根据您的行为随时间改进
  5. 每周查看摘要 - 不要忽略摘要,它会揭示模式
  6. 与 personal-analytics 结合 - 根据您的聊天模式获取主题建议

与其他技能的集成

web-search-plus

自动使用智能路由:

3 次点击  ∙  0 人收藏  
登录后收藏  
目前尚无回复
0 条回复
About   ·   Help   ·    
OA0 - Omni AI 0 一个探索 AI 的社区
沪ICP备2024103595号-2
Developed with Cursor