domains / agent-tooling / memory-hygiene / memory-hygiene

memory-hygiene

Skill card

combined

The two copies describe different memory-hygiene procedures for different systems. The first is a trust sweep of persistent notes that re-verifies environment-dependent claims, stamps last_verified/confidence, and proposes archiving drifted entries. The second is a vector-memory (LanceDB) maintenance workflow that audits, wipes, reseeds, disables auto-capture, and schedules monthly maintenance. They overlap only in the high-level idea of keeping memory clean, but each contains material steps and constraints the other lacks, so crowning one would hide a real alternative.

Repositories

RepositoryPath
huytieu/COG-second-brain.agents/skills/memory-hygiene/SKILL.md
LeoYeAI/openclaw-master-skillsskills/memory-hygiene/SKILL.md

Other copies

RoleRepositoryPath
peerhuytieu/COG-second-brain.agents/skills/memory-hygiene/SKILL.md
peerLeoYeAI/openclaw-master-skillsskills/memory-hygiene/SKILL.md
adapterhuytieu/COG-second-brain.claude/skills/memory-hygiene/SKILL.md
adapterhuytieu/COG-second-brainskills/memory-hygiene/SKILL.md

Combined skill

---
name: memory-hygiene
description: Perform memory hygiene for either persistent knowledge notes or vector memory (LanceDB), depending on the target system.
---

# Memory Hygiene

Choose the workflow that matches the memory system in use.

## Workflow A: Persistent Knowledge Notes (COG second-brain)

1. Read `.claude/skills/memory-hygiene/SKILL.md` and execute it exactly as written; that file is the authoritative playbook.
2. Follow `.agents/rules/cog.md`.
3. Where the playbook delegates to a `.claude/agents/<name>` worker, invoke `.agents/agents/<name>.md` via `invoke_subagent` instead.
4. Re-verify environment-dependent claims against the live environment.
5. Stamp each verified entry with `last_verified` and a confidence value.
6. Propose archiving entries that have drifted from the live environment.

## Workflow B: Vector Memory (Clawdbot / LanceDB)

1. Audit current memory:
   ```
   memory_recall query="*" limit=50
   ```
2. If memory is bloated, wipe it:
   ```bash
   rm -rf ~/.clawdbot/memory/lancedb/
   ```
   Then restart the gateway:
   ```
   clawdbot gateway restart
   ```
3. Reseed key facts from MEMORY.md:
   ```
   memory_store text="<fact>" category="preference|fact|decision" importance=0.9
   ```
4. Disable auto-capture to prevent future junk:
   ```json
   {
     "plugins": {
       "entries": {
         "memory-lancedb": {
           "config": {
             "autoCapture": false,
             "autoRecall": true
           }
         }
       }
     }
   }
   ```
   Apply with `gateway action=config.patch`.
5. Store only intentional content:
   - User preferences, key decisions, important facts, lessons learned.
   - Never store heartbeat status, transient info, raw message logs, or OAuth URLs/tokens.
6. Keep entries concise (<100 words), use appropriate categories, set importance 0.7–1.0, and store one concept per entry.
7. Set up a monthly maintenance cron:
   ```
   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"
   }
   ```

## Conflicts

- huytieu/COG-second-brain: The procedure is a trust sweep of persistent notes with re-verification, confidence stamping, and archiving proposals.
- LeoYeAI/openclaw-master-skills: The procedure is a vector-memory maintenance cycle with audit, wipe, reseed, auto-capture disable, and monthly cron.