AGENT MEMORY · RETRIEVAL WORKBENCH

Procedural memory: retrieve an action sequence

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

Your experiment

Select the procedural store and ask how to inspect a database timeout. Reduce the context budget below the runbook size and inspect the missing procedure.

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 and no procedure is executed: compare the selected source texts 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.

    Retrieve instructions before using them

    Procedural memory stores instructions that can guide behavior. This experiment retrieves a fixed runbook into a context tray; it does not execute its steps, train an agent, learn a procedure, or measure task success. Ten synthetic records include facts, incidents, working notes and two procedures. All calculations happen locally. The table exposes every source text, cosine, blended score and exclusion reason, including records omitted from the tray. The complete result is computed immediately; the thirty-second animation stages the inspection, not a network request.

    Find the exact budget boundary

    Choose How do I inspect a database timeout? in Question and Procedural steps in Memory store. Keep Team A, previous sessions enabled, maximum age 168 hours, recency weight zero and maximum retrieved records three. M4 is the highest-ranked runbook and contains eleven whitespace-separated words. At an eleven-word budget it fits exactly. At ten words M4 is skipped and the ten-word M7 deployment checklist fits instead because it shares the word logs. The declared supporting-fact coverage drops from one of one to zero of one. This is a useful failure: a nonempty context can still omit the required procedure. At nine words neither procedure fits.

    Separate scope from ranking

    Active tenant applies a hard filter before selection; Team B has no procedural record in this fixture. Include previous sessions controls access to earlier conversations; disabling it removes both procedures. Maximum age is inclusive: M4 remains eligible at six hours and is excluded at five. Memory store chooses all records, semantic facts, episodic events, procedural steps or working context. Keep latest fact per key removes the older retry-budget fact M6 in favor of M1, but does not alter either procedure because their keys differ. These are explicit application policies, not access-control guarantees for a real service.

    Compare relevance and recency

    Question selects one of four fixed lexical queries. Tokenization lowercases text, removes common stop words and builds TF-IDF vectors over this fixed ten-record vocabulary. Cosine measures lexical overlap, not meaning. Recency weight blends cosine with a twenty-four-hour half-life: zero uses cosine only and one uses recency only, but zero-overlap records are still excluded. Context word budget caps the sum of selected record lengths; Maximum retrieved records caps their count. Greedy packing follows descending blended score, skips oversized records and continues, so it is not an optimal knapsack solver. Counts are words, not tokenizer tokens.

    Inspect the full sequence

    Play advances stored memories, scope filters, ranking and context packing over thirty inspection seconds at normal speed. Pause freezes the current stage after settling elapsed time. Next stage pauses and moves to the next stage boundary. Restart inspection pauses and clears elapsed inspection time while preserving your settings. Speed offers quarter, half, normal and double pace; a change accounts for elapsed time at the old pace first. Input changes recompute the result and reset inspection. A hidden tab pauses. The phone diagram and record table have keyboard-scrollable regions so labels remain readable without page overflow.

    Keep evidence without overstating it

    Capture baseline saves the visible preview, Replace baseline updates it, and Clear baseline removes it. Use the notebook to record M4 versus M7 at budgets eleven and ten; Export notes downloads your observations. Expand experiment enters fullscreen and Exit full screen returns. Supporting-fact labels are declared fixtures, not an LLM accuracy score. No answer is generated, no database is inspected, no retry is performed, and the runbook is not advice to apply blindly to a live incident. Compare the full record table and both related readings before generalizing from this small retrieval example.