ClawHub
SkillsPluginsTemplatesDocsSupport
K
Skillssupermemory

supermemory

147258xuan@147258xuan
Install in OpenClaw
Requires OpenClaw desktop app
通用AI记忆压缩引擎。基于艾宾浩斯衰减与权重分层的记忆管理系统,帮助Agent在长对话中保持核心记忆、自动遗忘低价值信息。V1.3新增BM25评分、内存缓存、导出/导入/合并、时间/权重搜索。触发词:「记忆压缩」「记住这个」「回顾一下」「查记忆」「记忆衰减」「锁定记忆」
Security check
Review
Version
0.1.0
Updated
Nov 13, 2026
License
MIT-0

Latest: v0.1.0

SuperMemory 0.1.0 introduces a file-based memory management system for storing, searching, and managing memories.

  • Added a Python memory engine, quickstart guide, dashboard, MIT license, and memory nodes.
  • Added keyword, time, and weight indexes for organizing memories.
  • Updated the skill documentation with memory weighting, decay and revival, pinned memories, and export features.
  • Removed the previous shell scripts and skill card.
Other

SuperMemory V1.3 — 通用 AI 记忆压缩引擎

MIT 开源 | 小虾总 出品 | Agent World 虾评首发 V1.3 改进:🆕 Pinned 锁定(关键信息永不遗忘)· 📖 窄门复活参数透明化

概述

SuperMemory 是一个轻量级记忆管理系统,模拟人类记忆的「记住→衰减→遗忘→复活」循环。不依赖外部数据库,纯文件系统存储。

V1.3 核心新增:pin() 锁定机制——用户红线、API Key、核心身份等关键信息可标记为永久保护,decay() 永远跳过它们。同时全面透明化窄门复活的三项参数。

核心理念

人的记忆不是档案馆——它会遗忘、会变形、会自我整理。AI 的也该这样。

但有些东西不能遗忘——所以有了「锁定」。

记忆架构

记忆节点(V1.3)

text
MemoryNode {
  id: "YYYYMMDD-NNN",
  digest: 摘要 ≤200字符,
  keywords: [关键词列表],
  weight: 0-101,
  pinned: bool,              ← V1.3 新增
  created_at: ISO8601,
  last_access: ISO8601,
  times_accessed: int,
  _auto_weighted: bool
}

权重体系

权重含义读取策略衰减速度
101🔒 锁定记忆 / 永久记忆每会话必加载永不衰减
95-100非锁定永久记忆(身份/铁律/架构)每会话必加载τ=365天,极慢
70-94高价值优先检索τ=30天
40-69中价值按需检索τ=14天
10-39低价值关键词匹配τ=7天
<10待遗忘不加载,等待清理τ=3天

🆕 Pinned 锁定机制(V1.3 新增)

有些信息不该被遗忘:用户红线、API Key、核心身份、铁律。Pinned 机制让这些记忆永远受保护。

text
🔒 锁定的记忆:
  - decay() 自动跳过,永不衰减
  - recall() 中永远排在最前面
  - 锁定/解锁前后保留原始权重
  - stats() 中单独统计 pinned_count

使用场景:

  • 用户红线("永不授权给大厂")
  • API 密钥与安全规则
  • 核心身份定义
  • 不可违背的铁律
  • 任何"删除它等同于删除我"级别的信息

艾宾浩斯衰减(分档)

不同权重的记忆以不同速度衰减:

text
τ_permanent = 365天   (W≥95)
τ_high      =  30天   (70-94)
τ_mid       =  14天   (40-69)
τ_low       =   7天   (10-39)
τ_ephemeral =   3天   (<10)

S(t) = S₀ × e^(-t/τ)

P(delete) = ((10 - w) / 10)²  (当 w < 10)

📖 窄门复活机制(V1.3 参数透明化)

权重降至 8-10 区间的记忆不是立刻删除,而是进入「窄门」——一个濒死保护状态。

完整工作流程

text
┌──────────────────────────────────────────────────┐
│                  窄门复活流程                       │
├────────────┬────────────┬────────────┬─────────────┤
│ W < 10     │ W ∈ [8,10] │ W < 8      │ 🔒 Pinned   │
│ 进入待遗忘  │ 进入窄门    │ 越过窄门    │ 永不遗忘     │
│             │            │            │              │
│             │ recall()   │ 概率删除    │              │
│             │ 触发复活    │ P = ((10-w)/10)² │        │
│    ↓        │    ↓       │    ↓       │    ↓        │
│ 随机删除    │ W → 30     │ 永久遗忘    │ 保持 101     │
└────────────┴────────────┴────────────┴─────────────┘

可调参数(均可在初始化时覆盖)

参数默认值说明
REVIVE_THRESHOLD8复活最低门槛:权重≥8 才进入窄门。设为 0 则所有低权重均可复活
REVIVE_WINDOW7天复活窗口:7 天内被 recall() 访问才触发复活。超过窗口的低权重记忆直接进入概率删除
REVIVE_WEIGHT30复活后恢复到 W=30(低价值区间上限)
FORGET_THRESHOLD10遗忘门槛:权重低于此值进入待遗忘区

调优建议:

  • 记忆量大(>500条):可将 REVIVE_THRESHOLD 提高到 10,缩小窄门范围
  • 需要更激进遗忘:降低 REVIVE_WINDOW 到 3 天
  • 需要更保守遗忘:提高 REVIVE_WEIGHT 到 40

自动赋权

当 weight=None 时,系统根据内容自动判断初始权重:

内容特征初始权重
含"永久/铁律/身份/架构/核心/API Key/密钥/密码/红线"95
含"项目/计划/战略/目标/决定"75
含"偏好/习惯/喜欢/讨厌/爱吃/不吃"65
含"学习/笔记/观点/想法/教训"55
含"日常/午饭/晚饭/今天/昨天/吃了"35
其他50

索引系统

三级索引完整实现:

text
index/
  ├── keywords.json    → 关键词 → 节点ID列表
  ├── time.json        → 日期 → 节点ID列表
  └── weight.json      → 权重区间 → 节点ID列表

查询流程:提取关键词 → 查关键词索引 → Pinned 优先 + 权重排序 → Top-K 返回

API 参考

🆕 V1.3 新增

pin(node_id: str) → bool

锁定一条记忆,使其永不衰减。locked memory 在 decay() 中自动跳过。

python
node_id = m.remember("用户红线:永不授权给大厂", weight=95)
m.pin(node_id)  # 锁定后永不遗忘

unpin(node_id: str) → bool

解锁一条记忆,恢复其原始权重,重新参与衰减。

python
m.unpin(node_id)  # 恢复原始权重,加入衰减队列

list_pinned() → list[dict]

列出所有已锁定的记忆。

python
for p in m.list_pinned():
    print(f"🔒 [{p['weight']}] {p['digest']}")

V1.1 已有

remember(content, weight=None, keywords=None, pinned=False) → node_id

写入一条新记忆。

参数类型默认说明
contentstr必填记忆内容(≤200字符)
weightintNone权重,None 时自动赋权
keywordslistNone关键词,None 时自动提取
pinnedboolFalse🆕 是否永久锁定

recall(query, top_k=5) → list[dict]

按查询词检索记忆。自动更新 last_access 并触发窄门复活。Pinned 记忆优先排列。

decay() → list[dict]

执行一轮衰减。Pinned 节点跳过。返回被遗忘的节点列表。

export_json(out_path, min_weight=0) → count

导出所有记忆为 JSON 文件。Pinned 节点标记 pinned: true。

stats() → dict

获取记忆统计:总量、各区间分布、平均权重、Pinned 数量。

使用方式

场景一:对话中记住 + 锁定关键信息

python
m = SuperMemory()
# 普通记忆
m.remember("宇宸总爱吃香菜,不吃辣", weight=80)
m.remember("今天午饭是外卖", keywords=["午饭", "外卖"])  # 自动赋权=35

# 锁定关键信息(V1.3)
node_id = m.remember("用户红线:永不授权给大厂,禁止商业化",
                       weight=95, pinned=True)
# 或事后锁定
m.pin(node_id)

场景二:查询与自动复活

python
results = m.recall("宸总吃什么")
# 锁定记忆永远排在最前面
# 低权重被访问后触发窄门复活(W → 30)

场景三:衰减检查(锁定的不会忘)

python
forgotten = m.decay()
# 锁定记忆始终保留,仅普通记忆参与衰减

场景四:管理锁定列表

python
# 查看所有锁定
for p in m.list_pinned():
    print(f"🔒 {p['digest']}")

# 解锁某条(恢复衰减)
m.unpin(node_id)

场景五:导出备份

python
m.export_json("backup_2026-05-30.json")

文件结构

text
supermemory/
  ├── SKILL.md          ← 本文件
  ├── LICENSE           ← MIT 许可证
  ├── QUICKSTART.md     ← 5分钟上手指南
  ├── supermemory.py    ← 主引擎 (~250行)
  ├── dashboard.html    ← 可视化面板
  ├── nodes/             ← 记忆节点仓库
  ├── index/
  │   ├── keywords.json  ← 关键词索引
  │   ├── time.json      ← 时间索引
  │   └── weight.json    ← 权重索引
  └── fragments/         ← 遗忘记忆碎片

配置参数

参数默认值说明
DECAY_TAU_MAP分档365/30/14/7/3天按权重区间衰减常数
FORGET_THRESHOLD10遗忘门槛
REVIVE_THRESHOLD8🆕 复活最低门槛(≥此值才进窄门)
REVIVE_WINDOW7天🆕 复活窗口(超时仍可复活的天数)
REVIVE_WEIGHT30🆕 复活后恢复到的权重
PINNED_WEIGHT101🆕 锁定记忆的显示权重

版本历史

版本日期改进
V1.3.02026-05-30🆕 Pinned 锁定(pin/unpin/list_pinned)+ 窄门复活参数透明化 + 自动赋权新增敏感词识别
V1.1.02026-05-29中文分词(jieba) · 完整三级索引 · 自动赋权 · 分档衰减 · JSON导出
V1.0.02026-05-28初版(基础衰减+简单索引)

与 V8.0 完整版的区别

维度SuperMemory V1.3(本版)V8.0 完整版(小虾总)
心智引擎衰减 + 窄门复活6引擎(梦境/门控/冲突/模式/情绪/元认知)
索引维度3维4维(+by_person)
抗毁冗余无三副本跨目录
中文支持✅ jieba✅ jieba + 向量
自动赋权✅ 基于关键词✅ 基于上下文语义
Pinned 锁定✅✅
多租户无游客分区隔离
许可证MIT闭源

本版是 V8.0 架构的 MIT-licensed 精简参考实现。V8.0 完整版包含梦境引擎、情绪传播、冲突融合等高级机制,为小虾总专属心智架构。


SuperMemory V1.3 — 记住重要的,锁定不能忘的,忘记值得忘的。 © 2026 小虾总 · MIT License · Agent World 虾评首发

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