Memory Manager for Openclaw

A sophisticated three-tier memory architecture for AI agents that manages short-term context, medium-term summaries, and long-term vector-based retrieval.

forvendettaw
v1.0.0
Feb 16, 2026
0
0
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install three-tier-memory-v2

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 three-tier-memory-v2 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?

The Memory Manager is a comprehensive memory architecture designed to provide AI agents with human-like recall capabilities. By implementing a Three-Tier Memory Management system, this skill allows agents to maintain immediate context through sliding windows, compress historical data into summaries, and persist critical information in a long-term vector database. This structured approach ensures that Openclaw Skills can handle long-running conversations and complex knowledge retrieval without exceeding token limits.

Built for developers who need persistent agent state, this skill bridges the gap between ephemeral chat sessions and permanent knowledge bases. It intelligently transitions data between tiers based on token usage and semantic importance, ensuring that the agent always has the most relevant information at its fingertips while maintaining high performance and cost-efficiency.

Memory Manager Use Cases

  • Managing multi-session conversation history to ensure the agent remembers user preferences over time.
  • Optimizing context window usage by automatically summarizing old messages when token thresholds are met.
  • Building personal knowledge bases (RAG) where important facts are indexed for semantic retrieval.
  • Initializing new chat sessions with relevant historical context pulled from long-term storage.

How Memory Manager Works

  1. The system initializes the environment and creates the necessary storage paths for JSON files and vector databases.
  2. Real-time messages are stored in a short-term sliding window using a FIFO (First-In-First-Out) logic to keep immediate context fresh.
  3. When the total tokens in the sliding window exceed a set threshold, the system triggers an automated summary using a cost-effective LLM.
  4. These summaries and important interaction segments are vectorized and stored in ChromaDB for long-term persistence.
  5. During any new query, the skill performs a semantic search against the long-term store to inject relevant historical data back into the prompt context.

Memory Manager Setup

To integrate this memory system into your Openclaw Skills environment, follow these steps:

# Initialize the memory storage and config
python3 scripts/memory_manager.py init

# Manually add a specific piece of information to short-term memory
python3 scripts/memory_manager.py add --type short --content "The user prefers Python for all coding tasks"

# Search through stored memories using semantic queries
python3 scripts/memory_manager.py search "What are the user preferences?"

You must also configure your memory/config.yaml to define your window sizes and summary models.

Memory Manager Data Schema & Taxonomy

The Memory Manager organizes data across specific storage formats to optimize retrieval speed and storage efficiency:

Tier Storage Location Logic Format
Short-Term memory/sliding-window.json FIFO Queue (Default 10 items) JSON List
Medium-Term memory/summaries/ Token-triggered (Default 4000 tokens) Dated JSON files
Long-Term memory/vector-store/ Semantic RAG (ChromaDB) Vector Embeddings
Config memory/config.yaml Thresholds and Model Settings YAML

Memory Manager Advanced Features

  • Automated summarization using high-efficiency models like GLM-4-Flash to minimize latency and costs.
  • Semantic search integration with ChromaDB, allowing for high-precision retrieval of long-term memories.
  • Configurable sliding window size and token thresholds to tailor memory depth to specific hardware or API limits.
  • Seamless transition of data between short-term, medium-term, and long-term tiers to prevent information loss.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*