Scoped Memory Manager

v1.0.0

Installs and manages Scope-Based Memory and Automated REM Sleep (memory consolidation) for OpenClaw agents. Use this skill when an agent's MEMORY.md is bloat...

0· 124·0 current·0 all-time
MIT-0
Download zip
LicenseMIT-0 · Free to use, modify, and redistribute. No attribution required.
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name, description, and instructions all focus on converting a monolithic MEMORY.md into scoped topic files and running periodic consolidation. The single setup script only scaffolds memory/topics; nothing requested is unrelated to memory management.
Instruction Scope
SKILL.md explicitly instructs creating directories, scheduling a cron job to run consolidation in an 'isolated' session, and reading MEMORY.md plus recent daily logs to extract/prune/move content. All referenced files and actions are consistent with memory-consolidation purpose and do not reference unrelated system files or external endpoints.
Install Mechanism
No install spec; a tiny shell script (creates memory/topics) is included. Nothing is downloaded from external URLs and no archives are extracted — low install risk.
Credentials
The skill requires no environment variables, secrets, or external credentials. The actions it asks for (reading and reorganizing MEMORY.md and memory/*.md logs) are proportionate to its function.
Persistence & Privilege
The skill instructs scheduling a recurring cron job that will autonomously wake an agent in an 'isolated' session to read and modify memory files. While 'always' is false and no extra credentials are requested, the recurring autonomous access to agent memory is a privacy/privilege consideration the user should review.
Assessment
This skill appears coherent and low-risk technically, but it will schedule recurring autonomous runs that read and rewrite your agent's MEMORY.md and related daily logs. Before installing: (1) back up MEMORY.md, (2) inspect the cron job payload and confirm you accept weekly automated consolidation, (3) verify what the platform's 'cron' tool and 'isolated' session actually do and what permissions they have, (4) run the setup script and perform a manual migration first to confirm results, and (5) ensure no sensitive data you don't want reorganized into topic files is currently stored in MEMORY.md. If you want tighter control, decline automatic scheduling and run consolidation manually.

Like a lobster shell, security has layers — review code before you run it.

latestvk974pmacrpcmrj4n107fbh9yfh830rcc

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

Scoped Memory Manager

This skill upgrades an OpenClaw agent's memory architecture from a single, bloated MEMORY.md to a Scope-Based Memory system with automated REM Sleep (memory consolidation and decay).

Architecture

  1. Global Router (MEMORY.md): Kept extremely lean. Only contains core identity, active focus, and an index of domain-specific memory files.
  2. Domain-Specific Memory (memory/topics/*.md): Stores hyper-specific rules, constraints, and knowledge (e.g., shopify.md, rails.md). Retrieved dynamically via memory_search and memory_get only when relevant.
  3. Automated REM Sleep: A scheduled background job (cron) that wakes up an isolated agent to compress daily logs, extract new patterns, prune outdated "trauma" constraints, and file the distilled knowledge into the correct topic files.

Installation & Setup

When the user asks to install or configure scoped memory / REM sleep, follow these steps:

1. Scaffold the Directory Structure

Run the setup script to create the necessary directories:

sh scripts/setup.sh

2. Schedule the REM Sleep Cron Job

Use the cron tool to schedule the weekly consolidation job. Call the cron tool with action: "add" and the following payload:

  • name: "Memory REM Sleep (Consolidation)"
  • schedule: { "kind": "cron", "expr": "0 3 * * 0" } (Sundays at 3:00 AM)
  • sessionTarget: "isolated"
  • delivery: { "mode": "announce" }
  • payload:
    {
      "kind": "agentTurn",
      "message": "It is time for your weekly REM sleep cycle. Please read the current `MEMORY.md` and the daily log files (`memory/YYYY-MM-DD.md`) from the past 7 days. Your task is to perform memory consolidation: \n1. Extract new patterns and important context from the logs.\n2. Review `MEMORY.md` and prune obsolete rules or constraints.\n3. Move domain-specific knowledge into the appropriate `memory/topics/*.md` files.\n4. Rewrite `MEMORY.md` to be a concise global router.\n5. Summarize what was added, moved, and forgotten."
    }
    

3. Migrate Existing Memory

If the agent already has a bloated MEMORY.md, proactively offer to read it and partition the content into memory/topics/*.md files right now.

Usage Guidelines

  • Remind users that MEMORY.md is NOT for storing everything.
  • When learning a new specific framework, proactively create a new topic file in memory/topics/ instead of polluting the global MEMORY.md.

Files

2 total
Select a file
Select a file to preview.

Comments

Loading comments…