llm-wiki wiki · concepts 2026-05-14

德国心理学家 Hermann Ebbinghaus(1885)通过自身实验得出的记忆衰减经验曲线。在 LLM agent 记忆框架里被改造为 三层记忆 + 数学衰减 + 强化反馈 的算法基座,powermem 是当前最完整的工程实现。

数学模型

R = e^(-t/S)

衰减是 指数式 的:刚记完忘得快,多次复习后衰减率降低 —— 这正是间隔重复(spaced repetition)的理论根基。

工程映射:三层记忆 + 三阈值

PowerMem 在 intelligence/ebbinghaus_algorithm.py 里把曲线参数化(默认值):

参数 默认值 含义
initial_retention 1.0 新记忆的初始强度(按 LLM 评出的 importance_score 缩放)
decay_rate 0.1 基础衰减率
reinforcement_factor 0.3 命中检索时强度增量
working_threshold 0.3 < 该值 → 工作记忆
short_term_threshold 0.6 0.3–0.6 → 短期记忆
long_term_threshold 0.8 > 0.6 → 长期记忆;> 0.8 → 永久存储
review_intervals [1, 6, 24, 72, 168] 小时 复习时间表(1h / 6h / 1d / 3d / 1w)

完整生命周期(PowerMem 实现)

        New Information
              ↓
      Importance Evaluation (LLM, 0.0~1.0)
              ↓
   initial_retention = 1.0 * importance_score
              ↓
   ┌────────┴─────────────┐
   ↓                       ↓
 working (<0.3)         short-term (0.3~0.6)
   ↓                       ↓
   "Forgetting Decay"   "Reinforcement Learning"
   ↓                       ↓
   importance↓             importance↑
   ↓                       ↓
   Auto Cleanup            long-term (>0.6)
                             ↓
                           Permanent Storage (>0.8)
                             ↓
                           Knowledge Base

为什么这套机制重要

同类实现对照

框架 记忆衰减机制 三层抽象 数学模型暴露
powermem Ebbinghaus R=e^(-t/S) working / short / long ✅ 4 参数 + 3 阈值全可配
claude-mem 时间衰减 + 重要性评分 implicit 半透明
Letta (MemGPT) 上下文窗口管理 + archival core / archival 二层 由 LLM agent 自驱
MemoryOS 类生物记忆系统 sensory / short / long 学术原型