AGENT MEMORY · RETRIEVAL WORKBENCH
Episodic memory: retrieve a past incident
Follow real ranking calculations from stored memory cards through scope filters into a bounded context tray.
Scroll the memory cards horizontally to inspect all ten records. The table below provides their full text and exclusion reasons.
Your experiment
Ask what happened in the timeout incident across all stores. Cosine ranking puts yesterday’s incident M3 first; now raise the recency weight one step at a time and find where the current ticket and older facts push M3 out of the three-record limit.
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
| ID | Memory text | Cosine | Blended score | Outcome |
|---|
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.
An incident is one record among several stores
The fixture holds ten short memory records for two tenants. M3 is the episodic record of a past incident: yesterday a database timeout ended after reducing batch size. Around it sit a procedural runbook (M4, how to inspect a timeout), the current working ticket (M5, INC-42 is a timeout during deployment), two versions of a retry-budget fact (M1 and the superseded M6) and an unrelated meeting note (M8). The question “What happened in the timeout incident?” is answered only by M3; the runbook and ticket are related, but they describe a procedure and the present, not what happened.
The opening run: cosine alone keeps the incident
The page opens on the timeout question for Team A with All stores, previous sessions allowed, a 168-hour age limit, a 40-word budget, three records and recency weight 0. Lexical TF-IDF cosine ranks M3 first at 0.548, then M4 at 0.277 and M5 at 0.248; the three records use 30 of the 40 words and all three declared supporting records are present. M1 shares only the word database (0.140) and is cut by the three-record limit; M6 is excluded as a superseded fact because the newer M1 has the same key; clear Keep latest fact per key and M6 is no longer excluded as superseded.
Failure boundary: recency displaces the past
The blended score is (1 − w) × cosine + w × 2^(−age/24h). M3 is 48 hours old, so its recency term is only 0.25, while the ticket M5 is 0.1 hours old and M1 is 2 hours old. Raise Recency weight: at 0.1 and 0.2 M3 still ranks first; at 0.3 M5 overtakes it (0.473 against 0.458) but M3 stays in the tray; at 0.4 M3 drops out under the retrieval count limit and the tray becomes M5, M4 and M1. From 0.4 upward the incident is gone and only two of three supporting records remain. A recent record is not a more relevant answer to a question about the past.
Other ways to lose or keep the incident
Set Memory store to Episodic events and M3 is the only candidate, whatever the recency weight, because M5 and M4 live in other stores. Turn off Include previous sessions and M3 is excluded as a past-session record; the tray holds only M5. Lower Maximum age below 48 hours and M3 is excluded by age. Lower the Context word budget to 20 and greedy packing keeps M3 (10 words) and M5 (9 words) but skips M4 (11 words). Switch Active tenant to Team B and every Team A record, including the incident, is behind the tenant boundary. Raising Maximum retrieved records admits M1 as well.
Reading the run and its limits
Play reveals four stages over thirty inspection seconds at 1×: the stored cards, scope and retention filters, cosine ranking and context packing, ten seconds apart; Next stage, Restart inspection and Speed (0.25× to 2×) control the replay, and any input change recomputes the result and restarts the inspection. The record table gives every text, cosine, blended score and exclusion reason. This is an offline teaching model: lexical TF-IDF over fixed sentences, not an embedding model or an ADK memory service, and no answer is generated. Supporting-record coverage counts fixed fixture labels; it is not an accuracy measurement.