memory-hygiene

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Memory Hygiene

内存维护

Keep vector memory lean. Prevent token waste from junk memories.
保持向量内存精简,避免无用内存造成Token浪费。

Quick Commands

快速命令

Audit: Check what's in memory
memory_recall query="*" limit=50
Wipe: Clear all vector memory
bash
rm -rf ~/.clawdbot/memory/lancedb/
Then restart gateway:
clawdbot gateway restart
Reseed: After wipe, store key facts from MEMORY.md
memory_store text="<fact>" category="preference|fact|decision" importance=0.9
审计: 查看内存中的内容
memory_recall query="*" limit=50
清理: 清除所有向量内存
bash
rm -rf ~/.clawdbot/memory/lancedb/
然后重启网关:
clawdbot gateway restart
重新植入: 清理完成后,将MEMORY.md中的关键事实存入内存
memory_store text="<fact>" category="preference|fact|decision" importance=0.9

Config: Disable Auto-Capture

配置:禁用自动捕获

The main source of junk is
autoCapture: true
. Disable it:
json
{
  "plugins": {
    "entries": {
      "memory-lancedb": {
        "config": {
          "autoCapture": false,
          "autoRecall": true
        }
      }
    }
  }
}
Use
gateway action=config.patch
to apply.
无用数据的主要来源是
autoCapture: true
,请将其禁用:
json
{
  "plugins": {
    "entries": {
      "memory-lancedb": {
        "config": {
          "autoCapture": false,
          "autoRecall": true
        }
      }
    }
  }
}
使用
gateway action=config.patch
命令应用配置。

What to Store (Intentionally)

应主动存储的内容

✅ Store:
  • User preferences (tools, workflows, communication style)
  • Key decisions (project choices, architecture)
  • Important facts (accounts, credentials locations, contacts)
  • Lessons learned
❌ Never store:
  • Heartbeat status ("HEARTBEAT_OK", "No new messages")
  • Transient info (current time, temp states)
  • Raw message logs (already in files)
  • OAuth URLs or tokens
✅ 建议存储:
  • 用户偏好(工具、工作流、沟通风格)
  • 关键决策(项目选择、架构)
  • 重要事实(账户、凭证位置、联系人)
  • 经验总结
❌ 禁止存储:
  • 心跳状态("HEARTBEAT_OK"、"无新消息")
  • 临时信息(当前时间、临时状态)
  • 原始消息日志(已存储在文件中)
  • OAuth链接或令牌

Monthly Maintenance Cron

每月定时维护

Set up a monthly wipe + reseed:
cron action=add job={
  "name": "memory-maintenance",
  "schedule": "0 4 1 * *",
  "text": "Monthly memory maintenance: 1) Wipe ~/.clawdbot/memory/lancedb/ 2) Parse MEMORY.md 3) Store key facts to fresh LanceDB 4) Report completion"
}
设置每月清理并重新植入内存的任务:
cron action=add job={
  "name": "memory-maintenance",
  "schedule": "0 4 1 * *",
  "text": "Monthly memory maintenance: 1) Wipe ~/.clawdbot/memory/lancedb/ 2) Parse MEMORY.md 3) Store key facts to fresh LanceDB 4) Report completion"
}

Storage Guidelines

存储指南

When using memory_store:
  • Keep text concise (<100 words)
  • Use appropriate category
  • Set importance 0.7-1.0 for valuable info
  • One concept per memory entry
使用memory_store时:
  • 文本保持简洁(少于100词)
  • 使用合适的分类
  • 对有价值的信息设置0.7-1.0的重要性分值
  • 每条内存记录对应一个概念