返回 Skill 列表
extension
分类: 其它需要 API Key

Session Log Analyzer

分析智能体会话日志,生成PDF报告并同步至Notion

person作者: terrycarter1985hubclawhub

Session Log Analyzer

Analyze agent session logs and generate PDF reports with optional Notion sync.

Features

  • Parse JSONL session logs and compute statistics
  • Generate PDF analysis reports with skill usage breakdown and error summaries
  • Sync generated reports to a Notion database

Usage

Generate Report

PYTHONPATH=./lib python3 scripts/analyze_logs.py

Sync to Notion

Set environment variables first:

export NOTION_API_KEY="your-integration-token"
export NOTION_REPORTS_DB_ID="your-database-id"
PYTHONPATH=./lib python3 scripts/sync_to_notion.py

Report Contents

  • Total sessions count
  • Skill invocation statistics (success/failure rates)
  • Duration totals
  • Per-skill usage breakdown
  • Recent errors listing

Configuration

| Variable | Required | Description | |---|---|---| | NOTION_API_KEY | For sync | Notion integration token | | NOTION_REPORTS_DB_ID | For sync | Target Notion database ID |

Notes

  • Input logs must be in JSONL format with event, session_id, skill_used, success, and duration fields
  • PDF output is saved to pdfs/session_analysis_report.pdf
  • Notion sync uploads the first 2000 characters of extracted report text