← 返回
AI智能 Key 中文

Insight Engine

Logs/metrics → Python statistics → LLM interpretation → Notion reports. Use when: generating daily/weekly/monthly operational insights from AI system logs, p...
日志/指标 → Python统计 → 大模型解释 → Notion报告。使用时机:从AI系统日志中生成每日/每周/每月的运维洞察,p...
nissan
AI智能 clawhub v1.0.4 3 版本 100000 Key: 需要
★ 0
Stars
📥 943
下载
💾 45
安装
3
版本
#latest

概述

Last used: 2026-03-24

Memory references: 18

Status: Active

insight-engine

Data-driven insights from operational logs: collect → stats → LLM interpretation → Notion.

Architecture

collect (Python stats only)
  ├── Langfuse OTEL traces/scores/observations
  ├── OpenClaw/gateway logs
  ├── Git activity
  └── Control plane scores
↓
build_*_data_packet()  ← all stats computed in Python before LLM call
↓
call_claude(system_prompt, structured_json)  ← LLM interprets, doesn't compute
↓
write_*_reflection() → Notion

See references/architecture.md for full design rationale.

Quick start

# Install deps
pip install anthropic requests pyyaml

# Configure
cp scripts/config/analyst.yaml.example config/analyst.yaml
# Edit config/analyst.yaml — set langfuse URL, notion IDs, model choices

# Dry run (local Ollama, no Notion write)
python3 scripts/src/engine.py --mode daily --dry-run

# Print data packet + prompt to stdout (for agent consumption, no API calls)
python3 scripts/src/engine.py --mode daily --data-only

# Live run
python3 scripts/src/engine.py --mode daily
python3 scripts/src/engine.py --mode weekly
python3 scripts/src/engine.py --mode monthly

Required env vars

ANTHROPIC_API_KEY=sk-ant-...    # Anthropic API key
NOTION_API_KEY=secret_...       # Notion integration token
LANGFUSE_BASE_URL=http://localhost:3100   # Langfuse server URL
LANGFUSE_PUBLIC_KEY=pk-lf-...   # Langfuse public key
LANGFUSE_SECRET_KEY=sk-lf-...   # Langfuse secret key
NOTION_ROOT_PAGE_ID=<uuid>      # Root Notion page for reports
NOTION_DAILY_DB_ID=<uuid>       # Notion database for daily entries

Or configure in config/analyst.yaml.

Key design principles

  1. Stats before LLM — Python computes all numbers. The LLM interprets, doesn't aggregate.
  2. Citation-enforcing prompts — System prompts require every claim to cite a specific number.
  3. No hallucinated trends< 7 data points → report "insufficient data (n=X)"
  4. Dry-run mode — Uses local Ollama (free) to preview output; skip Notion write.
  5. Data-only mode — Outputs the full data packet + prompts for agent/subagent use.

Cron setup (LaunchAgent example)

<!-- ~/Library/LaunchAgents/com.yourname.insight-engine-daily.plist -->
<key>StartCalendarInterval</key>
<dict>
  <key>Hour</key><integer>23</integer>
  <key>Minute</key><integer>0</integer>
</dict>
<key>ProgramArguments</key>
<array>
  <string>/usr/bin/python3</string>
  <string>/path/to/insight-engine/scripts/src/engine.py</string>
  <string>--mode</string><string>daily</string>
</array>

Extending to new data sources

Add a collector in scripts/src/collectors/:

  1. Create my_source.py with a fetch_*() function returning a plain dict
  2. Import and call it in build_daily_data_packet() in engine.py
  3. Reference the new key in prompts/daily_analyst.md under "Data sources"

See also

  • references/architecture.md — full design rationale and layer descriptions
  • scripts/prompts/daily_analyst.md — system prompt with citation rules
  • scripts/config/analyst.yaml.example — config template

版本历史

共 3 个版本

  • v1.0.4 当前
    2026-05-03 03:32 安全 安全
  • v1.0.2
    2026-03-29 20:01 安全
  • v1.0.3
    2026-03-27 21:31

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 712 📥 243,801
content-creation

Fact Checker

nissan
对照源数据验证 Markdown 草稿中的声明、数字和事实。适用场景:发布前审核博客文章、报告或文档的准确性。
★ 3 📥 2,107
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,358 📥 318,308