Smart Memory v2 for Openclaw

A persistent cognitive memory runtime for OpenClaw that provides long-term episodic and semantic storage through a FastAPI engine and Node adapter.

chenghaifeng08-creator
v2.5.1
Mar 24, 2026
0
476
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install smart-memory-automaton

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 smart-memory-automaton 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 Smart Memory v2?

Smart Memory v2 is a sophisticated long-term memory solution designed to transform how AI agents interact with historical data. Unlike legacy vector stores, this runtime functions as a full cognitive memory system for Openclaw Skills, enabling agents to maintain structured episodic, semantic, belief, and goal-oriented data. It bridges the gap between ephemeral chat sessions and persistent intelligence by providing a local API that handles entity-aware retrieval, reranking, and background consolidation.

By integrating this skill, developers can grant their agents a 'working memory' that survives restarts and session resets. It leverages a FastAPI backend for heavy lifting—such as embedding generation and reflection—while providing a lightweight Node adapter for seamless integration into existing Openclaw Skills workflows. The system is specifically optimized for local execution, ensuring data privacy and low-latency access to cognitive insights.

Smart Memory v2 Use Cases

  • Persistent storage of user preferences, project decisions, and long-term goals across multiple chat sessions.
  • Automated session summarization to capture 'session arcs' and maintain continuity in complex development tasks.
  • Background reflection and conflict resolution to keep the agent's knowledge base consistent and updated.
  • Context injection for complex agents that need to surface pending insights naturally during conversation.

How Smart Memory v2 Works

  1. The Openclaw agent initiates a query or commit through the provided tool interfaces like memory_search or memory_commit.
  2. A mandatory health check is performed against the local FastAPI server to ensure the cognitive engine is responsive.
  3. For memory commits, the system serializes the data to protect CPU embedding throughput, queuing requests if the server is temporarily unreachable.
  4. The background orchestrator periodically runs consolidation tasks, such as reflection and memory decay, to refine stored information.
  5. During response generation, active context (including projects and top-of-mind questions) is passively injected into the model's prompt.
  6. At the end of a session, the system extracts conversation turns and generates a summary arc to be stored as a long-term episodic memory.

Smart Memory v2 Setup

Smart Memory v2 requires a CPU-only environment to ensure compatibility across Docker, WSL, and standard laptops. Follow these steps to initialize the Openclaw Skills component:

# Navigate to the skill directory
cd smart-memory

# Set up the Python environment
python3 -m venv .venv
source .venv/bin/activate

# Install CPU-only PyTorch first (Required)
pip install torch --index-url https://download.pytorch.org/whl/cpu

# Install cognitive engine and Node dependencies
pip install -r requirements-cognitive.txt
npm install

Smart Memory v2 Data Schema & Taxonomy

The skill organizes memory into a multi-tiered taxonomy to ensure high-relevance retrieval within Openclaw Skills:

Memory Type Description Key Metadata
Episodic Specific events and session arcs session_id, timestamp, tags
Semantic General facts and knowledge entity_type, importance
Belief Agent or user-defined truths confidence_score, source
Goal Active objectives and tasks status, priority, deadline

All pending insights and retry-queued items are maintained in local JSON buffers (e.g., .memory_retry_queue.json) to guarantee data persistence during server downtime.

Smart Memory v2 Advanced Features

  • Entity-aware reranking for superior retrieval accuracy compared to standard vector search.
  • Automatic retry queue that flushes upon successful heartbeat or tool calls.
  • Session Arc Lifecycle Hooks that automatically summarize and commit conversation milestones every 20 turns.
  • Passive Context Injection that adds a structured [ACTIVE CONTEXT] block to agent prompts without manual intervention.
  • Observability endpoints for real-time monitoring of pending insights and memory health.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*