Skip to content

Commit 2fb94d0

Browse files
committed
docs: update README with xMemory 4-layer architecture
- Update tagline to 'xMemory 四层记忆架构' - Add L3 Theme layer to architecture diagrams - Document new CLI options: --level theme, --no-expand - Add /mem themes command to Agent commands - Update Done section with v1.6 xMemory features - Add xMemory retrieval flow diagram - Sync changes to README_EN.md
1 parent 58bc1e9 commit 2fb94d0

2 files changed

Lines changed: 81 additions & 16 deletions

File tree

README.md

Lines changed: 74 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</p>
44

55
<p align="center">
6-
<strong>双层记忆架构 · 智能分类 · 自动提取 · 多 IDE 支持</strong>
6+
<strong>xMemory 四层记忆架构 · 智能分类 · 自动提取 · 多 IDE 支持</strong>
77
</p>
88

99
<p align="center">
@@ -43,7 +43,12 @@
4343
>
4444
> **OpenMemory Plus 让所有 AI Agent 共享同一份记忆。**
4545
46-
**OpenMemory Plus** 是一个为 AI Agent 设计的统一记忆管理框架,整合项目级 (`_omp/memory/`) 和用户级 (`openmemory` MCP) 双层记忆系统。
46+
**OpenMemory Plus** 是一个为 AI Agent 设计的统一记忆管理框架,采用 **xMemory 四层记忆架构**
47+
48+
- **L3 Theme** — 主题聚类层,自动归纳高层概念
49+
- **L2 Semantic** — 语义记忆层,基于 BGE-M3 向量检索
50+
- **L1 Episode** — 情节记忆层,保存对话上下文
51+
- **L0 Message** — 原始消息层
4752

4853
```bash
4954
# 5 分钟安装,终结 AI 失忆症
@@ -367,11 +372,12 @@ omp deps down # 停止服务
367372

368373
### 核心能力
369374

370-
- 🔄 **双层记忆架构**项目级 + 用户级分离存储,各司其职
375+
- 🧠 **xMemory 四层架构**L3 Theme → L2 Semantic → L1 Episode → L0 Message
371376
- 🎯 **智能分类** — 自动判断信息应存储在项目还是用户记忆
372-
- 🔍 **语义搜索** — 基于 BGE-M3 的多语言向量检索
377+
- 🔍 **语义搜索** — 基于 BGE-M3 的多语言向量检索 + 主题层聚类
373378
-**事件驱动提取** — 对话结束时自动触发记忆提取 Skill
374379
- 🔐 **敏感信息过滤** — 自动识别并阻止存储 API Key、密码等
380+
- 🎯 **Top-down 检索** — 从主题层开始,自适应展开到语义层
375381

376382
### 🤖 多 LLM 支持 <sup>NEW</sup>
377383

@@ -407,6 +413,39 @@ omp deps down # 停止服务
407413

408414
## 🏗️ 架构
409415

416+
### xMemory 四层记忆架构
417+
418+
```
419+
┌─────────────────────────────────────────────────────────────┐
420+
│ xMemory 4-Layer Architecture │
421+
├─────────────────────────────────────────────────────────────┤
422+
│ │
423+
│ ┌─────────────────────────────────────────────────────┐ │
424+
│ │ L3 Theme (主题层) │ │
425+
│ │ ├── 自动聚类相似语义记忆 │ │
426+
│ │ ├── 主题吸附 (attachThreshold: 0.62) │ │
427+
│ │ ├── 主题分裂 (maxThemeSize: 12) │ │
428+
│ │ └── 主题合并 (mergeThreshold: 0.78) │ │
429+
│ └─────────────────────────────────────────────────────┘ │
430+
│ ↑ │
431+
│ ┌─────────────────────────────────────────────────────┐ │
432+
│ │ L2 Semantic (语义层) - Qdrant 向量数据库 │ │
433+
│ │ └── BGE-M3 多语言 Embedding │ │
434+
│ └─────────────────────────────────────────────────────┘ │
435+
│ ↑ │
436+
│ ┌─────────────────────────────────────────────────────┐ │
437+
│ │ L1 Episode (情节层) - 对话上下文 │ │
438+
│ └─────────────────────────────────────────────────────┘ │
439+
│ ↑ │
440+
│ ┌─────────────────────────────────────────────────────┐ │
441+
│ │ L0 Message (消息层) - 原始对话 │ │
442+
│ └─────────────────────────────────────────────────────┘ │
443+
│ │
444+
└─────────────────────────────────────────────────────────────┘
445+
```
446+
447+
### 存储分层
448+
410449
```
411450
┌─────────────────────────────────────────────────────────────┐
412451
│ OpenMemory Plus │
@@ -428,8 +467,9 @@ omp deps down # 停止服务
428467
│ │ _omp/memory/ │ │ openmemory │ │
429468
│ │ (项目级) │ │ (用户级) │ │
430469
│ ├─────────────────┤ ├─────────────────┤ │
431-
│ │ • project.yaml │ │ • 向量数据库 │ │
432-
│ │ • decisions.yaml│ │ • 语义搜索 │ │
470+
│ │ • project.yaml │ │ • L3 主题层 │ │
471+
│ │ • decisions.yaml│ │ • L2 语义层 │ │
472+
│ │ • themes/ │ │ • L1 情节层 │ │
433473
│ │ • Git 版本控制 │ │ • MCP 协议 │ │
434474
│ └─────────────────┘ └─────────────────┘ │
435475
│ │
@@ -438,12 +478,21 @@ omp deps down # 停止服务
438478

439479
### 分类规则
440480

441-
| 信息类型 | 存储位置 | 示例 |
442-
|----------|----------|------|
443-
| 项目配置 | `_omp/memory/*.md` | 部署 URL、环境变量、路径 |
444-
| 技术决策 | `_omp/memory/techContext.md` | 框架选择、架构设计 |
445-
| 用户偏好 | `openmemory` (MCP) | 语言偏好、代码风格 |
446-
| 用户技能 | `openmemory` (MCP) | 熟悉的技术栈、经验 |
481+
| 信息类型 | 存储位置 | 层级 | 示例 |
482+
|----------|----------|------|------|
483+
| 项目配置 | `_omp/memory/*.md` | - | 部署 URL、环境变量、路径 |
484+
| 技术决策 | `_omp/memory/techContext.md` | - | 框架选择、架构设计 |
485+
| 主题聚类 | `_omp/memory/themes/` | L3 | 自动生成的主题索引 |
486+
| 用户偏好 | `openmemory` (MCP) | L2 | 语言偏好、代码风格 |
487+
| 用户技能 | `openmemory` (MCP) | L2 | 熟悉的技术栈、经验 |
488+
489+
### xMemory 检索流程
490+
491+
```
492+
查询输入 → L3 主题层匹配 → 分数 > 0.75? → 展开到 L2 语义层 → 返回结果
493+
↓ ↓
494+
KNN 邻居搜索 直接返回主题
495+
```
447496

448497
> 💡 **注意**: 安装后,项目级记忆存储在 `_omp/memory/` 目录下,该目录会被添加到 Git 版本控制。
449498
@@ -562,12 +611,15 @@ npx openmemory-plus doctor --fix
562611
|------|------|
563612
| `/memory` | 显示快速状态 + 子命令菜单 |
564613
| `/mem status` | 详细记忆状态 |
565-
| `/mem search {query}` | 语义搜索记忆 |
614+
| `/mem search {query}` | 语义搜索记忆 (默认 L2 语义层) |
615+
| `/mem search {query} --level theme` | 🆕 主题层搜索 (L3) |
616+
| `/mem search {query} --level theme --no-expand` | 🆕 仅主题层,不展开 |
566617
| `/mem store` | 手动存储记忆 |
567618
| `/mem sync` | 检测并解决冲突 |
568619
| `/mem clean` | 清理 ROT 记忆 |
569620
| `/mem decay` | 时间衰减分析 |
570621
| `/mem graph` | 知识图谱可视化 |
622+
| `/mem themes` | 🆕 查看主题聚类状态 |
571623

572624
---
573625

@@ -822,11 +874,19 @@ npx openmemory-plus install
822874

823875
👉 **[查看完整 Roadmap Issues](https://github.com/Alenryuichi/openmemory-plus/issues?q=is%3Aissue+is%3Aopen+label%3A%22roadmap%3A+now%22%2C%22roadmap%3A+next%22%2C%22roadmap%3A+later%22)**
824876

825-
### ✅ Done (v1.5)
877+
### ✅ Done (v1.6)
826878

827879
<details>
828880
<summary>已完成功能</summary>
829881

882+
**v1.6 - xMemory 四层架构**
883+
- [x] 🧠 xMemory 四层架构 (L3 Theme → L2 Semantic → L1 Episode → L0 Message)
884+
- [x] 🎯 L3 主题层自动聚类 (吸附/分裂/合并算法)
885+
- [x] 🔍 Top-down 自适应检索 (`--level theme`)
886+
- [x] ⚡ 主题搜索 CLI 选项 (`--no-expand`)
887+
- [x] 📊 连通分量聚类算法 (xMemory 论文实现)
888+
889+
**v1.5 - 基础功能**
830890
- [x] 双层记忆架构 (项目级 + 用户级)
831891
- [x] 智能分类路由
832892
- [x] 多 IDE 支持 (Augment, Claude, Cursor, Gemini)

README_EN.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</p>
44

55
<p align="center">
6-
<strong>Dual-Layer Memory · Smart Classification · Auto-Extraction · Multi-IDE Support</strong>
6+
<strong>xMemory 4-Layer Architecture · Smart Classification · Auto-Extraction · Multi-IDE Support</strong>
77
</p>
88

99
<p align="center">
@@ -37,7 +37,12 @@
3737

3838
## 🎯 Introduction
3939

40-
**OpenMemory Plus** is a unified memory management framework for AI Agents, integrating project-level (`_omp/memory/`) and user-level (`openmemory` MCP) dual-layer memory systems.
40+
**OpenMemory Plus** is a unified memory management framework for AI Agents, featuring **xMemory 4-Layer Architecture**:
41+
42+
- **L3 Theme** — Theme clustering layer, auto-aggregates high-level concepts
43+
- **L2 Semantic** — Semantic memory layer, BGE-M3 vector retrieval
44+
- **L1 Episode** — Episodic memory layer, conversation context
45+
- **L0 Message** — Raw message layer
4146

4247
> **Give any AI Agent persistent memory in 5 minutes.**
4348

0 commit comments

Comments
 (0)