Token导航 LogoToken导航TokenDH.com
研究检索敏感数据clawhub未标认证来源可访问clear审计提醒

memory-sync内存同步

Agent Skill

memory-sync 用于处理浏览器自动化、网页检查和页面信息提取,适合在 OpenClaw 中需要让 Agent 打开页面、读取网页或验证前端流程时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

41,151

周安装

1,681

GitHub Stars

公开资料未说明

下载量

13,179
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:memory-sync(内存同步)
来源仓库:https://github.com/mpesavento/memory-sync
安装命令:
openclaw skills install memory-sync
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install memory-sync

简介

抓取并分析 OpenClaw JSONL 会话日志以重建和回填代理内存文件。 Use when: (1) Memory appears incomplete after model switches, (2) Verifying memory coverage, (3) Reconstructing lost memory, (4) Automated daily memory sync via cron/heartbeat.支持简单提取和基于 LLM 的叙述性摘要,并具有自动秘密清理功能。

SKILL.md

name
memory-sync
description
>

Memory Sync

Tool for maintaining agent memory continuity across model switches with automatic secret sanitization.

Installation

Requires Python 3.11+ and click:

pip install click

# Optional: for direct API summarization (only if not using OpenClaw backend)
pip install openai

Quick Start

# Run directly from skill directory
python ~/.openclaw/skills/memory-sync/memory_sync.py compare

# Or create an alias for convenience
alias memory-sync="python ~/.openclaw/skills/memory-sync/memory_sync.py"

# Check for gaps
memory-sync compare

# Backfill today's memory (simple extraction - fast, no LLM)
memory-sync backfill --today

# Backfill with LLM narrative (uses OpenClaw's native model - no API key needed)
memory-sync backfill --today --summarize

# Backfill all missing
memory-sync backfill --all

Commands

CommandDescription
compareFind gaps between session logs and memory files
backfill --todayGenerate memory for current day
backfill --since YYYY-MM-DDBackfill from date to present
backfill --allBackfill all missing dates
backfill --incrementalBackfill only changed dates since last run
extractExtract conversations matching criteria
summarize --date YYYY-MM-DDGenerate LLM summary for a single day
transitionsList model transitions
validateCheck memory files for consistency issues
statsShow coverage statistics

Simple Extraction vs LLM Summarization

The backfill command supports two modes:

Simple Extraction (default, without --summarize):

  • Fast, no LLM or API calls needed
  • Extracts topics via keyword frequency analysis
  • Identifies key user questions and assistant responses
  • Detects decision markers from text patterns
  • Produces structured output with Topics, Key Exchanges, Decisions sections
  • With --preserve: Hand-written content is appended to the end of the new file
  • Best for: Quick backfills, initial setup, systems without LLM access

LLM Summarization (with --summarize) - Recommended:

  • Uses LLM to generate narrative summaries
  • Produces coherent 2-4 paragraph prose
  • Better context and insight extraction
  • With --preserve: Existing content is passed to the LLM with instructions to incorporate it into the new summary, maintaining temporal order and thematic structure
  • Best for: Daily automation, high-quality memory files

Recommended for regular use:

# Best quality: LLM summary that incorporates any existing notes
memory-sync backfill --today --summarize --preserve

Both modes automatically sanitize secrets before writing.

Common Workflows

Initial Setup

# Check what's missing
memory-sync compare

# Backfill everything (may take time)
memory-sync backfill --all

Nightly Automation (Recommended)

# Best: LLM summary that incorporates any existing notes
memory-sync backfill --today --summarize --preserve

# Smart: Process only days changed since last run
memory-sync backfill --incremental --summarize --preserve

# Or use a specific backend if preferred
memory-sync backfill --today --summarize --preserve --summarize-backend anthropic

Catch-Up After Gaps

# Backfill from last week to present
memory-sync backfill --since 2026-01-28 --summarize

Regenerate with Preserved Content

# Keep hand-written notes when regenerating
memory-sync backfill --date 2026-02-05 --force --preserve --summarize

Secret Sanitization

All content is automatically sanitized to prevent secret leakage:

  • 30+ explicit patterns: OpenAI, Anthropic, GitHub, AWS, Stripe, Discord, Slack, Notion, Google, Brave, Tavily, SerpAPI, etc.
  • Structural detection: JWT tokens, SSH keys, database connection strings, high-entropy base64
  • Generic patterns: API keys, tokens, passwords, environment variables
  • Defense-in-depth: Secrets redacted at every stage (extraction, LLM processing, file writes, CLI display)

Secrets are replaced with [REDACTED-TYPE] placeholders.

See SECRET_PATTERNS.md for complete pattern list.

Summarization Backends

The --summarize flag supports multiple backends via --summarize-backend:

BackendDescriptionAPI Key Required
openclaw (default)Uses OpenClaw's sessions spawn with your configured modelNo
anthropicDirect Anthropic API via openai packageANTHROPIC_API_KEY
openaiDirect OpenAI API via openai packageOPENAI_API_KEY

Examples

# Default: use OpenClaw's native model (no API key needed)
memory-sync backfill --today --summarize

# Explicit backend selection
memory-sync backfill --today --summarize --summarize-backend openclaw
memory-sync backfill --today --summarize --summarize-backend anthropic
memory-sync backfill --today --summarize --summarize-backend openai

# Override model for any backend
memory-sync backfill --today --summarize --model claude-sonnet-4-20250514
memory-sync backfill --today --summarize --summarize-backend openai --model gpt-4o

The openclaw backend is recommended as it:

  • Uses your existing OpenClaw configuration
  • Requires no separate API keys
  • Leverages whatever model you have configured in OpenClaw

Automated Usage

Nightly Cron (3am)

Process today with LLM summary, preserving any existing notes:

0 3 * * * cd ~/.openclaw/skills/memory-sync && python memory_sync.py backfill --today --summarize --preserve >> ~/.memory-sync/cron.log 2>&1

Smart Incremental Mode

Automatically detects changes since last run:

# Initial backfill (run once, simple extraction for speed)
python memory_sync.py backfill --all

# Then set up nightly incremental with LLM summaries
0 3 * * * cd ~/.openclaw/skills/memory-sync && python memory_sync.py backfill --incremental --summarize --preserve >> ~/.memory-sync/cron.log 2>&1

State is tracked in ~/.memory-sync/state.json.

Configuration

Default paths:

  • Session logs: ~/.openclaw/agents/main/sessions/*.jsonl
  • Memory files: ~/.openclaw/workspace/memory/

Override with CLI flags:

  • --sessions-dir /path/to/sessions
  • --memory-dir /path/to/memory

Environment variables (only for direct API backends):

  • ANTHROPIC_API_KEY - Required for --summarize-backend anthropic
  • OPENAI_API_KEY - Required for --summarize-backend openai

The default openclaw backend requires no API keys - it uses your OpenClaw configuration.

# Only needed if using direct API backends
export ANTHROPIC_API_KEY=sk-ant-...
export OPENAI_API_KEY=sk-...

Content Preservation

The --preserve flag behavior depends on whether --summarize is used:

Without --summarize (simple extraction):

  • Hand-written content (after footer marker) is appended verbatim to the end of the newly generated file
  • The new extraction replaces the auto-generated portion, your notes are kept at the end

With --summarize (LLM mode):

  • Existing hand-written content is passed to the LLM as context
  • The LLM is instructed to incorporate your notes into the new summary
  • Result: Your insights are woven into a coherent narrative, not just appended

Example:

# Regenerate with LLM, incorporating existing notes into the summary
memory-sync backfill --date 2026-02-05 --force --preserve --summarize

Auto-generated markers:

  • Header: *Auto-generated from N session messages*
  • Footer: *Review and edit this draft to capture what's actually important.*

Content after the footer marker is considered hand-written and will be preserved.

Backfill Options

Date selection (choose one):

  • --date YYYY-MM-DD - Single specific date
  • --today - Current date only (for nightly automation)
  • --since YYYY-MM-DD - From date to present (for catch-up)
  • --all - All missing dates (for initial setup)
  • --incremental - Only dates changed since last run (smart automation)

Additional flags:

  • --dry-run - Show what would be created without creating files
  • --force - Overwrite existing files (required for regeneration)
  • --preserve - Keep hand-written content when regenerating
  • --summarize - Use LLM for narrative summaries
  • --summarize-backend BACKEND - Backend for summarization: openclaw (default), anthropic, openai
  • --model MODEL - Model override for summarization (default varies by backend)

Performance

ModeTime per DayBest For
--all5-10 min × N daysInitial setup only
--since5-10 min × N daysRecovery after gaps
--today30-60 secNightly automation
--incremental30-60 sec × changed daysSmart automation

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

84.82%
按下载量换算11,178

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

未展示

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills