polysemic.systems
Excretion

Lethe

A system that can only accumulate isn't learning — it's hoarding. Lethe is forgetting as a first-class, designed faculty: nothing enters without knowing how it will leave.

$ python3 examples/lethe-stores/lethe_poc.py demo

TTL is mandatory. Immortality is opt-in.

remember() takes a TTL as a required argument — the type system won't let a memory into the store without an exit plan. Most memory bugs in agent systems are memories nobody decided to keep; Lethe makes keeping a decision.

  • TTL required at write time, per memory
  • Named retention policies travel with every governed memory
  • Time injected everywhere — the whole lifecycle is testable
  • Subject-keyed storage, ready for per-user erasure

Use it or lose it: salience with a half-life

Every memory's salience decays exponentially unless recall reinforces it — recall is use, and use is what keeps a memory alive. The scheduled sweep() releases everything expired or faded. The context window is a garden, not a warehouse; this is the pruning shears.

  • Exponential decay by configurable half-life
  • Recall touches and reinforces, capped to prevent immortals
  • Sweep reports what left and why, with a deletion receipt

Erasure across real stores, with independent receipts

The standalone proof writes one subject to PostgreSQL+pgvector and Redis, erases it from both, and re-verifies absence before declaring success. Each store returns its own SHA-256 receipt, then the coordinator commits the complete or partial outcome into an aggregate receipt.

  • PostgreSQL uses DELETE … RETURNING beside pgvector embeddings
  • Redis erases indexed keys and verifies logical absence
  • Idempotent replay returns the original receipts
  • A shared aggregate ledger binds request IDs before either store is called
  • Unrelated memories must survive the proof

Build the delete path before you need it.

A faculty designed beats a failure discovered. Lethe gives every layer of your stack a way to shed — with a verified deletion observation for every erasure: each store is independently re-queried for absence, and the receipt commits to what was checked. An observation at one moment is not a proof about replicas, backups, or exports; the erasure contract names that boundary instead of hiding it.