360 Secure SkillHub
360 安全技能中心

Skill

为 OpenClaw 提供三层(情景、语义、程序)本地记忆:通过 Python 脚本存储和检索记忆,支持关键词、BM25、混合与增强检索模式,可配置自动回忆、自动捕获与工作区目录,运行时依赖 Python3。

petercheng
petercheng
热度 29.26
最近更新 2026-05-01 13:51:49
分类:知识依赖:代码执行 / 读写文件应用场景:笔记整理 / 研究

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add opensourceclaw-claw-mem
Metadata
name
claw-mem
description
Three-Tier Memory System for OpenClaw. Store and recall memories across sessions with Episodic, Semantic, and Procedural layers. BM25 + Heuristic retrieval.
homepage
https://github.com/opensourceclaw/claw-mem
metadata
{"clawdbot":{"emoji":"🧠","requires":{"bins":["python3"],"packages":["claw-mem"]}}}

claw-mem: Three-Tier Memory System

Local-first memory system with three memory layers and intelligent retrieval.

Prerequisites

pip3 install git+https://github.com/opensourceclaw/claw-mem.git

Quick Start

Search Memory

python3 {baseDir}/scripts/search.py "project deadlines" --limit 10

Store Memory

python3 {baseDir}/scripts/store.py "User preference" --category preference

Start Bridge (for OpenClaw integration)

python3 {baseDir}/scripts/bridge.py --workspace ~/.openclaw/workspace

Memory Layers

Layer Purpose Example
Episodic Event sequences Session context
Semantic Knowledge facts User preferences
Procedural Rules Best practices

Retrieval Modes

Mode Description Use Case
keyword Simple keyword match Quick lookup
bm25 BM25 ranking Relevance ranking
hybrid BM25 + Keyword Balanced retrieval
enhanced_smart Full pipeline Best quality

Set mode via environment:

export CLAW_MEM_SEARCH_MODE=enhanced_smart

Configuration

OpenClaw config (openclaw.config.json):

{
  "plugins": {
    "slots": {
      "memory": "claw-mem"
    },
    "claw-mem": {
      "config": {
        "workspaceDir": "~/.openclaw/workspace",
        "autoRecall": true,
        "autoCapture": true,
        "topK": 10
      }
    }
  }
}

Performance

Operation Latency
Initialize ~4ms
Store ~8ms
Search ~5ms
Average ~6ms

Advanced

See references for detailed documentation: