54 lines
3.6 KiB
Markdown
54 lines
3.6 KiB
Markdown
---
|
||
title: "Dynamic Dashboard with Sub-agent Spawning"
|
||
type: source
|
||
tags: [dashboard, sub-agent, monitoring]
|
||
date: 2026-04-27
|
||
---
|
||
|
||
## Source File
|
||
- [[Agent/usecases/dynamic-dashboard.md]]
|
||
|
||
## Summary(用中文描述)
|
||
- 核心主题:AI Agent 驱动的实时动态仪表盘——通过子 Agent 并行抓取多数据源,自动聚合为统一仪表盘并定时推送到 Discord 或生成 HTML 文件
|
||
- 问题域:静态仪表盘数据过时、需要自定义前端、API 速率限制、无法实时获取多源数据
|
||
- 方法/机制:主 Agent 以对话方式定义监控目标 → 并行生成多个子 Agent 分别抓取各数据源 → 聚合结果写入 PostgreSQL → 格式化仪表盘内容 → 通过 Discord 或 Canvas 推送 → Cron 定时更新 + 阈值告警
|
||
- 结论/价值:无需构建自定义前端,AI 接管全部编排工作;子 Agent 并行执行避免阻塞和速率限制;历史数据持久化支持趋势分析
|
||
|
||
## Key Claims(用中文描述)
|
||
- 子 Agent 并行执行可避免 API 速率限制(OpenClaw spawns sub-agents to fetch each data source in parallel)
|
||
- AI 驱动的仪表盘可以在分钟级粒度自动更新,无需人工干预(Updates run automatically on a cron schedule)
|
||
- 历史指标存储在数据库中支持任意时间范围的趋势查询(Query historical data: "Show me GitHub star growth over the past 30 days.")
|
||
- 告警阈值检测使系统具备主动通知能力(alerts when metrics cross thresholds)
|
||
|
||
## Key Quotes
|
||
> "Monitors multiple data sources simultaneously (APIs, databases, GitHub, social media)" — 核心能力:多数据源并行监控
|
||
> "Spawns sub-agents for each data source to avoid blocking and distribute API load" — 技术实现:子 Agent 分载模式
|
||
> "You define what you want to monitor conversationally" — 用户体验:以自然语言定义监控需求
|
||
|
||
## Key Concepts
|
||
- [[SubAgent]]:并行子 Agent 用于分布式数据抓取,每个数据源对应一个独立 Agent 进程
|
||
- [[CronJobs]]:定时任务驱动仪表盘周期性更新,支持分钟级粒度
|
||
- [[AlertThreshold]]:告警阈值机制,当指标超过设定值时主动通知用户
|
||
- [[MetricsDatabase]]:PostgreSQL 指标存储,表结构包含 source/metric_name/metric_value/timestamp,支持历史趋势分析
|
||
|
||
## Key Entities
|
||
- [[OpenClaw]]:主编排引擎,负责对话式目标定义、子 Agent 调度和结果聚合
|
||
- [[Discord]]:仪表盘输出渠道,支持 #dashboard 频道推送格式化内容
|
||
- [[GitHub]]:数据源之一,提供 stars/forks/issues/commits 等项目指标
|
||
- [[Polymarket]]:预测市场数据源,提供交易量和趋势信息
|
||
|
||
## Connections
|
||
- [[AutonomousProjectManagement]] ← extends ← [[DynamicDashboard]]
|
||
- 两者都依赖子 Agent 并行执行模式,但前者聚焦项目协调,后者聚焦数据监控
|
||
- [[CustomMorningBrief]] ← similar_pattern ← [[DynamicDashboard]]
|
||
- 都是定时运行的数据聚合工作流,但早间简报聚焦内容推荐,仪表盘聚焦实时指标
|
||
- [[MultiChannelAssistant]] ← uses ← [[Discord]]
|
||
- 多渠道助手使用 Discord 作为输出通道,与本工作流共享同一推送基础设施
|
||
|
||
## Contradictions
|
||
- 与 [[AutonomousProjectManagement]] 冲突:
|
||
- 冲突点:子 Agent 的协调机制
|
||
- 当前观点:[[DynamicDashboard]] 采用数据聚合模式(各 Agent 写入共享数据库,主 Agent 读取聚合),适合统计类任务
|
||
- 对方观点:[[AutonomousProjectManagement]] 采用文件协调模式(共享 STATE.yaml,CEO 模式),适合项目执行类任务
|
||
- 注:两者可互补使用,数据聚合模式适用于监控场景,文件协调模式适用于任务执行场景
|