SuperAPI AI Directory

memory-management

Agents & models

View repository

Updated 10-16 09:14

About this skill

Memory Management

Q1/Q2/Q3 Decision Flow

Every time you need to record information, ask yourself three questions:

Q1: 下次醒来不看这条,会做错事吗?
    → Yes: MEMORY.md [P0]

Q2: 某天可能需要查这条吗?
    → Yes: memory/archive/ [P1]

Q3: 以上都不是?
    → 留在 daily log,不处理

Corresponding Priority Tag

Decision Priority TTL Location
Q1=Yes [P0] Never expires MEMORY.md
Q2=Yes [P1][YYYY-MM-DD] 90 days MEMORY.md → archive
Q3 [P2][YYYY-MM-DD] 30 days MEMORY.md → archive

Examples

Information Q1 Q2 Destination
"The user's timezone is US Eastern" ✅ - MEMORY.md [P0]
"Bought the wrong direction on February 8" ❌ ✅ archive [P1]
"Ran a scan today" ❌ ❌ daily log

Hard Limits

MEMORY.md ≤ 150 行 — 硬约束,不是建议
AGENTS.md ≤ 200 行 — 同样是硬约束

If exceeded, it must be trimmed down. No exceptions.

Common Misconceptions

❌ Hot Memory Misconceptions (MEMORY.md)

Writing project details into hot memory

例: "项目X客户叫王总,电话138-xxxx"
问题: 项目结束后这条就没用了

Writing daily tasks into hot memory

例: "今天要写完xxx功能"
问题: 一次性的,不该沉淀

Cramming all lessons into hot memory

例: "今天学到了xxx"
问题: 不是每条都值得,等复盘再决定

Writing the debugging process into hot memory

例: "试了A方案不行,换B方案"
问题: 这是过程,不是结论

❌ Cold Memory Misconceptions (archive)

Never looking it up after archiving

问题: 归档是为了能查到,不查就没意义
解决: 用 memory_search 召回

Titles written unclearly

❌ "2026-02.md"
✅ "2026-02 交易教训和决策"

❌ Log Misconceptions (daily log)

Deleting the log on the same day

问题: 日志是保命用的,出问题要回放

Writing the log too detailed (an essay)

❌ "今天下午2:15分,我和技术顾问讨论了..."
✅ 记关键点就行,不是写日记

Automation Tools

memory-janitor.py

Runs automatically every day at 4 AM UTC:

  • Check the TTL of P1/P2 entries
  • Expired entries → move to archive
  • Warn about untagged entries
# 手动运行
python3 memory-janitor.py

# 检查状态
python3 memory-janitor.py --dry-run

Write-in Checklist

Before writing to MEMORY.md each time:

□ 跑过 Q1/Q2/Q3 判断
□ 打了 Priority 标签
□ 检查当前行数 (wc -l MEMORY.md)
□ 不是项目细节/每日任务/调试过程