Memory Ebbinghaus
Ebbinghaus forgetting curve-based memory lifecycle manager. Tracks memory items with strength decay, review reinforcement, and archiving.
Setup
First run — initialize the database:
CODEBLOCK0
To use a custom path:
CODEBLOCK1
Environment variables:
| Variable | Default | Description |
|---|
| INLINECODE0 | INLINECODE1 | Path to the JSON database |
| INLINECODE2 |
./MEMORY.md | File to append archived memories |
Core Concept
Strength formula: strength = e^(-days_elapsed / stability)
| Status | Strength | Meaning |
|---|
| 🟢 Active | ≥ 0.7 | Recently used, clear memory |
| 🟡 Decaying |
0.3–0.7 | Not used for a while |
| 🔴 Fading | < 0.3 | Needs review or cleanup |
Stability: starts at 1.0, multiplied by 1.5 on each review (the more you review, the slower it fades).
Commands
CODEBLOCK2
Heartbeat Integration
Add to your heartbeat config:
CODEBLOCK3
Heartbeat output rules:
- - 🔴 items exist → alert user, ask "review or forget?"
- Only 🟡 items → log silently, no interruption
- All 🟢 → output INLINECODE5
Categories
| category | Meaning |
|---|
| INLINECODE6 | Project/task completion |
| INLINECODE7 |
Technical findings/solutions |
|
person | Memory about someone |
|
event | Important events |
|
general | Other |
Typical Workflows
"Clean up old memories":
- 1. Run
decay then INLINECODE12 - List 🔴 items, ask user: review / forget / archive?
- Execute chosen action
"Remember this: XXX":
- 1. Run INLINECODE13
- Confirm added
"Which memories are fading?":
- 1. Run
decay to update strengths - Run
status, highlight 🔴 items
记忆艾宾浩斯
基于艾宾浩斯遗忘曲线的记忆生命周期管理器。通过强度衰减、复习强化和归档来追踪记忆项目。
设置
首次运行——初始化数据库:
bash
python3 scripts/ebbinghaus.py status
如果未找到,会在当前目录自动创建 memory_db.json
使用自定义路径:
bash
EBBINGHAUSDB=/path/to/memorydb.json \
EBBINGHAUS_ARCHIVE=/path/to/MEMORY.md \
python3 scripts/ebbinghaus.py status
环境变量:
| 变量 | 默认值 | 描述 |
|---|
| EBBINGHAUSDB | ./memorydb.json | JSON数据库的路径 |
| EBBINGHAUS_ARCHIVE |
./MEMORY.md | 追加归档记忆的文件 |
核心概念
强度公式:strength = e^(-days_elapsed / stability)
| 状态 | 强度 | 含义 |
|---|
| 🟢 活跃 | ≥ 0.7 | 近期使用,记忆清晰 |
| 🟡 衰减中 |
0.3–0.7 | 有一段时间未使用 |
| 🔴 消退中 | < 0.3 | 需要复习或清理 |
稳定性:初始值为1.0,每次复习乘以1.5(复习越多,遗忘越慢)。
命令
bash
查看所有记忆项目及其当前强度
python3 scripts/ebbinghaus.py status
重新计算所有强度值(每日运行)
python3 scripts/ebbinghaus.py decay
添加新的记忆项目
python3 scripts/ebbinghaus.py add 内容描述 --category <类别> --source <来源>
复习并强化(强度重置为1.0,稳定性×1.5)
python3 scripts/ebbinghaus.py review
删除记忆项目
python3 scripts/ebbinghaus.py forget
归档到MEMORY.md(从活跃列表中移除,追加到归档文件)
python3 scripts/ebbinghaus.py archive
心跳模式——打印需要关注的项目
python3 scripts/ebbinghaus.py heartbeat
心跳集成
添加到你的心跳配置中:
- - 记忆衰减检查:python3 /path/to/scripts/ebbinghaus.py heartbeat
心跳输出规则:
- - 存在🔴项目 → 提醒用户,询问复习还是遗忘?
- 仅有🟡项目 → 静默记录,不中断
- 全部🟢 → 输出HEARTBEAT_OK
类别
技术发现/解决方案 |
| person | 关于某人的记忆 |
| event | 重要事件 |
| general | 其他 |
典型工作流程
清理旧记忆:
- 1. 运行decay然后status
- 列出🔴项目,询问用户:复习/遗忘/归档?
- 执行所选操作
记住这个:XXX:
- 1. 运行add XXX
- 确认已添加
哪些记忆正在消退?:
- 1. 运行decay更新强度
- 运行status,高亮显示🔴项目