Tideline
Decay & lifecycle
Good memory forgets the right things. Tideline ages facts with an importance-scaled exponential decay, reinforces what you actually use, and sweeps the truly faded into an archive — never a hard delete for anything durable.
The effective score#
Every fact has an effective score in [0,1] that drives both ranking and the GC sweep. Permanent facts are pinned at 1.0 and never decay; everything else decays exponentially from its last access, scaled by importance, and is nudged back up by how often it has been recalled.
permanent tier -> 1 (never decays) daysSinceAccess = (now - lastAccessedAt) / 1 dayadaptiveHalfLife = 11.25 days * (1 + importance)lambda = (ln2 / adaptiveHalfLife) * 0.8 * (1 + decayRate)decayed = importance * exp(-lambda * daysSinceAccess)reinforcement = 1 + ln(1 + accessCount) * 0.1score = clamp(decayed * reinforcement, 0, 1)A high-importance identity fact has a half-life around three weeks; a low-importance context note fades in days. Each recall bumps the access count and resets the clock, so the facts you lean on stay sharp.
Tiers & segment defaults#
A fact's tier and starting importance come from its segment:
| Segment | Tier | Importance | Decay rate |
|---|---|---|---|
identity | permanent | 0.85 | 0.01 |
correction | long | 0.80 | 0.015 |
relationship | long | 0.75 | 0.02 |
preference | long | 0.70 | 0.02 |
project | long | 0.65 | 0.025 |
knowledge | long | 0.60 | 0.03 |
context | short | 0.40 | 0.08 |
- permanent — pinned at 1.0, never decays, never evicted.
- long — decays, but is only ever archived, never hard-pruned.
- short — can be pruned (hard-deleted) once it fully fades.
The sweep#
A decay GC runs on the background maintenance sweep — cheap, no model, idempotent. It moves each fact by its score, and a confirmed belief is immune to eviction entirely:
| Effective score | short tier | long tier |
|---|---|---|
≥ 0.15 | kept active | kept active |
0.05 – 0.15 | archived | archived |
< 0.05 | pruned (hard delete) | archived (never pruned) |
Lifecycle states are active (in the recall pool), archived (out of recall but recoverable), and pruned(gone). Archiving is reversible; every transition is written to the event log so you can answer "why did this fact disappear?".
Reinforcement & feedback#
Recall reinforces: a hit bumps the access count and refreshes recency (auto-recall is the exception — it is passive and never reinforces). Explicit feedback is asymmetric on purpose:
upnudges importance+0.05and resets the decay clock.downnudges importance-0.10and leaves the clock alone, letting decay take over.
A few bad recalls outweigh many lukewarm ones — so memory corrects toward what actually helps.
In the code
src/agents/memory/decay.ts; tiers, segment defaults, lifecycle, reinforcement, and feedback are in records.ts.Next
Decay handles the gradual fade. The deliberate clean-up — confirming beliefs, merging duplicates, evicting noise — happens in maintenance.