Memory Operations
User Commands
| Command | Action | |---------|--------| | "What do you know about X?" | Search all tiers, return matches with sources | | "Show my memory" | Display memory.md contents | | "Show [project] patterns" | Load and display specific namespace | | "Forget X" | Remove from all tiers, confirm deletion | | "Forget everything" | Full wipe with export option | | "What changed recently?" | Show last 20 corrections | | "Export memory" | Generate downloadable archive | | "Memory status" | Show tier sizes, last compaction, health |
Automatic Operations
On Session Start
1. Load memory.md (HOT tier) 2. Check index.md for context hints 3. If project detected → preload relevant namespaceOn Correction Received
``` 1. Parse correction type (preference, pattern, override) 2. Check if duplicate (exists in any tier) 3. If new: - Add to corrections.md with timestamp - Increment correction counter 4. If duplicate: - Bump counter, update timestamp - If counter >= 3: ask to confirm as rule 5. Determine namespace (global, domain, project) 6. Write to appropriate file 7. Update index.md line counts ```On Pattern Match
When applying learned pattern: ``` 1. Find pattern source (file:line) 2. Apply pattern 3. Cite source: "Using X (from memory.md:15)" 4. Log usage for decay tracking ```Weekly Maintenance (Cron)
``` 1. Scan all files for decay candidates 2. Move unused >30 days to WARM 3. Archive unused >90 days to COLD 4. Run compaction if any file >limit 5. Update index.md 6. Generate weekly digest (optional) ```File Formats
memory.md (HOT)
```markdownSelf-Improving Memory
Confirmed Preferences
Active Patterns
Recent (last 7 days)
corrections.md
```markdownCorrections Log
2026-02-15
2026-02-14
projects/{name}.md
```markdownProject: my-app
Inherits: global, domains/code
Patterns
Overrides
History
Edge Case Handling
Contradiction Detected
``` Pattern A: "Use tabs" (global, confirmed) Pattern B: "Use spaces" (project, corrected today)Resolution: 1. Project overrides global → use spaces for this project 2. Log conflict in corrections.md 3. Ask: "Should spaces apply only to this project or everywhere?" ```
User Changes Mind
``` Old: "Always use formal tone" New: "Actually, casual is fine"Action: 1. Archive old pattern with timestamp 2. Add new pattern as tentative 3. Keep archived for reference ("You previously preferred formal") ```
Context Ambiguity
``` User says: "Remember I like X"But which namespace? 1. Check current context (project? domain?) 2. If unclear, ask: "Should this apply globally or just here?" 3. Default to most specific active context ```