Memory System - Three-Layer Memory Architecture for Openclaw

A sophisticated prompt-driven memory architecture that organizes AI agent context into three hierarchical layers using physical Markdown storage.

jason99666
v1.0.0
Apr 13, 2026
0
729
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install light-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 light-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 System - Three-Layer Memory Architecture?

The Memory System is a lightweight, cross-platform architecture designed for LLM agents to solve the critical problem of context amnesia in long-duration conversations. By leveraging Openclaw Skills, this system implements a tiered memory structure (L1, L2, and L3) that distills raw dialogue into actionable insights. It relies entirely on prompt-driven logic, removing dependencies on Python or external vector databases, making it highly portable and secure.

This architecture uses a Memory Synergy protocol where the agent does not interrupt the user flow to write memory. Instead, it uses explicit tagging for decisions and insights which are then processed asynchronously via Cron tasks. All data is persisted in human-readable Markdown files, ensuring that the user remains in full control of the agent's evolving knowledge base.

Memory System - Three-Layer Memory Architecture Use Cases

  • Building persistent AI coding assistants that remember architectural decisions across multi-day sessions.
  • Managing long-term context for research agents without hitting token limits.
  • Developing self-improving agents that extract lessons learned from past failures and successes.
  • Creating portable agent memory that can be audited or migrated without specialized database tools.

How Memory System - Three-Layer Memory Architecture Works

  1. Users or agents explicitly tag key information in the chat using markers like Decision: or Insight:.
  2. The L1 layer performs an hourly distillation, reading raw logs and updating a central session state file.
  3. A nightly L2 archive process takes the refined L1 data and organizes it into date-stamped Markdown files for daily logging.
  4. Weekly L3 extraction uses the Context-Action-Result (CAR) framework to distill daily logs into high-level experience and permanent wisdom.
  5. Automated Cron tasks handle the lifecycle of these files, including garbage collection of temporary logs and periodic health heartbeats.

Memory System - Three-Layer Memory Architecture Setup

To deploy the memory architecture within your environment, use the atomic installation command which handles file preparation and cron registration in a single flow:

/install-memory

If you are upgrading from a legacy system, you can migrate your existing data to the L1/L2/L3 structure using:

/migrate-memory

Memory System - Three-Layer Memory Architecture Data Schema & Taxonomy

The system organizes metadata and memory layers into a clear directory structure using the following schema:

File/Folder Purpose Format
SESSION-STATE.md L1: Active short-term context and current goals Markdown
memory/YYYY-MM-DD.md L2: Daily logs and historical archives Markdown
MEMORY.md L3: Long-term CAR-structured knowledge Markdown
prompts/ Core logic for distillation and cleanup Markdown
templates/ Pre-defined structures for memory consistency Markdown
_meta.json Metadata for integration with Openclaw Skills JSON

Memory System - Three-Layer Memory Architecture Advanced Features

  • Context-Action-Result (CAR) distillation for high-fidelity experience capture.
  • Non-blocking asynchronous extraction through the Memory Synergy protocol.
  • Automated Session GC for physical file cleanup to prevent storage bloat.
  • Heartbeat monitoring to ensure memory tasks are running correctly.
  • Proactive conflict detection to prevent interference with other proactive agent skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*