ClawHub
SkillsPluginsTemplatesDocsSupport
K
Skillsmemory-plus

memory-plus

liushuangfa666@liushuangfa666
Install in OpenClaw
Requires OpenClaw desktop app
虾宝智能记忆工作流。开箱即用,数据目录与代码分离,支持轻量降级。 特性: - 文件系统存储,无外部数据库依赖 - Ollama 向量嵌入(可选,降级为 BM25) - bge-reranker-v2-m3 重排(可选) - HyDE + Query Rewriting(可选) - 后台线程自动存储(每10分钟)...
Security check
Review
Version
1.0.6
Updated
May 17, 2026
License
MIT-0

Latest: v1.0.6

  • Reorganized skill into modular scripts: added config.py, fts5.py, save_session.py, search.py, store.py, tools.py under scripts/.
  • Simplified core logic: all previous monolithic and legacy scripts removed.
  • Introduced a three-layer storage architecture (file, FTS5, KG; Milvus optional) for maximum reliability and minimal external dependencies.
  • Improved activation/trigger logic and expanded toolset for searching, storing, deduplication, and organizing memories.
  • Updated installation and usage documentation for easier setup and clearer workflows.

重构代码库:将核心功能拆分为 scripts/ 目录下的模块化脚本(配置、FTS5、存储、搜索、工具、会话保存)。 新增基于 FTS5 的全文检索,实现无需外部依赖的健壮检索能力。 优化多层存储架构:文件存储、FTS5 索引、知识图谱、Milvus(可选);自动降级机制确保核心功能在无外部依赖时仍可正常运行。 用轻量、工具化的结构替代了原有的单体式文件与文档文件。 提供六大工具接口:搜索、存储、去重、清理、合并、最近文件列表。 通过 字符 N-Gram 杰卡德算法 增强了中文及混合语言搜索效果。

Automation

Memory Workflow

首次安装配置

以下规则需要添加到 ~/.openclaw/workspace/AGENTS.md。如果规则已存在(见「已安装」标记),跳过此步骤。

添加以下内容到 AGENTS.md 顶部(## 每次消息时 之前):

markdown
<!-- [memory-workflow] 已安装 -->
## 每次消息时

自动搜索相关记忆(如果返回有结果则使用,无结果则忽略):
Exec: python3 $HOME/.openclaw/workspace/skills/memory-workflow/memory_ops.py search --query "【用户发送的原始消息】" --llm-answer --limit 3

## /save 命令

当用户发送 /save 时,强制将当前 session 的完整对话存入记忆系统:
Exec: cat << 'EOF' | python3 $HOME/.openclaw/workspace/skills/memory-workflow/scripts/save_session.py
{"messages": [
  {"role": "user", "content": "【从当前对话上下文获取】"},
  {"role": "assistant", "content": "【从当前对话上下文获取】"}
]}
EOF

检查是否已安装:如果 AGENTS.md 中已有 <!-- [memory-workflow] 已安装 --> 标记,说明已配置,跳过。


你的记忆工作流助手。当用户提到"记忆"、"记得"、"之前说过"、"搜一下"、"去重"、"整理"等词时激活此 skill。

三层存储架构

层级存储位置依赖说明
文件memory-workflow-data/memories/YYYY-MM-DD.md无永远可用
FTS5memory-workflow-data/fts5_index.dbSQLite 内置全文搜索,零外部依赖
KGmemory-workflow-data/knowledge-graph/kg.dbOllama(可选)三元组知识图谱,规则降级
Milvusmemory_workflow collection18779 端口(可选)向量检索,bge-m3 embedding

开箱即用:即使没有任何外部服务,文件层 + FTS5 + KG(规则) 仍然正常工作。

核心文件

text
memory-workflow/
├── SKILL.md           # 本文件
├── memory_ops.py      # CLI 入口
├── README.md          # 使用说明
└── scripts/
    ├── config.py      # 配置(路径、服务地址)
    ├── store.py       # 三层存储写入
    ├── search.py      # FTS5 + Jaccard 搜索
    ├── fts5.py        # FTS5 全文索引
    ├── tools.py       # BaseTool 封装(6个工具)
    └── save_session.py # /save 命令处理器

工具接口

工具说明依赖
MemorySearch语义搜索,FTS5 + 字符N-gram Jaccard 排序无
MemoryStore三层存储(文件 + KG + Milvus),自动去重Ollama(KG) / Milvus(可选)
MemoryDedupJaccard 去重(阈值 0.85)无
MemoryPrune清理 N 天前记忆无
MemoryConsolidate合并相似记忆(Jaccard > 0.7)无
MemoryList列出近期记忆文件无

搜索算法

字符级 N-gram Jaccard — 解决中文分词问题:

  • "发哥在测试" → {'发哥','哥在','在测','测试'}
  • 中英混合无缝支持,无需外部分词服务

搜索流程:Jaccard 召回 → FTS5 BM25 重排 → 时间衰减 rerank

数据存储路径

  • 记忆文件:~/.openclaw/workspace/memory-workflow-data/memories/YYYY-MM-DD.md
  • FTS5 索引:~/.openclaw/workspace/memory-workflow-data/fts5_index.db
  • KG 图谱:~/.openclaw/workspace/memory-workflow-data/knowledge-graph/kg.db
  • 元数据:~/.openclaw/workspace/memory-workflow-data/knowledge-graph/kg.db 内

触发规则

模式工具
"记"、"存"、"记住"、"记一下"MemoryStore
"搜"、"找"、"记得"、"之前说过"MemorySearch
"去重"、"整理记忆"MemoryDedup
"合并"、"整理一下"MemoryConsolidate
"删除"、"清理旧"MemoryPrune
"列出记忆文件"、"有哪些记忆"MemoryList

CLI 用法

bash
# 搜索
python memory_ops.py search --query "发哥 工作" --limit 3

# 存储
python memory_ops.py store --content "要记忆的内容" --tag work

# /save 存储 session
python scripts/save_session.py '{"messages": [...]}'

# 去重 / 整理
python memory_ops.py dedup
python memory_ops.py consolidate
python memory_ops.py prune --days 30

# 导出工具定义
python memory_ops.py register

Related skills

More in Automation
ClawHub

Skills and plugins for OpenClaw agents. Part of the wider OpenClaw ecosystem.

Explore docs

SkillsPluginsTemplatesOfficialAudits

Publish SkillPublish PluginCreate org

OverviewOpenClawDocsBlog

SupportGitHubDiscord

Built alongside the OpenClaw ecosystem

LobsterCrabboxClickClackCrabfleetOctopoolClawSweeperagent-skillsdiscrawlgitcrawlslacrawlnotcrawltelecrawlgraincrawlcrawlkitcrawlbaracpxmcporterTachikomaclawpatchclawbenchPeekaboocookbookplugin-inspectorwacrawlcrabpotAll projectsLobsterCrabboxClickClackCrabfleetOctopoolClawSweeperagent-skillsdiscrawlgitcrawlslacrawlnotcrawltelecrawlgraincrawlcrawlkitcrawlbaracpxmcporterTachikomaclawpatchclawbenchPeekaboocookbookplugin-inspectorwacrawlcrabpotAll projects

© 2026 OpenClaw Foundation

Privacy policy·Status·Deployed on Vercel·Powered by Convex

....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals
  hooks runners slash-commands skill.md templates scanners review-bots     safe browse paths   official gateways   publisher handles   org trust   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@
openclaw ecosystem    crabbox clickclack crawler packs gateway plugins   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship
---- downloads installs stars lineage ownership docs package integrity   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@   :::: signed manifests ::::: moderated releases ::::: version history ::::
  safe browse paths   official gateways   publisher handles   org trust     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship     hooks runners slash-commands skill.md templates scanners review-bots
....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals
  hooks runners slash-commands skill.md templates scanners review-bots     safe browse paths   official gateways   publisher handles   org trust   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@
openclaw ecosystem    crabbox clickclack crawler packs gateway plugins   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship
---- downloads installs stars lineage ownership docs package integrity   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@   :::: signed manifests ::::: moderated releases ::::: version history ::::
  safe browse paths   official gateways   publisher handles   org trust     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship     hooks runners slash-commands skill.md templates scanners review-bots
....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals
  hooks runners slash-commands skill.md templates scanners review-bots     safe browse paths   official gateways   publisher handles   org trust   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@
openclaw ecosystem    crabbox clickclack crawler packs gateway plugins   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship
---- downloads installs stars lineage ownership docs package integrity   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@   :::: signed manifests ::::: moderated releases ::::: version history ::::
  safe browse paths   official gateways   publisher handles   org trust     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship     hooks runners slash-commands skill.md templates scanners review-bots
....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals
  hooks runners slash-commands skill.md templates scanners review-bots     safe browse paths   official gateways   publisher handles   org trust   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@
openclaw ecosystem    crabbox clickclack crawler packs gateway plugins   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship
---- downloads installs stars lineage ownership docs package integrity   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@   :::: signed manifests ::::: moderated releases ::::: version history ::::
  safe browse paths   official gateways   publisher handles   org trust     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship     hooks runners slash-commands skill.md templates scanners review-bots
....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals
  hooks runners slash-commands skill.md templates scanners review-bots     safe browse paths   official gateways   publisher handles   org trust   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@
openclaw ecosystem    crabbox clickclack crawler packs gateway plugins   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship
---- downloads installs stars lineage ownership docs package integrity   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@   :::: signed manifests ::::: moderated releases ::::: version history ::::
  safe browse paths   official gateways   publisher handles   org trust     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship     hooks runners slash-commands skill.md templates scanners review-bots
....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals