Skip to content
πŸ”₯0
Sign in
8 min readmedium+40 XP

Expiration, Pruning and Reset Rules

Memory that never expires becomes a liability. This topic covers TTLs, recency- and relevance-based pruning, and explicit reset rules so the agent's context stays compact, correct, and forgettable when the user asks.

After this topic, you'll be confident about Time-to-live (TTL), Pruning, Recency-weighted retrieval and 1 more concept.

Expiration, Pruning and Reset Rules

A memory store with no expiration policy is a landfill. The exam expects you to know three forgetting mechanisms and when to use each.

The three mechanisms

| Mechanism | What it does | When to use | | --- | --- | --- | | TTL (time-to-live) | Auto-delete after N seconds/hours/days | Ephemeral task scratch, short-lived caches | | Pruning | Active deletion of low-value records | Long-term stores that grow without bound | | Reset | Explicit user/admin wipe of a scope | Trust, compliance, "forget me" requests |

TTLs run on a clock. Pruning runs on a value heuristic. Reset runs on a user intent. You almost always need all three.

Pruning by multiple signals

Single-signal pruning is dangerous. A robust rule combines:

  • Confidence: was the fact stored from a high-trust observation or a guess?
  • Recency of access: when was the record last retrieved into a working set?
  • Supersession: is there a newer record on the same key?
  • Source authority: did the user confirm it, or did the agent infer it?
function shouldPrune(record) {
  return (
    record.confidence < 0.5 &&
    daysSinceAccess(record) > 30 &&
    hasNewerOnSameKey(record)
  );
}

Reset must be real

When the user says "forget that", the agent must:

  1. Locate every record matching the request in the right scope.
  2. Delete them (not soft-hide).
  3. Confirm the action back to the user.
  4. Log the deletion in an audit trail (the metadata that you deleted, not the deleted content).

Anything less is a trust violation and, under regimes like GDPR's right to erasure, a legal one.

Quick check

Quick check

1 of 3
+40 XP

Which memory class is the strongest candidate for an aggressive TTL (hours to days)?

Pick your answer.

Where this shows up on the exam

Watch for scenarios where the agent "remembers something wrong" or the store gets slow. The correct answer combines a TTL on ephemera, a multi-signal pruner on long-term records, and an explicit reset path for the user.

Anchor concepts

Key terms

Time-to-live (TTL)
A maximum age after which a memory record is automatically purged. The blunt-but-reliable expiration mechanism.
Pruning
The active reduction of stored memory by deleting low-value records β€” old, irrelevant, superseded, or low-confidence.
Recency-weighted retrieval
Retrieving memory ranked by a blend of similarity and recency so stale facts lose to fresh ones in close calls.
Reset
An explicit, user- or admin-triggered wipe of a memory scope. The 'forget me' button that compliance and trust require.
Watch out

Common pitfalls

  • Setting a TTL of 'never' on long-term memory: the store grows monotonically, retrieval gets slower, and stale facts crowd out fresh ones.
  • Pruning purely by age without considering value: you delete a load-bearing user preference set 18 months ago while keeping noisy ephemera from last week.
  • No reset UX: the user asks you to forget something and you can't, which is both a trust problem and, in many jurisdictions, a legal one.
Expiration, Pruning and Reset Rules Β· Training