← 返回
未分类 Key 中文

Session Scribe

Automatically summarize active OpenClaw session transcripts into daily memory files using a cheap LLM. Run as a system cron job — reads new transcript entrie...
使用轻量级LLM自动将活跃的OpenClaw会话记录汇总为每日记忆文件,以系统定时任务(cron job)方式运行,读取新的会话条目并生成摘要。
kitsune
未分类 clawhub v1.0.1 1 版本 100000 Key: 需要
★ 0
Stars
📥 403
下载
💾 0
安装
1
版本
#latest

概述

session-scribe

Reads OpenClaw session transcripts and writes summarized bullet points to a daily memory file — automatically, via system cron.

No gateway involvement. No context bloat. Just cheap, reliable scribing.

⚠️ Privacy notice

This skill sends conversation transcript content to an external LLM (OpenAI or Anthropic). If your sessions contain secrets, API keys, PII, or sensitive data — be aware that content will be sent to the provider for summarization. Use a dedicated low-privilege API key with spend limits, and consider running --dry-run first to see exactly what gets sent.

How it works

  1. Reads /.jsonl for new entries since last run
  2. Extracts user + assistant turns (skips tool calls, system events)
  3. Sends to OpenAI or Anthropic API for summarization (gpt-4o-mini by default — cheap)
  4. Appends bullet-point summary to /YYYY-MM-DD.md (date auto-generated)
  5. Saves progress in .scribe-state.json so next run only processes new entries

Setup

# Install dependencies (one-time, in the skill directory)
cd /path/to/skills/session-scribe && npm install

# Set your API key — OpenAI or Anthropic both work
export OPENAI_API_KEY=sk-...
# or
export ANTHROPIC_API_KEY=sk-ant-api03-...

# Find your session ID
python3 -c "
import json, os
sessions = json.load(open(os.path.expanduser('~/.openclaw/agents/main/sessions/sessions.json')))
for k, v in sessions.items():
    print(k, '->', v.get('sessionId'))
"

# Test run (dry-run, prints summary without writing)
node scripts/scribe.js \
  --sessions ~/.openclaw/agents/main/sessions \
  --session-id <your-session-id> \
  --memory-dir ~/.openclaw/workspace/memory \
  --dry-run

# Or auto-resolve session by key suffix (e.g. your Discord channel ID)
node scripts/scribe.js \
  --sessions ~/.openclaw/agents/main/sessions \
  --auto-session "discord:channel:YOUR_CHANNEL_ID" \
  --memory-dir ~/.openclaw/workspace/memory \
  --dry-run

> Note: OpenClaw's internal oat tokens cannot be used for direct API calls. Use a standard API key from platform.openai.com or console.anthropic.com.

System cron setup

Add to crontab (crontab -e) to run every hour:

# Store your key in a protected file (do NOT inline secrets in crontab)
echo "sk-your-key" > ~/.openclaw/secrets/scribe-key
chmod 600 ~/.openclaw/secrets/scribe-key

# Single session (via key file)
0 * * * * node /path/to/session-scribe/scripts/scribe.js \
  --sessions ~/.openclaw/agents/main/sessions \
  --auto-session "discord:channel:YOUR_CHANNEL_ID" \
  --memory-dir ~/.openclaw/workspace/memory \
  --api-key-file ~/.openclaw/secrets/scribe-key \
  >> /tmp/scribe.log 2>&1

# All sessions across all agents
0 * * * * node /path/to/session-scribe/scripts/scribe.js \
  --agents-dir ~/.openclaw/agents \
  --all-sessions \
  --memory-dir ~/.openclaw/workspace/memory \
  --api-key-file ~/.openclaw/secrets/scribe-key \
  >> /tmp/scribe.log 2>&1

Options

FlagDescriptionDefault
----------------------------
--sessions Path to OpenClaw sessions directoryrequired
--session-id Specific session UUID to scribe
--auto-session Auto-resolve session ID from sessions.json key suffix
--memory-dir Directory to write daily memory filesrequired
--provider LLM provider: openai or anthropicauto-detected from env
--model Model to usegpt-4o-mini
--api-key API key (alternative to env var)
--api-key-file Read API key from file
--agent Agent label shown in memory file headersagent
--dry-runPrint summary without writing to diskfalse
--min-turns Minimum new turns before scribing3
--active-within-hours Only scribe sessions active within this window (--all-sessions mode)1

Pairing with supermemory

For a full automated memory pipeline:

  1. session-scribe runs hourly → appends to memory/YYYY-MM-DD.md
  2. supermemory ingest runs every 2h → syncs changed files to Supermemory
  3. supermemory recall at session start → enriched context from past sessions

References

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-31 09:29 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

self-improving agent

pskoett
记录自身发现以实现自我改进的技能
★ 4,175 📥 946,386
ai-agent

Self-Improving + Proactive Agent

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

Agent Browser

rez0
用于 AI 代理的浏览器自动化 CLI。当用户需要与网站交互(包括浏览页面、填写表单、点击按钮、截图等)时使用。
★ 874 📥 350,869