返回顶部
m

memory-system-v2语义记忆系统

Fast semantic memory system with JSON indexing, auto-consolidation, and <20ms search. Capture learnings, decisions, insights, events. Use when you need persistent memory across sessions or want to recall prior work/decisions.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
4,694
下载量
免费
免费
12
收藏
概述
安装方式
版本历史

memory-system-v2

记忆系统 v2.0

面向AI代理的快速语义记忆系统,支持JSON索引和低于20毫秒的搜索。

概述

记忆系统 v2.0 是一个轻量级、基于文件的记忆系统,专为需要以下功能的AI代理设计:

  • - 跨会话记住学习内容、决策、洞见、事件和交互
  • 在20毫秒内进行语义记忆搜索
  • 自动将每日记忆整合为每周摘要
  • 追踪重要性和上下文以实现更好的回忆

采用纯bash + jq构建,无需数据库。

功能特性

  • - ⚡ 快速搜索: 平均搜索时间低于20毫秒(36项测试通过)
  • 🧠 语义记忆: 捕获5种记忆类型(学习、决策、洞见、事件、交互)
  • 📊 重要性评分: 1-10级记忆优先级排序
  • 🏷️ 标签系统: 使用标签组织记忆
  • 📝 上下文追踪: 记住创建记忆时的活动内容
  • 📅 自动整合: 自动生成每周摘要
  • 🔍 智能搜索: 支持多词搜索和重要性加权
  • 📈 统计与分析: 追踪记忆数量、类型、重要性分布

快速开始

安装

bash

安装jq(必需依赖)


brew install jq

将memory-cli.sh复制到工作目录

如果您正在使用Clawdbot,则已安装

基本用法

捕获记忆:
bash
./memory/memory-cli.sh capture \
--type learning \
--importance 9 \
--content 学会了如何使用SwiftUI构建iOS应用 \
--tags swift,ios,mobile \
--context 正在构建Life Game应用

搜索记忆:
bash
./memory/memory-cli.sh search swiftui ios
./memory/memory-cli.sh search 构建应用 --min-importance 7

最近记忆:
bash
./memory/memory-cli.sh recent learning 7 10
./memory/memory-cli.sh recent all 1 5

查看统计:
bash
./memory/memory-cli.sh stats

自动整合:
bash
./memory/memory-cli.sh consolidate

记忆类型

1. 学习(重要性:7-9)

新掌握的技能、工具、模式、技术。

示例:
bash
./memory/memory-cli.sh capture \
--type learning \
--importance 9 \
--content 学习了Tron Ares美学:黑色背景上超薄1px红色电路轨迹 \
--tags design,tron,aesthetic

2. 决策(重要性:6-9)

做出的选择、采用的策略、采取的方法。

示例:
bash
./memory/memory-cli.sh capture \
--type decision \
--importance 8 \
--content 从经验值刷取切换为基于成就的里程碑式升级 \
--tags life-game,game-design,leveling

3. 洞见(重要性:8-10)

突破性发现、领悟、顿悟时刻。

示例:
bash
./memory/memory-cli.sh capture \
--type insight \
--importance 10 \
--content 简单的二元是/否追踪优于复杂的详细日志记录 \
--tags ux,simplicity,habit-tracking

4. 事件(重要性:5-8)

里程碑、完成事项、发布、重要事件。

示例:
bash
./memory/memory-cli.sh capture \
--type event \
--importance 10 \
--content 在2小时内发布了采用Tron Ares美学的Life Game iOS应用 \
--tags shipped,life-game,milestone

5. 交互(重要性:5-7)

关键对话、反馈、用户请求。

示例:
bash
./memory/memory-cli.sh capture \
--type interaction \
--importance 7 \
--content 用户请求简单的二元是/否习惯追踪,而非复杂的任务系统 \
--tags feedback,user-request,simplification

架构

文件结构

memory/
├── memory-cli.sh # 主CLI工具
├── index/
│ └── memory-index.json # 快速搜索索引
├── daily/
│ └── YYYY-MM-DD.md # 每日记忆日志
└── consolidated/
└── YYYY-WW.md # 每周整合摘要

JSON索引格式

json
{
version: 1,
lastUpdate: 1738368000000,
memories: [
{
id: mem2026013112345,
type: learning,
importance: 9,
timestamp: 1738368000000,
date: 2026-01-31,
content: 记忆内容,
tags: [tag1, tag2],
context: 当时正在做的事情,
file: memory/daily/2026-01-31.md,
line: 42
}
]
}

性能基准

全部36项测试通过:

  • - 搜索:平均低于20毫秒(最快:8毫秒,最慢:18毫秒)
  • 捕获:平均低于50毫秒
  • 统计:低于10毫秒
  • 最近:低于15毫秒
  • 所有操作:目标低于100毫秒 ✅

命令参考

capture

bash ./memory-cli.sh capture \ --type \ --importance <1-10> \ --content 记忆内容 \ --tags tag1,tag2,tag3 \ --context 当时正在做的事情

search

bash ./memory-cli.sh search 关键词 [--min-importance N]

recent

bash ./memory-cli.sh recent

stats

bash ./memory-cli.sh stats

consolidate

bash ./memory-cli.sh consolidate [--week YYYY-WW]

与Clawdbot集成

记忆系统 v2.0 设计为与Clawdbot无缝协作:

在AGENTS.md中自动捕获:
markdown

记忆召回


在回答任何关于先前工作、决策、日期、人员、偏好或待办事项的问题之前:对MEMORY.md + memory/*.md运行memory_search

示例工作流程:

  1. 1. 代理学习新内容 → memory-cli.sh capture
  2. 用户询问我们昨天构建了什么? → memory-cli.sh search 昨天构建
  3. 代理通过文件+行号引用回忆确切细节

使用场景

1. 学习追踪

捕获每项新技能、工具或技术: bash ./memory-cli.sh capture \ --type learning \ --importance 8 \ --content 学会了如何使用clawdhub publish发布ClawdHub包 \ --tags clawdhub,publishing,packaging

2. 决策历史

记录做出特定选择的原因: bash ./memory-cli.sh capture \ --type decision \ --importance 9 \ --content 为简化起见,选择二元是/否追踪而非复杂的RPG任务系统 \ --tags ux,simplicity,design-decision

3. 里程碑追踪

记录重大成就: bash ./memory-cli.sh capture \ --type event \ --importance 10 \ --content 完成记忆系统v2.0:36/36测试通过,搜索低于20毫秒 \ --tags milestone,memory-system,shipped

4. 每周回顾

自动生成每周摘要: bash ./memory-cli.sh consolidate --week 2026-05

高级用法

带重要性过滤的搜索

bash

仅高重要性学习内容

./memory-cli.sh search swiftui --min-importance 8

所有提及API的记忆

./memory-cli.sh search API --min-importance 1

最近高优先级决策

bash

过去7天内重要性≥8的决策

./memory-cli.sh recent decision 7 8

批量分析

bash

查看记忆分布

./memory-cli.sh stats

输出:

总记忆数:247

按类型:学习=89, 决策=67, 洞见=42, 事件=35, 交互=14

按重要性:10=45, 9=78, 8=63, 7=39, 6=15, 5=7

局限性

-

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 memory-system-v2-1776373620 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 memory-system-v2-1776373620 技能

通过命令行安装

skillhub install memory-system-v2-1776373620

下载

⬇ 下载 memory-system-v2 v1.0.0(免费)

文件大小: 12.19 KB | 发布时间: 2026-4-17 16:09

v1.0.0 最新 2026-4-17 16:09
- Initial release of memory-system-v2, a fast semantic memory system for AI agents.
- Provides sub-20ms semantic search, JSON indexing, and auto-consolidation of daily memories into weekly summaries.
- Supports capturing learnings, decisions, insights, events, and interactions with context, tagging, and importance scoring.
- Built in pure bash + jq; no database required.
- Includes stats, analytics, and a CLI for capturing, searching, consolidating, and reviewing memories.
- Designed for persistent memory across sessions; integrates with Clawdbot.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部