Skip to main content
PUT

Overview

Replaces the agent’s expiry policy wholesale. Saving a policy expires nothing on its own — run Apply Expiry Policy afterwards, or let the nightly schedule job pick it up. See the Memory Lifecycle reference for the model.

Authentication

API clients do not send an API key or Authorization header.
string
required
Session token from Activate Agent. Must match agent_id.
string
required
Must be application/json

Path Parameters

string
required
The unique identifier of the agent.

Body

integer
default:"1"
Policy schema version.
object
Maps a memory type to a maximum age ({"context": "7d"}). Types absent from the table never expire on a timer. An unknown type is rejected.
array
Named match blocks, checked in order. The first match wins and overrides the retention table, so a rule with expire_after: "never" pins a memory active. Each entry takes name, match, and expire_after.
string
default:"never"
How long an already-expired memory is kept before purging can delete it permanently. Unrelated to what retention expires.

Rule match conditions

Every condition set must match (AND). An empty match matches every memory.

Durations

30m, 12h, 7d, 2w, 3mo, 1y, or never. A month is 30 days.
A rule name is stamped onto expired memories as expired_by, so it is bounded to letters, digits, ., _ and -. Duplicate rule names are rejected.

Next Steps