AGENT MEMORY · RETRIEVAL WORKBENCH
Working memory: assemble the active context
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
Select the working store and ask about deployment region. Inspect why matching vocabulary in an active status note does not provide the declared region fact.
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.
Distinguish current-task context from historical evidence
Working context contains two current-session records: M5 describes ticket INC-42 and M10 says a deployment is pending review. Choose the timeout-incident Question, Team A and Working context. At budget nine, maximum retrieved records three, age 168 and recency zero, M5 fits exactly. At budget eight it is skipped and the final tray is empty. Both records remain stored in the table; this is a selection limit, not deletion. M10 has no shared query terms for the timeout question, so it cannot fill the gap merely because it is recent. There is no generated scratchpad, planner state or automatic summarization.
Scope the task before widening recall
Switch to the deployment-region Question while staying in Working context and restore budget forty. The current ticket and pending-deployment note match deployment, but neither contains a region. Supporting-fact coverage remains zero of one. Choose Semantic facts and enable previous sessions: M2 supplies Mumbai for Team A. Disabling previous sessions removes it. Switch to Team B with past sessions enabled and M9 supplies London without borrowing Team A records. This comparison separates the current task from historical knowledge; a populated working context need not answer the question. The working-memory reading discusses typed state updates and lifecycle management. Here the records are fixed and cannot be written, merged, compacted or persisted. No actual ADK session, token window or multi-agent shared state is implemented.
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.