名称: 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":"所有环境变量均为可选。默认配置开箱即用。"}}}
监控重要事项,发生时即刻获知。
主题监控器将您的助手从被动响应转变为主动监控,持续关注您关心的主题,并仅在真正重要时智能地提醒您。
只想监控一个主题?只需一条命令:
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
| 特性 | 快速开始 | 完整设置 |
|---|---|---|
| 速度 | ⚡ 一条命令 | 📝 向导式 |
| 默认值 | 智能默认 | 完全自定义 |
| 适用场景 | 单一主题 | 多个主题 |
| 配置 | 极简 | 完全控制 |
快速开始后,您随时可以自定义:
python3 scripts/manage_topics.py edit ai-model-releases --frequency hourly
用于配置多个主题或高级选项:
python3 scripts/setup.py
向导将引导您完成:
向导会创建包含您偏好的 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
每个主题包含:
hourly, daily, weeklyhigh (立即提醒), medium (重要时提醒), low (仅摘要){
"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
}
}
管理研究主题:
# 添加主题
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
主监控脚本(通过 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. 更新状态以防止重复提醒
生成每周摘要:
# 生成本周摘要
python3 scripts/digest.py
# 生成并发送
python3 scripts/digest.py --send
# 预览而不发送
python3 scripts/digest.py --preview
输出格式:
# 每周研究摘要 - [日期范围]
## 🔥 亮点
- **AI 模型**:Claude 4.5 发布,推理能力提升
- **安全**:流行框架中的严重 CVE 已修复
## 📊 按主题分类
### AI 模型发布
- [本周 3 项发现]
### 安全漏洞
- [本周 1 项发现]
## 💡 建议
根据您的兴趣,您可能想监控:
- "Kubernetes 安全" (本周提及 3 次)
配置自动监控:
# 交互式设置
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
评分器使用多种信号来决定提醒优先级:
高优先级 (立即提醒):
- 重大突发新闻(通过新鲜度 + 关键词密度检测)
- 价格变动 >10%(针对金融主题)
- 与您确切关键词匹配的产品发布
- 您使用的工具中的安全漏洞
- 对您提出的具体问题的直接回答
中优先级 (值得摘要):
- 相关但不紧急的新闻
- 跟踪产品的次要更新
- 您主题中有趣的发展动态
- 教程/指南发布
- 高参与度的社区讨论
低优先级 (忽略):
- 重复新闻(已提醒过)
- 略微相关的内容
- 低质量来源
- 过时信息
- 垃圾/推广内容
启用时 (learning_enabled: true),系统会:
1. 跟踪您与哪些提醒进行了交互
2. 根据您的行为调整评分权重
3. 建议主题优化
4. 自动调整重要性阈值
学习数据存储在 .learning_data.json 中(保护隐私,从不共享)。
主题监控器连接到您的对话历史:
提醒示例:
🔔 Dirac Live 更新
版本 3.8 发布,包含您上周询问的房间校正改进。
上下文: 您提到工作室的低频响应有问题。此更新包含了新的低频优化。
[链接] | [完整详情]
工作原理:
1. 读取 references/memory_hints.md(创建此文件)
2. 扫描最近的对话日志(如果可用)
3. 将发现与过去的上下文匹配
4. 生成个性化摘要
帮助 AI 建立联系:
# 主题监控器的记忆提示
## AI 模型
- 使用 Claude 进行编码辅助
- 对推理能力改进感兴趣
- 比较不同用例的模型
## 安全
- 运行生产 Kubernetes 集群
- 需要快速修补严重 CVE
- 对零日漏洞披露感兴趣
## 科技新闻
- 关注初创企业生态系统
- 对开发者工具领域感兴趣
- 跟踪潜在的收购目标
需要 OpenClaw 消息工具:
{
"channels": ["telegram"],
"telegram_config": {
"chat_id": "@your_username",
"silent": false,
"effects": {
"high_importance": "🔥",
"medium_importance": "📌"
}
}
}
由 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"
存储在 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/
├── 2026-01-22_eth-price.json
├── 2026-01-24_fm26-patches.json
└── 2026-01-27_ai-breakthroughs.json
importance_threshold: medium,根据提醒质量调整"keywords": ["AI", "-clickbait", "-spam"]