Files
myWiki/concepts/memory-dedup-pipeline.md

62 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "记忆去重管线"
created: 2026-06-19
updated: 2026-06-19
type: concept
tags: [agent-memory, deduplication, pipeline, memos]
sources:
- https://mp.weixin.qq.com/s/5Wo91nzstNtCIV9chnuQmw
---
# 记忆去重管线Memory Dedup Pipeline
## 定义
MemOS 的三级去重漏斗——用于在记忆组织阶段消除冗余、合并矛盾、压缩记忆存储。平均压缩比达到 **75%+**
## 三级漏斗
```
原始记忆
① SHA-256 精确去重 ← 完全相同 → 直接丢弃
② 向量余弦相似度 ← 高度相似 → 标记候选合并
③ LLM Judge 矛盾检测与合并 ← 语义判断 → 智能合并或保留
去重后记忆(压缩比 75%+
```
### 第一级SHA-256 精确去重
- 逐字节比对,完全相同的记忆直接丢弃
- 成本极低,速度最快
### 第二级:向量余弦相似度
- 将记忆文本映射到嵌入空间
- 高相似度(但非完全相同)的记忆标记为候选合并
- 阈值可配置
### 第三级LLM Judge 矛盾检测与智能合并
- 对候选合并项进行语义级别判断
- 检测矛盾——两条看似相似的记忆是否实际冲突?
- 智能合并——保留互补信息,去除冗余
- 这是最昂贵但最关键的一级
## 关键效果
接入 MemOS 后:
- 单次上下文成本 **-30%+**
- 交互轮次 **-50%+**
- 最终 token 消耗降低近 **50%**
## 参考
- [[agent-memory-lifecycle|记忆生命周期]]
- [[agent-memory-system|Agent 记忆系统]]
- [[memtensor-memos-agent-memory-2026|MemOS 技术分享]]