Memory Layer for Openclaw

A hierarchical memory management system for AI agents that optimizes context usage through a tiered Index-Topic-Transcript architecture.

whyischen
v0.1.1
Apr 3, 2026
0
812
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install memory-layer

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-layer 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 Layer?

The Memory Layer is a sophisticated memory architecture designed specifically for Openclaw Skills, drawing inspiration from the Claude Code memory philosophy. It addresses the challenge of context window bloat by organizing agent knowledge into three distinct tiers: a lightweight Index for global pointers, structured Topic files for on-demand knowledge, and raw Transcripts for historical reference.

By implementing this tiered approach, the system ensures that the AI agent maintains high context efficiency, often exceeding 70% utilization. This allows for long-term project persistence and complex knowledge retrieval without overwhelming the model's immediate memory capacity.

Memory Layer Use Cases

  • Designing a high-performance Index/Topic/Transcript memory structure for AI agents.
  • Migrating cluttered flat memory files into a scalable hierarchical system.
  • Automating nightly memory maintenance and cleanup using the autoDream feature.
  • Optimizing context window usage for long-running development projects.
  • Implementing priority-based retrieval using importance scoring for large datasets.

How Memory Layer Works

  1. The system initializes by loading the Index (MEMORY.md), which serves as a map of all available knowledge pointers.
  2. When a specific task is identified, the agent selectively loads relevant Topic files from the memory/topics/ directory.
  3. Raw interaction logs are stored in the Transcript layer and are only accessed via targeted search commands to preserve tokens.
  4. To maintain data integrity, updates are written to Topic files first, followed by an Index synchronization.
  5. The autoDream process optionally runs scheduled maintenance to reorganize data and archive old transcripts.

Memory Layer Setup

To get started with this memory system for your Openclaw Skills, follow these steps:

# Create the required directory structure
mkdir -p memory/topics memory/transcripts/$(date +%Y-%m)

# Backup your existing memory files
cp -r memory/ memory.backup.$(date +%Y%m%d)

# Restructure your MEMORY.md as an index (refer to index-spec.md)
# Optional: Enable automated maintenance
openclaw cron add "0 23 * * *" "memory-system auto-dream"

Memory Layer Data Schema & Taxonomy

The Memory Layer organizes data using a strict hierarchy to ensure fast retrieval within Openclaw Skills:

Layer Location Size Limit Load Strategy
Index MEMORY.md ≤ 25KB Always Loaded
Topic memory/topics/*.md ≤ 50KB On-Demand (2-5 files)
Transcript memory/transcripts/*.log N/A Grep/Search Only

Topics are further categorized by domain, path, update timestamp, summary, tags, and an importance score (0.0 - 1.0).

Memory Layer Advanced Features

  • autoDream: An automated nightly maintenance routine for memory reorganization and cleanup.
  • Context Efficiency: Logic designed to maintain 70%+ context window utilization by preventing metadata bloat.
  • Importance Scoring: A priority-based retrieval system that ranks memory topics by relevance and weight.
  • Automated Archiving: Historical transcripts older than 90 days are automatically moved to long-term storage.
  • Privacy Discipline: Built-in protocols to ensure sensitive data like passwords or health records are never stored in the transcript layer.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*