Home / Blog / The memory lifecycle
Memory is a lifecycle, not a table.
A fact in an agent's memory is born, contested, ages, survives bad days, and eventually has to account for itself. v0.4.0 gives every one of those stages a mechanism.
Birth · pre-compaction flush
Facts die at the context cliff.
Long-running agents lose what they learned the moment the host framework summarizes old turns: whatever the summary drops is gone, and nothing logged that it existed. The SDK now flushes durable facts into governed memory before compaction: automatically at a token threshold via CompactionGuard, as a LangGraph node before your summarize step, or as a tool the model calls in the OpenAI Agents SDK, CrewAI, and AutoGen. Every flush is audit-tagged, so the record shows when the agent externalized what it knew.
Contested · conflict resurfacing
Disagreements don't get to hide.
When two facts contradict and no one has adjudicated, most stores quietly return whichever ranks higher. Lians now pushes open conflicts to the top of every assembled context block, oldest first as explicit "X disagrees with Y" lines, so the model treats contested facts as contested. Overflow is an explicit "+N more", never a silent drop.
Aging · materiality-weighted decay
A compliance flag should outlive a lunch preference.
Uniform recency decay treats "client is vegetarian this week" and "client is a restricted person" identically. Retrieval half-life now scales with a fact's declared materiality (7 days for the passing, 365 for the critical) while storage never decays and point-in-time queries honor the same weights.
Bad days · audited degraded retrieval
Outages degrade loudly, not silently.
When the embedding provider goes down, recall proceeds lexical-only, and says so on every result, in the audit event, and in the metrics, so "the agent answered from weaker recall that afternoon" is a fact you can establish later rather than guess. Degraded results are never cached; recovery is immediate.
Accounting · the signed memory statement
Hand the examiner a document, not a database.
One call renders an agent's exhaustive point-in-time knowledge state as human-readable Markdown: provenance, validity window, and materiality per fact, erased facts shown as explicit crypto-shred markers. The document's SHA-256 is anchored in the tamper-evident audit chain, and the footer states the offline verification procedure, so the statement itself can't be quietly edited after the fact.
Try it
Live everywhere, today.
$ pip install lians-sdk==0.4.0 # also npm · Go proxy · Maven Central from lians import LiansMemoryHarness, CompactionGuard guard = CompactionGuard(harness, context_limit_tokens=120_000) guard.observe_and_maybe_flush(messages) # fires once per window, audit-tagged