sleep
Run background memory maintenance during idle time: consolidate near-duplicate clusters, prune or reaffirm memory budget, and keep recall fast without blocking active tasks.
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 |