Stop Building Opinionated Memory
Every memory system picks one retrieval strategy and tunes it for one benchmark. In production the same agent needs to recall differently for every query, so let the agent tune retrieval itself.
- 75% to 94%
- keyword recall after agent-driven tuning
- 13 of 16
- failures traced to k=5 being too shallow
- < 60 s
- for the whole tuning loop
Memory systems are usually tuned against one benchmark (LoCoMo, LongMemEval, DMR) and ship with the retrieval configuration that scored best there. In production one agent asks several kinds of question in a single conversation: what do we know about this customer, what happened in the last three interactions, what caused this escalation, have we seen this failure elsewhere. Each has a different best strategy and weight blend, and a fixed configuration serves one of them.
What we expose per call
- Strategy: similarity, temporal (scoped by --entity-id), causal, or analogical.
- Four scoring weights: --w-relevance, --w-recency, --w-importance, --w-reinforcement. Pure lookup is 1.0/0/0/0; a "what changed" query is 0.2/0.7/0.1/0; critical decisions are 0.3/0.1/0.5/0.1.
- Strategy parameters: --ef-search (HNSW beam width, for example 200), --max-depth (causal traversal, for example 8), --alpha (analogical blend, for example 0.3), and k.
The engine keeps the store healthy (decay, reinforcement, contradiction flags, consolidation) and the calling agent decides how to retrieve, since it is the component that knows the intent of the query.
What the agent found
On a vault of 52 legal documents (949 memories) we ran 20 evaluation queries at defaults (similarity, k=5, strict keyword match on the top 5) and let the agent diagnose its own misses. A query can fail for more than one reason, so the counts overlap.
| Failure pattern | Failures | Fix |
|---|---|---|
| k too small; supporting propositions cut off | 13 of 16 | k=10 |
| No entity name in the cue | 5 of 16 | Put entity names in the cue |
| Missing recency weighting on temporal queries | 3 of 16 | Weights 0.3:0.5:0.2:0 |
| Similarity used for a cross-entity question | 2 of 16 | Analogical strategy, alpha=0.3 |
The agent stored five generalized retrieval strategies as high-importance memories and recalled them before querying in later conversations. Those strategies sit in the same store as everything else, so the ones that keep getting recalled are reinforced and the unused ones decay.
For someone building agents
Most of the loss at defaults was shallow k and under-specified cues, both of which the caller controls. A legal vault produced these five strategies; a sales or code corpus will produce different ones. We publish per-domain playbooks as starting points and expect the agent to tune from there.
