- Update workspace state timestamp - Add weekly summary to MEMORY.md (removing duplicate entry)
1.9 KiB
1.9 KiB
Memory Manager Workflow
This document describes the detailed workflow of the memory-manager skill.
Weekly Consolidation Process
- Identify week range: By default, the previous Sunday-Saturday week is selected. Can override with
--week-start. - Scan daily files: All
memory/YYYY-MM-DD.mdfiles within the week are read. - Extract insights: Using pattern matching on bullet points and decision markers.
- Append to MEMORY.md: A new section with bullet points is added. If MEMORY.md doesn't exist, it's created with a header.
- Log results: Number of insights and files processed are logged.
Archival Process
- Find old files: Daily files older than
MAX_AGE_DAYS(default 30) are identified. - Compress: Each file is gzip-compressed into
memory/archive/YYYY-MM-DD.md.gz. - Remove originals: Original .md files are deleted after successful compression.
- Log count: Total archived files are reported.
Safety Features
- Dry-run mode: Uses
--dry-runto preview changes without modifying anything. - Confirmation: By default, prompts before large operations (can be skipped with
--force). - Error handling: Failed reads/writes are logged but don't stop the whole process.
- Atomic writes: Each file operation is independent; partial failures leave existing data intact.
Logging
All actions are logged at INFO level. Use standard logging configuration to adjust verbosity or output destination.
Scheduling
Recommended: Weekly at 3 AM Sunday via cron:
0 3 * * 0 /usr/local/bin/aitbc systemEvent "Run memory-manager weekly consolidation"
Or via OpenClaw cron API:
openclaw cron add \
--name "memory-manager-weekly" \
--schedule '{"kind":"cron","expr":"0 3 * * 0","tz":"UTC"}' \
--payload '{"kind":"systemEvent","text":"Run memory-manager weekly consolidation"}' \
--sessionTarget main