Memory Compactor for Openclaw

A specialized utility that automatically organizes and compresses long-term AI memory to prevent context bloat and maintain agent efficiency.

soroyue
v1.0.0
Apr 4, 2026
0
670
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install memory-compactor

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install memory-compactor using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Memory Compactor?

Memory Compactor is a crucial management tool for developers building complex autonomous agents. It systematically organizes memory files by compressing redundant content and clearing expired information, ensuring that the agent's context window remains focused on high-value data. As part of the Openclaw Skills framework, it helps maintain long-term coherence by distilling daily logs into key insights while preserving core identity and goals.

By implementing a tiered compression strategy, the skill balances the need for historical record-keeping with the technical limitations of LLM context windows. It transforms verbose, raw interaction logs into structured, actionable intelligence, making it an essential component for any long-running AI agent deployment.

Memory Compactor Use Cases

  • Reducing token usage by distilling 7-day-old daily logs into key decision points.
  • Maintaining a clean MEMORY.md by automatically removing completed temporary tasks.
  • Organizing categorical knowledge into patterns and preferences while purging one-time transient data.
  • Preventing performance degradation in agents with massive long-term memory files.

How Memory Compactor Works

  1. Importance Scoring: The skill analyzes original memory files and assigns scores based on relevance and frequency.
  2. Association Check: It performs a link check to ensure that any information connected to active tasks or goals is preserved.
  3. Summary Distillation: Using LLM-driven abstraction, it generates concise summaries of verbose daily entries.
  4. Deduplication: The algorithm identifies and merges redundant entries across different memory layers.
  5. Output Generation: The finalized, streamlined memory is written back to the file system, replacing the bloated originals.

Memory Compactor Setup

To integrate this tool into your Openclaw Skills workflow, ensure your agent has write access to the memory directory and add the skill to your configuration.

# Add the memory-compactor skill
openclaw install memory-compactor

# Manually trigger a memory cleanup
openclaw run "organize memory"

Memory Compactor Data Schema & Taxonomy

Tier Path Compression Cycle Key Retention
L1 (Daily) memory/YYYY-MM-DD.md 7 Days Key decisions, events, and major lessons.
L2 (Category) memory/categories/*.md 30 Days Patterned knowledge and user preference settings.
L3 (Global) MEMORY.md Weekly Core identity, long-term goals, and fundamental rules.

Memory Compactor Advanced Features

  • Multi-tiered compression logic (L1, L2, L3) for granular control over data lifecycle.
  • Size-based triggers that activate when memory files exceed a specific token threshold.
  • Scheduled maintenance mode, defaulting to every Sunday at 22:00 for zero-interference cleanup.
  • Deep integration with Openclaw Skills for cross-agent memory standardization.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*