sleep
Consolidate near-duplicate clusters and prune memory budget during idle time. Call when idle to run cheap, idempotent maintenance that keeps recall and remember fast.
Instructions
SLEEP-TIME COMPUTE: call this whenever the agent is IDLE to run background memory maintenance in
one cheap, idempotent pass — the expensive reorganization the write path defers. It consolidates any
ripe near-duplicate clusters (dedup + preference-flip handling), and, if keep is given (or a
capacity was configured), prunes/re-affirms the memory budget. A no-op until something is ripe, so
it's safe to call on every idle tick; a second immediate call does no new work; it never edits raw
text. This is the recommended place to do heavy cleanup so remember()/recall() stay fast.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keep | No | ||
| cluster_threshold | No |