Memory Retrieval
A store with 10k facts is useless if you inject the wrong 20 — or all 10k.
Asking the librarian for two books, not dumping the shelves on the desk.
Visual Workflows
Start here — scroll inside each diagram frame to explore, then use + / − to zoom up to 200% if needed.
Overview
Scroll inside the frame to explore · use + / − to zoom up to 200%
Scroll inside the frame to explore · use + / − to zoom up to 200%
Retrieve then pack
Scroll inside the frame to explore · use + / − to zoom up to 200%
Filter, retrieve, then pack. Skip if nothing matches.
Key Takeaways
- 1.Retrieval is fetching the few memories that help this turn. Query with the user message plus a bit of session state.
- 2.Filter by user, time, and type before you rank. Zero hits is valid — do not invent a memory.
- 3.Build a query from the latest user text and metadata. Filter tenant and type.
- 4.Retrieve a small k. If empty, proceed without fake memories.
- 5.Log what you retrieved for debug.
Learn elsewhere
- →Memory Ranking
- →RAG retrievers — Phase 3
Real Example
Scenario
User: 'same as last refund.' Filter user=12, type=episode, last 90 days. Hit: refund #4412. Pack that recap only.
What you would do
In Agent Memory, apply Memory Retrieval to this scenario: User: 'same as last refund. Identify the inputs, run the technique, validate the output, and note one thing you would monitor in production.
Commands
Commands to Remember
Query + filter + top-kAlways scope by userEmpty is allowedLog what you fetched
Cheat Sheet
Quick recap
quick ref- •Librarian, not a dump
- •Filter then rank
- •Small k
- •Do not invent hits
Common Mistakes
- ✕Global search across all users
- ✕k=50 into a 4k window
- ✕Hallucinating a memory when retrieval is empty
