Chinese Memory Optimization (memory-cn) for Openclaw

A specialized optimization suite for OpenClaw to fix Chinese search indexing bugs and enhance long-term memory retrieval performance.

abczsl520
v1.0.0
Mar 7, 2026
1
1.1k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install memory-cn

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-cn 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 Chinese Memory Optimization (memory-cn)?

The memory-cn skill is a technical enhancement package designed for developers using the OpenClaw framework in Chinese language environments. It specifically addresses the FTS5 unicode61 tokenizer bug in SQLite, which frequently fails to segment CJK characters, resulting in a low memory hit rate. By implementing a custom three-layer memory architecture and optimizing search parameters for small LLMs, this skill ensures that Openclaw Skills can accurately retrieve context and manage long-term knowledge.

Beyond bug fixes, the skill introduces automated maintenance workflows, including log compression, batch tagging, and hybrid search tuning. It bridges the gap between raw conversation logs and a structured knowledge base, making it an essential tool for high-performance localized AI agents.

Chinese Memory Optimization (memory-cn) Use Cases

  • Resolving the failure of keyword searches for Chinese terms within agent memory.
  • Tuning 0.6B to 7B parameter models for better vector-based retrieval accuracy.
  • Automating the organization of daily chat logs into tagged, structured Markdown files.
  • Managing large-scale memory growth by compressing logs while preserving historical archives.

How Chinese Memory Optimization (memory-cn) Works

  1. Run a diagnostic script to identify FTS5 segmentation issues and assess the health of existing memory files.
  2. Apply an optimized configuration patch to the agent's memorySearch parameters, adjusting vector weights and chunking sizes.
  3. Update the memoryFlush prompt to ensure new conversation summaries are saved with space-separated Chinese tags for proper indexing.
  4. Execute Python scripts to batch-process historical files, adding missing tags and archiving old data.
  5. Force a re-indexing of the memory database to enable the improved search logic and higher hit rates.

Chinese Memory Optimization (memory-cn) Setup

Ensure your environment has sqlite3 and python3 installed. Then, execute the diagnostic and configuration steps:

# Step 1: Run diagnosis
bash SKILL_DIR/scripts/diagnose.sh

# Step 2: Apply the search configuration via gateway config.patch
# (Refer to the search configuration JSON in the skill documentation)

# Step 3: Tag existing memory projects
python3 SKILL_DIR/scripts/add-tags.py /path/to/memory/projects/

# Step 4: Rebuild the search index
openclaw memory index --force

Chinese Memory Optimization (memory-cn) Data Schema & Taxonomy

The skill implements a prioritized three-layer architecture to optimize the performance of Openclaw Skills:

Priority Category File Path Strategy
P0 Core Facts MEMORY.md High-frequency facts, kept under 2KB for fast loading.
P1 Knowledge projects/, lessons/ Tag-based retrieval using <!-- tags: ... --> metadata.
P2 History archive/, YYYY-MM-DD.md Compressed logs (<5KB) for deep historical context.

Chinese Memory Optimization (memory-cn) Advanced Features

  • Hybrid search integration with a 0.75 vector weight to overcome FTS5 limitations.
  • Automated cron-based maintenance for weekly log compression and index cleanup.
  • Temporal decay weighting (temporalDecay) to prioritize recent context in search results.
  • MMR (Maximal Marginal Relevance) support to ensure diversity in retrieved memory chunks.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*