记忆

Claw Memory Manager

试用

Manage OpenClaw Agent's built-in memory features — enable/disable/configure Dreaming (Light→REM→Deep auto memory consolidation) and Active Memory (proactive...

它能做什么

Manage OpenClaw Agent's built-in memory features — enable/disable/configure Dreaming (Light→REM→Deep auto memory consolidation) and Active Memory (proactive memory injection with three style presets: conservative / balanced / aggressive). Auto-detects K8s ConfigMap mirrors, creates *.bak.<timestamp> backups before write, supports --dry-run preview, --style preset for active-memory, --half-life / --max-age / --timezone for dreaming, and triggers gateway restart automatically (opt-out via --no-restart). Triggers: "enable dreaming", "tune memory half-life", "configure agent memory", "enable active memory", "switch memory style", "conservative/balanced/aggressive memory mode".

技能文档

Claw Memory Manager

Manage OpenClaw Agent's built-in memory features through one safe CLI: enable/disable, tune parameters, preview with dry-run, auto-backup, and auto-restart.

What it does

OpenClaw Agent has two built-in memory features:

  1. Dreaming — scheduled job (default 03:00 local time) that scans your daily memory signals, scores them, and auto-promotes high-recall items to long-term MEMORY.md.
  2. Active Memory — lightweight sub-agent that runs before every turn, retrieves relevant memories, and injects them into the model context window for better recall.

Both require editing nested config trees, syncing to multiple paths in managed environments, and restarting the gateway. This skill does it all in one command, safely.

Supported features

FeatureWhatCLI flags
dreamingLight→REM→Deep three-phase memory consolidation--half-life, --max-age, --timezone
active-memoryProactive memory injection with style presets--style {conservative,balanced,aggressive}

See references/features.md for full schema details.

Quick start — Dreaming

# Check OpenClaw support
python3 scripts/agent_memory.py check dreaming

# See current state
python3 scripts/agent_memory.py status dreaming

# Enable with defaults (half-life 30d, max-age 60d, timezone UTC)
python3 scripts/agent_memory.py enable dreaming

# Custom tuning
python3 scripts/agent_memory.py enable dreaming --half-life 14 --timezone America/New_York

# Preview only
python3 scripts/agent_memory.py enable dreaming --dry-run

# Disable
python3 scripts/agent_memory.py disable dreaming

Quick start — Active Memory

# Enable with default style (balanced)
python3 scripts/agent_memory.py enable active-memory

# Pick a style preset
python3 scripts/agent_memory.py enable active-memory --style conservative
python3 scripts/agent_memory.py enable active-memory --style aggressive

# Inspect current style + parameters
python3 scripts/agent_memory.py status active-memory

# Preview only
python3 scripts/agent_memory.py enable active-memory --style aggressive --dry-run

# Disable
python3 scripts/agent_memory.py disable active-memory

Active Memory style presets

StyleUse casequeryModepromptStyleContext windowInject capTimeoutThinking
conservativeFastest, precision-focusedmessageprecision-heavyuser 1×120 / assist 0150 chars8 soff
balanced (default)Everyday userecentbalanceduser 2×220 / assist 1×180220 chars15 soff
aggressiveBest recall, larger contextfullrecall-heavyuser 4×500 / assist 2×400500 chars25 sminimal

Style is inferred back from queryMode when running status active-memory.

CLI flags

FlagApplies toPurposeDefault
--half-life NdreamingSignal decay half-life (1-90 days)30
--max-age NdreamingSignal hard expiry (1-90 days)60
--timezone TZdreamingIANA timezone for scheduleUTC
--style NAMEactive-memoryconservative / balanced / aggressivebalanced
--dry-runallPrint planned changes; do not writeoff
--no-backupallSkip *.bak. creationoff (backup on)
--no-restartallSkip openclaw gateway restart after changeoff (auto-restart on)

Safety features

LayerBehavior
Auto-backupEvery write creates openclaw.json.bak. (use --no-backup to opt out)
Dry-run--dry-run prints exact JSON change + sync targets + restart action without touching disk
Managed-env auto-detect/app/clawconfig/ and /app/k8s-config/clawconfig/ auto-detected — synced if present, silently skipped if not
ValidationHalf-life and max-age ranges enforced (1-90); --style enforced by argparse choices
Verify after writeRe-reads config to confirm change took effect before reporting success

Configuration sources

The script reads/writes:

  1. Runtime config: ~/.openclaw/openclaw.json (or $OPENCLAW_CONFIG)
  2. Managed-environment mirrors (auto-detected, optional):
    • /app/clawconfig/openclaw.json (Pod restart source in K8s)
    • /app/k8s-config/clawconfig/openclaw.json (K8s ConfigMap source)

If you run OpenClaw locally (e.g. npm install -g openclaw on your laptop), only the runtime config exists and the script does the right thing automatically.

Why use this skill

Without this skill, enabling Active Memory requires:

  1. Reading the OpenClaw plugins config schema
  2. Editing nested JSON under plugins.entries.active-memory with 10+ fields
  3. Picking sensible defaults for queryMode / promptStyle / context windows
  4. Copying to 2 mirror paths (in K8s environments)
  5. Running openclaw gateway restart
  6. Manually verifying

This skill: one command + a style preset, with backup + dry-run + verify built in.

Extending to new memory features

Add a new entry to the FEATURES dict at the top of agent_memory.py:

FEATURES["my-feature"] = {
    "path": ["plugins", "entries", "my-plugin", "config"],
    "enable_patch": {"enabled": True, ...},
    "disable_patch": {"enabled": False},
    "check_key": "enabled",
    "status_key": "frequency",  # field shown in `status`
    "description": "What this feature does",
}

For features with preset-style choices (like active-memory), follow the ACTIVE_MEMORY_STYLES pattern and set supports_style: True in the entry.

Files

claw-memory-manager/
├── SKILL.md              ← agent entry point
├── README.md             ← this file
├── LICENSE               ← MIT
├── .gitignore
├── scripts/
│   └── agent_memory.py   ← single Python entry, zero external deps
└── references/
    └── features.md       ← feature catalog + schema reference

Changelog

See CHANGELOG.md for the full version history.

See also

  • references/features.md — full feature catalog, config schemas, and extension guide
  • OpenClaw docs — platform reference

相关技能

Audit and maintain OpenClaw-style long-term memory. Use for MEMORY.md cleanup, daily-note digestion, duplicate detection, stale-memory review, and promoting...

17 次安装

Scaffold, sanitize, or share an OpenClaw multi-agent memory system with a reusable workspace, memory-lancedb-pro configuration, role prompts, task-board conv...

13 次安装

在本地磁盘以分类纯 Markdown 文件保存需要长期留存的事实,与智能体内置记忆并存。

作者 Iván552 次安装18 星标

Inspect, back up, search, export, and update OpenClaw long-term memory stored with MemoryOS. Use when Codex needs to manage MemoryOS memory files for an Open...

24 次安装

为多智能体的分层记忆统一契约,避免路由漂移、越级写入与作用域扩张。

19 次安装1 星标

Set up privacy-first continuity for an OpenClaw agent using private long-term memory, short-lived daily notes, and review-gated consolidation. Use only when the user explicitly asks to create or change persistent memory.

28 次安装