AGENT MEMORY · RETRIEVAL WORKBENCH

Memory forgetting: age and superseded facts

Follow real ranking calculations from stored memory cards through scope filters into a bounded context tray.

30-second inspection at 1× · actual TF-IDF cosine

Scroll the memory cards horizontally to inspect all ten records. The table below provides their full text and exclusion reasons.

Your experiment

Ask about retry policy. Disable latest-fact filtering to admit the obsolete five-attempt policy, then enable it. Compare version filtering with age-based forgetting.

Make a prediction, capture a baseline, change one policy and advance through all four stages. An empty context is a valid result; the table explains every exclusion.

Selected context

    The tray is populated at the final stage. No answer is generated: compare the selected source facts yourself.

    Inspect every record

    IDMemory textCosineBlended scoreOutcome

    Offline teaching model, not an ADK service implementation or a trained semantic encoder. The ten records and supporting-fact labels are synthetic fixtures. Retrieval uses lexical TF-IDF cosine; semantic refers to the type of stored fact, not neural similarity. Score = (1 − recency weight) × cosine + recency weight × 2^(−age/24h). Zero lexical matches are excluded. Greedy packing skips records that do not fit. Budgets count whitespace-separated words, not model tokens. Memory types, tenant rules, age limits and latest-key replacement are explicit application policies; no LLM accuracy, production capacity or privacy guarantee is measured. ADK memory concepts · Cosine similarity reference.

    Compare three reasons to omit a memory

    This experiment separates age-based retention, superseded facts and context capacity. All ten synthetic records remain stored and visible in the table. A record omitted from the selected context has not been deleted. The related forgetting article describes suppression, tombstones, re-ingestion and derived copies; this fixture implements only reversible selection filters. It cannot prove erasure, prevent re-learning, scrub a conversation or invalidate a cache. Restoring a control can make an excluded record eligible again.

    Retain the current retry policy

    Choose the retry-budget Question, Team A and Semantic facts. Enable previous sessions, set maximum age to 168, budget to 80, maximum retrieved records to ten and recency weight to zero. Disable Keep latest fact per key: M1 says three attempts and M6 says five attempts before the policy changed. Both are retrieved. Enable the control: M6 becomes superseded while M1 remains. Disable it again and M6 returns. This is selection by a declared key and age, not an inference that understands contradictions.

    Find the exact age and capacity boundaries

    With latest-fact filtering disabled, maximum age 120 admits M6 and 119 excludes it. M1 remains at maximum age two, but disappears at one. Restore age 168 and enable latest-fact filtering. A context budget of six words fits M1 exactly; five does not. Even when the current fact cannot fit, the model does not substitute its superseded predecessor. Restore budget 80 to recover M1. Disable previous sessions and both policies are outside the session scope. Compare the different exclusion reasons in the table: a missing source has different causes even when the final tray is empty.

    Scope before similarity

    Question selects one of four fixed queries. Active tenant is a hard filter: Team A and Team B cannot select one another's records. Memory store chooses semantic facts, episodic events, procedural steps, working context or all stores. Include previous sessions admits older conversations; disabling it leaves only current-session records. Maximum age is an inclusive retention boundary, measured in fixture hours. Keep latest fact per key excludes an older record whenever a newer record with the same tenant and key exists, even if other filters later exclude that newer record. It does not resurrect stale facts. These are application policies in a local example, not a tested production authorization or deletion service.

    Read the actual score

    The model lowercases words, removes a fixed stop-word list and computes log term frequency with smoothed inverse document frequency over ten fixed records. Cosine is the dot product divided by the two vector lengths. Recency weight blends that cosine with 2 raised to minus age divided by twenty-four hours. At zero, ranking uses only cosine; at one, it uses only recency, but records with no shared query terms remain excluded. This lexical method does not understand paraphrases or negation. A recent or high-scoring record can still be the wrong evidence. The table exposes each full text, cosine, blended score and exclusion reason.

    Pack and inspect

    Context word budget limits the sum of whitespace-separated record lengths. Maximum retrieved records imposes a separate count limit. Greedy packing visits ranked candidates, skips those too large for the remaining budget, and continues. It neither truncates records nor solves an optimal packing problem. The result is computed immediately. Play reveals stored records, scope filters, ranking and the final context over thirty inspection seconds at normal speed. Pause settles elapsed time and freezes it; Next stage pauses at the next ten-second boundary. Restart inspection preserves policy settings and speed while clearing playback. Speed offers quarter, half, normal and double pace; changing it settles time at the old pace first. Input changes restart inspection, and a hidden tab pauses. Reduced-motion preference prevents automatic playback after input changes.

    Keep a reproducible observation

    Capture baseline saves the visible preview and settings, Replace baseline refreshes them, and Clear baseline removes the comparison. Record selected record IDs and exclusions in the notebook; Export notes downloads your observations and the notebook survives reload. Expand experiment enters fullscreen; Exit full screen returns. The diagram and record table scroll horizontally by keyboard on a phone to preserve readable labels. Supporting-fact coverage counts declared fixture IDs; it is not a measured answer-quality score. No language model generates an answer, no embedding service is called, and no persistent bank is modified. Read the source text before treating a retrieved fact as true.

    Views are my own and do not represent any employer, past or present.

    Search