Memory Manager for Openclaw

A sophisticated dual-track memory system that prevents AI context loss through automated daily journaling and long-term knowledge distillation.

lg-haha
v1.0.0
Mar 24, 2026
0
671
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install xiaolongxia-memory

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 xiaolongxia-memory 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 Manager?

Memory Manager is a robust architecture designed to solve the 'amnesia' problem inherent in large language models when context windows expire or sessions reset. It functions as an external cognitive layer for AI agents, ensuring that critical decisions, user preferences, and project progress are never lost. By utilizing Openclaw Skills, this system transforms volatile chat histories into a structured knowledge base.

The system operates on a dual-track principle: a daily diary acts as an inbox for raw interactions, while a centralized memory file serves as a curated repository of distilled wisdom. This approach ensures that the agent remains lightweight and efficient while retaining access to high-value historical data.

Memory Manager Use Cases

  • Configuring memory management for new AI agents to ensure continuity across sessions.
  • Implementing heartbeat-based periodic memory grooming and consolidation.
  • Fixing issues where AI agents fail to remember previous instructions or user preferences.
  • Adapting structured memory workflows for external platforms like Coze, Dify, or WorkBuddy.
  • Managing long-term project context and technical research history.

How Memory Manager Works

  1. Initialization: The agent loads long-term context from MEMORY.md and recent context from the last two days of diary files at the start of every session.
  2. Active Recording: After high-value interactions, the agent automatically writes key points into a daily markdown file (memory/YYYY-MM-DD.md).
  3. Heartbeat Monitoring: The system checks a JSON state file to see if the last maintenance occurred more than 48 hours ago.
  4. Distillation: During a heartbeat trigger, the agent reviews recent diaries to extract significant insights and updates the main MEMORY.md file.
  5. Optimization: The agent proactively suggests starting new sessions when context grows too large, knowing all essential data is safely persisted.

Memory Manager Setup

To deploy the Memory Manager within your Openclaw Skills environment, establish the following directory structure and configuration files:

# Create the memory directory
mkdir -p workspace/memory

# Initialize the state tracker
echo '{"lastMemoryMaintenance": null}' > workspace/memory/heartbeat-state.json

# Create the primary memory file
touch workspace/MEMORY.md

Update your AGENTS.md to include instructions for reading MEMORY.md and the current day's diary during startup.

Memory Manager Data Schema & Taxonomy

The system organizes data using a hierarchical markdown-based taxonomy to ensure human readability and machine parsability:

File Format Description
MEMORY.md Markdown Curated long-term insights, preferences, and project milestones.
memory/YYYY-MM-DD.md Markdown Raw logs of daily conversations, decisions, and events.
heartbeat-state.json JSON Tracking metadata for the last maintenance timestamp (lastMemoryMaintenance).
SOUL.md Markdown Definitions for the agent's recording habits and memory triggers.

Memory Manager Advanced Features

  • Periodic automated grooming: Automatically cleans up obsolete data every 48 hours via heartbeat tasks.
  • Multi-platform compatibility: Portable prompt templates allow the memory logic to function on Coze, Dify, and other LLM orchestrators.
  • Context Window Compression: Works alongside native platform compression to prioritize high-value persisted data over raw history.
  • Active Reminder System: The agent monitors its own context length and triggers a 'memory save' before a session reset.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*