Memory Tiers for Openclaw

A sophisticated tiered memory management system that optimizes AI agent context windows using a hierarchy of hot, warm, and cold storage tiers.

chrisrobison
v0.1.0
Feb 21, 2026
0
475
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install memory-tiers

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-tiers 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 Tiers?

Memory Tiers is a specialized framework designed to solve the context window limitations of AI agents. By implementing a logic similar to a CPU cache hierarchy, it ensures that your agent always has the most relevant information immediately available while archiving stale data into deeper tiers. This approach prevents context bloat and ensures high-priority information remains in the hot Tier 1 zone.

The system utilizes a structured hierarchy moving from MEMORY.md (Hot) to archival logs (Cold). It automatically handles the promotion and demotion of data based on real-world access patterns, making it an essential addition to the collection of Openclaw Skills for developers building long-running or complex autonomous agents.

Memory Tiers Use Cases

  • Managing long-term project context without exceeding LLM token limits.
  • Automatically archiving old session logs while keeping recent insights accessible.
  • Improving agent performance by keeping only relevant data in the active context window.
  • Tracking information retrieval patterns to optimize data organization for AI workflows.

How Memory Tiers Works

  1. The system tracks memory access by scanning session transcripts for reads, writes, and searches.
  2. Access data is logged in a state file to monitor the frequency and recency of specific memory sections.
  3. A maintenance script evaluates sections against pre-defined aging rules (e.g., 7 days of inactivity for Tier 1).
  4. Information is automatically promoted or demoted between tiers based on these access metrics.
  5. Heartbeat routines ensure the memory hierarchy stays balanced and within line-count limits.

Memory Tiers Setup

To integrate this into your workflow, install the scripts and run the initial tracking:

# Navigate to the skill directory and track recent access
node scripts/track.js --since 24

# Preview maintenance changes without applying them
node scripts/maintain.js --dry-run

# Apply promotion and demotion rules
node scripts/maintain.js

Memory Tiers Data Schema & Taxonomy

Memory Tiers organizes data into a specific hierarchy and tracks state via JSON files:

Tier File Location Purpose
Tier 1 MEMORY.md Hot context, ~100 lines max, always loaded.
Tier 2 memory/tier2-recent.md Warm context, data from the last 30 days.
Tier 3 memory/tier3-archive.md Cold context, deep history for search only.
Raw memory/YYYY-MM-DD.md Immutable daily logs acting as the source of truth.

State Files:

  • state/access-log.json: Contains timestamps and counts for per-section access.
  • state/maintenance-log.json: A historical record of all promotion and demotion actions.

Memory Tiers Advanced Features

  • Custom demotion thresholds to fine-tune how long data stays in Tier 1.
  • Automatic Tier 1 line-limit enforcement (demotes lowest-access sections when >100 lines).
  • Manual promotion/demotion overrides for specific critical sections.
  • Detailed health reporting with machine-readable JSON output for multi-agent monitoring.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*