Compact the memory store
memory_compactFrees persistent-memory budget after a refused save by archiving the stalest facts, returning what moved so you can retry the save; archived facts remain restorable, not deleted.
Instructions
Free room in persistent memory when memory_save was refused for budget. Archives the stalest facts of the writable project store until a fact as large as the biggest one kept will fit, and returns what moved — every archived name with its type and description. Nothing is deleted: archived facts leave the index but stay on disk under archive/, memory_recall with include_archived still finds them, and bringing one back is an operator action rather than a tool — bantamkit-memory restore <name> (Node) or python -m bantamkit.memory restore <name> (Python) on the store; no tool deletes a fact. Read-only grants and the profile layer are never touched. Call it after a budget refusal, then retry the save; calling it under budget archives nothing and says so. It is not the pass for two copies of one name across layers — that is memory_dream.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reserve | No | Bytes of index headroom to free below the budget: the target is `budget - reserve`, a negative value counts as 0, any value is capped at half the budget, and 0 compacts to the budget itself. Omit for the default: the room the degraded-index warning demands (the budget minus `(90 * budget - 1) // 100`) plus the size of the largest index line the store holds -- at the default 24000-byte budget with a 39-byte largest line that is 2401 + 39 = 2440, a 21560-byte target. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |