Files
myWiki/concepts/prospective-memory-index.md

96 lines
3.9 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: "Prospective Memory Index (前瞻记忆索引)"
created: 2026-06-25
updated: 2026-06-25
type: concept
tags: ["agent-memory", "prospective-memory", "architecture", "index-design"]
sources:
- "[[agent-memory-five-category-model]]"
---
# Prospective Memory Index (前瞻记忆索引)
Prospective Memory Index 是 sz 提出的五类 Agent 记忆模型中的第五类承载索引,专门处理"计划/想法/关键洞察/遗留问题"这类具有随机性被提取特征的记忆。
## 认知心理学的对应
前瞻记忆prospective memory记住在未来特定情境下执行某个意图。与回顾记忆retrospective memory的"过去发生了什么"相对。
Agent 中的对应:用户说过的计划、想法、未闭合的思路——在后期交流中,根据实际场景被 Agent 机会性提取并加入上下文。
## 与传统三索引的差异
| 维度 | Prospective | Semantic | Episodic |
|------|------------|----------|----------|
| **存储内容** | 计划/想法/开放问题/关键洞察 | 稳定用户事实 | 原始交互日志 |
| **衰减驱动力** | **关联匹配度**(非时间、非频率) | last_used_at + use_count | timestamp |
| **衰减曲线** | 极平坦——不应因时间沉底 | Gauss保守 1825d | Gauss可收紧 |
| **召回触发** | 上下文语义关联(机会性) | 用户显式/隐式请求 | 时间范围查询 |
| **写入时机** | 对话中 LLM 标记重要性 | Consolidation 时 | 每回合自动 |
| **更新模式** | 完成→移出,更新→保留,过期→归档 | Supersession 链 | 只写不改 |
## 衰减设计:关联匹配度而非时间
核心设计决策prospective 索引的 decay function **不碰 timestamp**
- 一个想法被提及距今 90 天 ← 不是衰减信号
- 这个想法与当前查询的语义相似度 0.2 ← 这才是
检索时只用 relevance score 做排序信号。时间做软倾斜:同一相关度下,更新的想法排在前面。
## 写入LLM 重要性分类器
在对话进行中由 LLM 标注(非批处理 consolidation
```
用户说 → LLM 分类器检测 → 判定为 prospective 记忆
写入索引:{content, type, context, timestamp, status: "open"}
```
### 五种记忆类型
| 类型 | 说明 | 例子 |
|------|------|------|
| **plan** | 计划 | "下周想试一下 GRPO 训练" |
| **idea** | 想法/直觉 | "bandit 可能比 MCP-Zero 的启发式更好" |
| **decision** | 关键决策点 | "从今天起用 PostgreSQL" |
| **question** | 开放问题 | "衰减曲线的领域特异性到底怎么量化?" |
| **insight** | 关键洞察 | "认知负荷才是 Agent 瓶颈,不是模型能力" |
## 闭合状态管理
```
open → referenced (被再次提及) → closed (计划完成)
→ stale (超过 N 天未被提及,归档)
```
类似 [[soft-supersession]]——旧记录不删除,检索时默认过滤已闭合的,除非显式查询。
## 与 Semantic 的双向流动
```
prospective (idea) ——被多次确认→ semantic (fact)
semantic (decision) ——被推翻→ prospective (reconsideration) + supersession
```
反复出现的 idea "毕业"为 semantic被推翻的 semantic 降级回 prospective 等待重新确认。
## 检索策略
Prospective 索引**不参与 BM25 的词法腿**——"我之前说想做一个诗词推荐系统",三个月后的查询是"今天早上推什么诗"BM25 完全匹配不到。只走 dense 语义检索key 不需要展开query 不需要精确,全交给语义匹配。
```
recall_memory(query)
→ 并行查四个索引epi/sem/proc/prosp
→ RRF 融合
→ prospective 的 rank 不由 RRF 决定——由 cross-encoder 的 relevance score 主导
```
## 参考
- [[agent-memory-five-category-model]]
- [[atlas-memory-system]]
- [[agent-memory-taxonomy]]
- [[soft-supersession]]
- [[long-term-interactive-memory]]