# Send Automated daily memory backfill for OpenClaw sessions to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "memory-sync",
    "name": "Automated daily memory backfill for OpenClaw sessions",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/mpesavento/memory-sync",
    "canonicalUrl": "https://clawhub.ai/mpesavento/memory-sync",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/memory-sync",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=memory-sync",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "memory_sync.py",
      "SECRET_PATTERNS.md",
      "SKILL.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "memory-sync",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-29T23:11:42.497Z",
      "expiresAt": "2026-05-06T23:11:42.497Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=memory-sync",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=memory-sync",
        "contentDisposition": "attachment; filename=\"memory-sync-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "memory-sync"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/memory-sync"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/memory-sync",
    "downloadUrl": "https://openagent3.xyz/downloads/memory-sync",
    "agentUrl": "https://openagent3.xyz/skills/memory-sync/agent",
    "manifestUrl": "https://openagent3.xyz/skills/memory-sync/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/memory-sync/agent.md"
  }
}
```
## Documentation

### 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

CommandDescriptioncompareFind gaps between session logs and memory filesbackfill --todayGenerate memory for current daybackfill --since YYYY-MM-DDBackfill from date to presentbackfill --allBackfill all missing datesbackfill --incrementalBackfill only changed dates since last runextractExtract conversations matching criteriasummarize --date YYYY-MM-DDGenerate LLM summary for a single daytransitionsList model transitionsvalidateCheck memory files for consistency issuesstatsShow 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.

### 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 Requiredopenclaw (default)Uses OpenClaw's sessions spawn with your configured modelNoanthropicDirect Anthropic API via openai packageANTHROPIC_API_KEYopenaiDirect 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

### 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
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: mpesavento
- Version: 1.0.1
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-04-29T23:11:42.497Z
- Expires at: 2026-05-06T23:11:42.497Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/memory-sync)
- [Send to Agent page](https://openagent3.xyz/skills/memory-sync/agent)
- [JSON manifest](https://openagent3.xyz/skills/memory-sync/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/memory-sync/agent.md)
- [Download page](https://openagent3.xyz/downloads/memory-sync)