PROJECT: memory-compactor
Aim
Compact noisy conversational memory stretches (especially debug sessions) into durable resolved summaries while preserving recall quality.
Current implementation
- HTTP client for custom mem0 server endpoints:
POST /memories/all
POST /memories/raw
DELETE /memory/{id}
- temporal clustering (
gap-minutes)
- LLM segment extraction + summary writer
- dry-run reporting
Operating mode
- default dry-run
--apply to mutate memory state
- bounded deletions with
--max-deletes
Design notes
- write compacted summary before deleting old entries
- append extracted facts into the summary text (non-empty only)
- annotate summaries with provenance metadata (
segment_source_ids, extraction)
- set
metadata.created_at to the segment end timestamp so summary ordering stays intact
Next steps
- Add rollback snapshot file before apply
- Add explicit per-user allowlist
- Add cron integration helper (OpenClaw cron payload template)
- Add quality checks pre/post compaction