SuperAPI AI 工具集

agent-pulse

智能体与模型

查看项目

更新于 10-16 09:07

技能介绍

用途

Agent Pulse 用于检查本地 AI 智能体活动,以已安装的 agent-pulse CLI 作为本地智能体活动数据的来源。其 PyPI 包名为 agentpulse-cli,命令名保持为 agent-pulse。建议优先运行命令并汇总输出,而不是阅读 Agent Pulse 源代码。

主要能力

根据资料,Agent Pulse 支持按平台筛选数据,可用 -P/--platform 指定单一智能体工具,可选值包括:hermes、claude、codex、deepseek、openclaw、copilot、aider、qwen、opencode、goose、cursor、antigravity、amp。

它支持多种命令,覆盖以下用途:

  • 当前状态:agent-pulse status --json
  • 完整面板:agent-pulse --json 或 agent-pulse --no-banner
  • 演示数据:agent-pulse demo --json
  • 安装诊断:agent-pulse doctor --json
  • 近期会话:agent-pulse --json --hours 24 --limit 20
  • 按 token 排序的会话:agent-pulse top --sort tokens --json
  • 高成本会话:agent-pulse top --sort cost --json --hours 168
  • 模型成本分析:agent-pulse models --json
  • 模型排名:agent-pulse leaderboard --json --rank-by efficiency
  • 成本节省建议:agent-pulse optimize --json
  • 预算状态:agent-pulse budget --json
  • 成本预测:agent-pulse forecast --json
  • 成本异常检查:agent-pulse anomaly --json
  • 健康/CI 检查:agent-pulse health --json
  • 综合评分:agent-pulse score --json
  • 搜索会话:agent-pulse search "<query>" --json
  • 对比周期:agent-pulse compare --json
  • 对比项目:agent-pulse compare-projects --json
  • 活动日历:agent-pulse heatmap --json
  • 智能建议:agent-pulse insights --json
  • Prometheus 指标:agent-pulse metrics --format prometheus
  • 导出报告:agent-pulse export -f markdown 或 agent-pulse export-html
  • Web 面板:agent-pulse web --port 8765
  • REST API:agent-pulse api --port 8766
  • MCP 工具:agent-pulse mcp --list-tools

使用方式

在 Windows 上运行命令前必须先启用 UTF-8,因为 Agent Pulse 输出包含 emoji 和制表符:

$env:PYTHONUTF8='1' $env:PYTHONIOENCODING='utf-8'

如果 agent-pulse 不在 PATH 中,需先询问再安装依赖。若用户同意,可安装 PyPI 包或尝试从本地项目检出运行:

pip install agentpulse-cli

python -m agent_pulse.cli --version

建议工作流程:尽可能使用 JSON 输出,并汇总关键字段,包括 sessions、tokens、tools、search calls、model breakdown、source breakdown、estimated cost、warnings。使用时间过滤器限定范围,"recent" 默认 24 小时,"this week" 默认 168 小时。当用户询问特定智能体系统时,使用平台过滤器。对于成本问题,结合 summary、model 和 top-session 视图。对于趋势和风险问题,使用 forecast/history/compare/anomaly。对于安装问题,先运行发现命令,再推测路径:agent-pulse doctor --json、agent-pulse scan --json --details、agent-pulse config show。

仅在用户询问数据缺失原因、请求安装帮助,或普通数据命令未返回会话时,才以 agent-pulse doctor --json 开始。

如果已安装命令缺少某个选项,运行 agent-pulse <command> --help 并调整。

结果解读

total_cost_usd 是基于 Agent Pulse 本地模型定价表的估算值。报告成本时同时报告 token 量;低成本模型仍可能产生很高 token 使用量。需区分来源,如 codex、claude、hermes、deepseek、openclaw、aider、cursor、opencode 和 goose。如果 doctor 报告缺少可选来源、缺少 dev_root 或缺少可选 Web 依赖,应予以提及。如果未出现会话,先检查 doctor,再尝试更宽的时间窗口,如 --hours 168。在给出总体总计前,确认用户是否要求来源(-P)过滤、模型过滤或项目对比。如果命令输出纯文本而非 JSON,或因已安装版本较旧而失败,运行 agent-pulse <command> --help 并使用最接近的受支持选项。

报告与集成

对于简短的人类可读回答,运行 JSON 命令并汇总。对于产物,优先使用:

agent-pulse report --period daily agent-pulse export -f markdown agent-pulse export-html

不要编造确切的节省或成本,应使用 CLI 输出。

仅当用户要求浏览器面板或编程服务器时,才使用 web 和 API 附加组件,安装缺失的附加组件前需询问:

pip install "agentpulse-cli[web]" agent-pulse web --port 8765 agent-pulse api --port 8766

用于监控管道:

agent-pulse metrics --format prometheus agent-pulse health --cost-limit 100 --token-limit 1000000 --json

MCP

当用户希望其他 AI 客户端查询 Agent Pulse 时,使用 MCP 模式:

agent-pulse mcp --list-tools agent-pulse mcp

解释 MCP 时,应提及它暴露的工具,如 status、forecast、top sessions、model analytics、optimization、health、search 和 leaderboard。

本地辅助脚本

此技能包含 scripts/run_agent_pulse_snapshot.py,它会运行一组紧凑的、JSON 友好的 Agent Pulse 检查,并打印组合摘要:

python scripts/run_agent_pulse_snapshot.py --hours 24 --days 7