Skip to main content

memanto policy apply

Run the expiry sweep. This is what actually moves memories from active to expired — saving a policy on its own changes nothing. The command always shows the policy in force and every matching memory before asking to proceed, so --dry-run is only needed when you want to stop at the preview.
Options:
  • -a, --agent TEXT - Agent identifier (defaults to active agent)
  • --dry-run - Show what would be expired and stop
  • -n, --limit INTEGER - Max matched memories to list (default: 20)
  • -y, --yes - Skip the confirmation prompt
Examples:
Output:
When nothing matches:
A sweep only considers active memories, and never re-stamps one that is already expired. That second line exists because apply reporting 0 while policy purge reports matches is expected — the two act on different populations.
Notes:
  • Requires an active agent, and a policy. With no policy set the sweep is a no-op and says so.
  • Every memory in a single sweep is stamped with the same expired_at, so a batch is consistent.
  • Each expired memory records the rule that retired it as expired_by.
  • The nightly memanto schedule enable job runs this sweep automatically.
  • Undo one with memanto memory restore.
  • Backed by the Apply Expiry Policy API endpoint.
  • See the Memory Lifecycle reference.