optimize_cache
Improve cache hit rates by reorganizing memories: promote frequently accessed items to short-term, demote cold data to long-term, and evict old entries.
Instructions
Reorganize cache for optimal hit rates. Promotes frequently accessed memories to L1 (24h TTL), demotes cold data to L2 (7d TTL). Use periodically for large memory stores. May temporarily increase latency during optimization. Returns: summary of cached memories. Side effects: modifies cache TTLs, may evict old entries.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_memories | No | Maximum memories to keep in cache. Range: 100-10000. Older/colder items evicted first. Default: 1000. | |
| force_refresh | No | true: clear cache and reload all from storage. false: optimize existing cache. Default: false. |