Insight Engine
/install insight-engine
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=\x3Cuuid> # Root Notion page for reports
NOTION_DAILY_DB_ID=\x3Cuuid> # Notion database for daily entries
Or configure in config/analyst.yaml.
Key design principles
- Stats before LLM — Python computes all numbers. The LLM interprets, doesn't aggregate.
- Citation-enforcing prompts — System prompts require every claim to cite a specific number.
- No hallucinated trends —
\x3C 7 data points→ report "insufficient data (n=X)" - Dry-run mode — Uses local Ollama (free) to preview output; skip Notion write.
- Data-only mode — Outputs the full data packet + prompts for agent/subagent use.
Cron setup (LaunchAgent example)
\x3C!-- ~/Library/LaunchAgents/com.yourname.insight-engine-daily.plist -->
\x3Ckey>StartCalendarInterval\x3C/key>
\x3Cdict>
\x3Ckey>Hour\x3C/key>\x3Cinteger>23\x3C/integer>
\x3Ckey>Minute\x3C/key>\x3Cinteger>0\x3C/integer>
\x3C/dict>
\x3Ckey>ProgramArguments\x3C/key>
\x3Carray>
\x3Cstring>/usr/bin/python3\x3C/string>
\x3Cstring>/path/to/insight-engine/scripts/src/engine.py\x3C/string>
\x3Cstring>--mode\x3C/string>\x3Cstring>daily\x3C/string>
\x3C/array>
Extending to new data sources
Add a collector in scripts/src/collectors/:
- Create
my_source.pywith afetch_*()function returning a plain dict - Import and call it in
build_daily_data_packet()inengine.py - Reference the new key in
prompts/daily_analyst.mdunder "Data sources"
See also
references/architecture.md— full design rationale and layer descriptionsscripts/prompts/daily_analyst.md— system prompt with citation rulesscripts/config/analyst.yaml.example— config template
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install insight-engine - After installation, invoke the skill by name or use
/insight-engine - Provide required inputs per the skill's parameter spec and get structured output
What is Insight Engine?
Logs/metrics → Python statistics → LLM interpretation → Notion reports. Use when: generating daily/weekly/monthly operational insights from AI system logs, p... It is an AI Agent Skill for Claude Code / OpenClaw, with 512 downloads so far.
How do I install Insight Engine?
Run "/install insight-engine" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Insight Engine free?
Yes, Insight Engine is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Insight Engine support?
Insight Engine is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Insight Engine?
It is built and maintained by Nissan Dookeran (@nissan); the current version is v1.0.4.