Memory System Skill for Openclaw

A robust long-term memory management system for OpenClaw agents utilizing structured PostgreSQL and vector-based semantic search.

damiencronw
v1.0.0
Mar 8, 2026
0
1.1k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install openclow-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 openclow-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 Skill?

The Memory System Skill is a sophisticated long-term memory layer designed to give Openclaw Skills the ability to retain and retrieve context over extended periods. It bridges the gap between short-term session memory and permanent knowledge by utilizing a dual-storage approach: structured relational data in PostgreSQL for discrete facts and vector embeddings for semantic retrieval.

By implementing this skill, developers can ensure their AI coding agents remember specific project goals, architectural decisions, and user preferences across different sessions. It provides a reliable infrastructure for building persistent AI personalities and maintaining complex project states without losing context due to token window limitations.

Memory System Skill Use Cases

  • Persisting user coding preferences and architectural decisions across multiple development sessions.
  • Storing and retrieving long-term project goals and real-time status updates.
  • Performing semantic searches through historical interaction data using bge-large-zh embeddings.
  • Automatically archiving local workspace files into a permanent database to maintain a clean environment.

How Memory System Skill Works

  1. The system captures structured information like goals or decisions and stores them in a categorized PostgreSQL relational table.
  2. Unstructured data and conversation history are processed through an embedding model and stored as high-dimensional vectors in pgvector.
  3. A local archival script monitors the workspace, retaining files for 7 days before automatically importing them into the database.
  4. During retrieval, the skill executes either direct SQL queries for structured facts or cosine similarity searches for semantically related memories.
  5. The integrated scripts manage the lifecycle of memory, ensuring that data is synchronized between local markdown files and the database.

Memory System Skill Setup

To set up the Memory System Skill within your Openclaw Skills environment, follow these steps:

# Ensure PostgreSQL is running on local ports
# Structured memory: Postgres.app (Port 5432)
# Vector memory: Homebrew PG (Port 5433)

# Connect to the databases to initialize tables
psql -h localhost -p 5432 -U username -d postgres
psql -h localhost -p 5433 -U username -d postgres

# Use the management script to add new memories
python scripts/memory_manager.py --add "goals" "Project Alpha" "Complete the API integration"

# Perform a semantic search
python scripts/memory_search.py "What were my previous coding preferences?"

Memory System Skill Data Schema & Taxonomy

The skill organizes its information using a hybrid schema optimized for both precision and discovery:

Table Type Purpose
memory_structured Relational Stores discrete categories: goals, decisions, status, preferences, and reference.
longterm_memory Vector Stores content with 1024-dimension embeddings for semantic matching.

Categories in Structured Memory:

  • goals: Long-term objectives.
  • decisions: Historical design choices.
  • status: Current state of ongoing tasks.
  • preferences: User-specific configuration and style choices.
  • reference: External documentation and static data.

Memory System Skill Advanced Features

  • Multi-Database Architecture: Separates structured data from vector search data for optimized performance and scaling.
  • HNSW Indexing: Utilizes Hierarchical Navigable Small World graphs for fast, approximate nearest neighbor search in vector space.
  • Chinese Embedding Support: Optimized for bge-large-zh to provide high-accuracy semantic retrieval for Chinese language context.
  • Automated Retention Policy: Built-in 7-day local file retention logic with automated database migration scripts.
  • Extensible Memory Categories: Easily add new metadata tags and categories to the structured memory schema to fit specific agent workflows.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*