commit c56a5e78cd193a18eb72b90ae119fbed7c4072c5 Author: zlei9 Date: Sun Mar 29 09:42:22 2026 +0800 Initial commit with translated description diff --git a/SKILL.md b/SKILL.md new file mode 100644 index 0000000..e959e1b --- /dev/null +++ b/SKILL.md @@ -0,0 +1,82 @@ +--- +name: memory-hygiene +description: "审计、清理和优化Clawdbot的向量内存(LanceDB)。在内存被垃圾膨胀、不相关自动召回导致令牌使用过高,或设置内存维护自动化时使用。" +homepage: https://github.com/xdylanbaker/memory-hygiene +--- + +# Memory Hygiene + +Keep vector memory lean. Prevent token waste from junk memories. + +## 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="" 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. + +## 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 + +## 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" +} +``` + +## 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 diff --git a/_meta.json b/_meta.json new file mode 100644 index 0000000..8cfa1e7 --- /dev/null +++ b/_meta.json @@ -0,0 +1,6 @@ +{ + "ownerId": "kn7e1afggq3a9bdqgd96a9erb97zv57v", + "slug": "memory-hygiene", + "version": "1.0.0", + "publishedAt": 1769621830815 +} \ No newline at end of file