Memory-Sorting for Openclaw

A systematic maintenance skill that organizes, prunes, and validates AI agent memory files to prevent information decay.

jofiction918
v3.0.7
Apr 8, 2026
0
920
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install memory-sorting

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-sorting 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-Sorting?

Memory-Sorting acts as a comprehensive maintenance engine for AI long-term memory, specifically designed to optimize MEMORY.md and the topics/ directory. In the ecosystem of Openclaw Skills, this tool ensures that an agent's knowledge base remains coherent by treating information management like a structured wardrobe organization. It systematically scans for technical debt within memory files, providing a clear path to high-fidelity data.

The skill provides a vital layer of governance for AI-driven workflows by identifying memory rot—outdated, conflicting, or redundant information that can lead to agent hallucinations or inefficient processing. By implementing a strict scan-and-approve workflow, it keeps the human-in-the-loop while automating the tedious task of knowledge pruning.

Memory-Sorting Use Cases

  • Regular weekly maintenance of complex AI memory repositories to ensure high retrieval accuracy.
  • Resolving contradictions between old project requirements and current daily logs.
  • Detecting and deleting orphaned files that are no longer indexed or relevant in the primary memory map.
  • Reducing token overhead by consolidating fragmented topics and enforcing strict line and size limits.

How Memory-Sorting Works

  1. Perform a systematic scan of the topics/ directory and MEMORY.md to build a comprehensive file inventory and metadata map.
  2. Execute a six-category problem detection phase focusing on duplicates, expiration, contradictions, orphans, fragmentation, and storage limits.
  3. Verify the reality of memory entries by cross-referencing documented paths against the actual file system and current configurations.
  4. Generate a detailed health report and cleanup proposal for user review, requiring an explicit approval gate before any file modification.
  5. Execute approved modifications sequentially across all affected files and generate a final status report with execution details.

Memory-Sorting Setup

To utilize Memory-Sorting, ensure your agent has the necessary file system permissions enabled within your configuration. This skill is built to integrate seamlessly with the standard Openclaw Skills architecture.

# Trigger the sorting process manually via command
/memory-sorting

The skill requires FileRead and FileWrite access to modify documentation, and exec permission to perform grep-based global searches for conflict detection.

Memory-Sorting Data Schema & Taxonomy

Memory-Sorting organizes and validates data based on the following structural taxonomy:

Component Type Data Elements Analyzed
topics/*.md Markdown frontmatter (name, type, mtime), full content body
MEMORY.md Markdown Index pointers, line counts (max 200), byte size (max 25KB)
memory/*.md Daily Logs Timestamps and latest conclusions used as a timeline reference
Execution Reports JSON/MD Health scores, PO (Must-do) tasks, and validation results

Memory-Sorting Advanced Features

  • Intelligent Health Scoring: Evaluates memory quality on a 0-100 scale across index completeness, timeliness, and thematic aggregation.
  • Reality Verification Engine: Automatically identifies and proposes the removal of memories referencing files or configurations that no longer exist in the codebase.
  • Selective Approval Logic: Support for granular control where users can approve all changes, reject specific numbered IDs, or add exceptions.
  • Context-Aware Exclusions: Smartly ignores false positives such as shared source URLs, contact info in different contexts, or recent TODO lists within a 7-day window.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*