cd /news/ai-agents/my-ai-memory-layer-kept-the-old-fact… · home › topics › ai-agents › article
[ARTICLE · art-183050] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=· neutral

My AI memory layer kept the old fact. The fix worked, and I still did not ship it as the default.

A developer behind the open-source Memory Assistant project measured how often an AI memory layer surfaces an updated fact before the outdated one, finding the new value ranked first in only 0.471 of 70 LongMemEval-S knowledge-update questions. A pre-committed recency re-ranking fix (sorting the top 20 results by position minus three times freshness) raised that to 0.729 but dropped the developer's own eval sets from 23/24 to 16/24, so it ships off by default behind a RECENCY=1 flag in release v0.4.0, which also adds per-user access keys and marks the project as entering maintenance mode.

recommendation

Test recency re-ranking against your own eval sets before enabling it, since facts written in the same message get promoted by position rather than true freshness.

more in playbook: Retrieval and RAG
by read2 min views1 publishedDec 6, 2026

In my first post I listed what I had not measured. One item bothered me: what happens when a fact changes.

Memory Assistant replaces a fact in place when it has a key ("lives in" Pune, then "lives in" Delhi). But most facts

have no key. "My 5K personal best is 27:12", and weeks later "25:50": the store keeps both, and search ranks them by

how well they match the question. Nothing says the second one is newer.

LongMemEval-S has knowledge-update questions: the user said something twice with a different value, and the question

asks for the current one. The dataset marks both turns as evidence, and every session has a date, so I could split

the evidence into new and old and ask a question the usual recall metrics cannot: which one comes first?

70 questions could be scored this way. With my default (hybrid search), the new value came first in only 0.471 of them. More than half the time, a model reading the results would see the outdated value first.

I have made this mistake before: try a fix, see a good number, call it the default. So before writing any code I

committed a rule. The method: re-order only the top 20 results, and let a newer memory move up at most 3 places

(sort by position - 3 * freshness). Two parameters, fixed in advance, no tuning. It becomes the default only if:

Condition Before After
New value first (70 questions) 0.471 0.729 met
Old value alone in the top 5 0.057 0.057 met
Worst drop on another LongMemEval-S type 0.016 met
LoCoMo recall@5 0.561 0.558 met
Own eval sets 26/27, 23/24 24/27, 16/24 failed

Three out of four, and a big win on the thing I set out to fix. And my own test set fell from 23/24 to 16/24.

The reason is simple once you see it. In my own cases, all the facts arrive in one message ("I live in Jaipur. I

work as an accountant. I like cricket..."), so they are written microseconds apart. "Newer" then just means "later in

the sentence", and recency promotes whichever fact came last. The same thing costs LoCoMo recall@1 (0.285 to 0.247),

because turns in one session are seconds apart.

So, as the rule says, it ships off by default (RECENCY=1 turns it on), and the README shows both sides.

This release also added per-user access keys (a user's key gets 403 for anyone else) and Dependabot. It is the last

feature release; the project is in maintenance mode now.

Code, the rule as committed before the run, and every raw result:

https://github.com/munendra07-tech/memory-assistant (release v0.4.0)

── more in #ai-agents 4 stories · sorted by recency
── more on @memory assistant 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/my-ai-memory-layer-k…] indexed:0 read:2min 2026-12-06 · —