My assistant keeps retrieving irrelevant past context that degrades answer quality over time
TL;DR
- Irrelevant comes in three kinds. Copies of what you already have, distractors that sit on the topic without answering the question, and unrelated text. A similarity cutoff trims weak and unrelated matches; this page infers it is weaker against distractors.
- This page looks at two possible causes of "over time". As the store grows, more close records may compete for the same question, and a ranking that counts earlier retrievals can change the order by itself.
- Each lever answers a different question. Scope picks the pool, a threshold sets a floor, a reranker sets the order, and a result count requests how many come back. A reranker removes nothing without a cutoff.
- Test against a hand-picked note. Run your own questions with retrieved context, with the passage you would paste, and with no context, measure the control's noise, and add a paired case where using the memory would be wrong.
You connected memory because the assistant kept losing useful facts. Later, it remembers more and answers worse. Before clearing the store or raising a threshold, look at what actually reached the model.
The three kinds and the two causes are this page's own sorting; every lever is quoted from the vendor's docs.
Distractors, in Chroma's words, are texts "topically related to the needle, but do not quite answer the question": close to what was asked, yet not the answer.
Context rot is the pattern Anthropic describes from needle-in-a-haystack studies: "as the number of tokens in the context window increases, the model's ability to accurately recall information from that context decreases" (Anthropic).
What exactly is irrelevant: copies, distractors, unrelated text
- Copies repeat what is already in the answer, or fill several result slots with overlapping chunks. They are covered on a separate page, why vector search returns duplicate results.
- Distractors concern the subject but do not answer the question. Chroma reports that "Distractors have non-uniform impact on model performance with regards to how distracting they are relative to each other."
- Unrelated text has no real connection to the question. Chroma: "Irrelevant content is unrelated to the needle and question."
Chroma compared focused prompts of about 300 tokens with full prompts of about 113k: "Across all models, we see significantly higher performance on focused prompts compared to full prompts." Its caveats: "However, this evaluation is not exhaustive of real-world use cases," and "We also do not explain the mechanisms behind this performance degradation." Chroma sells a vector database, wrote its distractors for a high-similarity needle-question pair, and measured long inputs to models, not a retrieval system; applying the three kinds to a memory store is this page's step. RAG vs agent memory discusses the same study.
Research abstracts describe related effects: irrelevant context lowered accuracy in Shi and colleagues' benchmark, the position of relevant information mattered in Liu and colleagues', and Yoran and colleagues note that "retrieval augmentation can sometimes have a negative effect on performance."
Why it gets worse over time
This page examines two causes. What should not have been written belongs to the agent memory write gate, and what has gone stale to why agents need to forget. Also rule out a new embedding model: after ji_ai swapped one, the bot answered "I don't know" to everything.
More close records compete for the same question. Michael Truong observed that "the quality of the retrieval results can shift as the content in the vector database grows and changes over time." In a reply to a comment by this page's publisher he suggests "retrieving a larger candidate set and reranking it before passing a smaller set to the LLM", for cases like notes "getting buried at rank 10". The general mechanism is this page's inference: as the store grows, more near neighbours of the same question can push the needed record below a limited result list.
Where the filter runs can hide it. Swapnanil Saha notes that "Every example below comes from one agent-memory store, the open-source vectr daemon," and shows a filter applied after the top k: the index answered "which k items are nearest overall?" while the caller wanted "which k items are nearest among the ones that pass?" It is worst "when the items you do not want are the ones most similar to the query," and the short list looks complete. Check whether your filter runs before or after candidate selection.
A ranking that counts earlier retrievals changes the order. Mem0's Memory Decay is meant to "Boost recently-used memories and gently dampen stale ones at search time, without filtering anything out"; "every time a memory is returned in a search it gets a small reinforcement." Mem0 says "It is a soft ranking bias, never a filter," that "Memory Decay is opt-in per project and off by default," and that results can still surface "just with a different ranking among similarly-scored results." LlamaIndex documents a postprocessor that pulls the other way: "This biases search to favor information that has not been returned in a query yet." Setting the two side by side is this page's reading; both describe mechanisms, not evidence that either made answers worse.
Being returned is not being useful: see outcome reranking and RAG vs agent memory. Feedback and consolidation are on pruning low-value context, old versions of a fact on which source to trust.
Which lever answers which question: threshold, reranker, how many, which pool
Mem0's advanced retrieval page draws the line this section uses: "rerank is the only lever here that changes result order", while "filters, top_k, and threshold change which memories come back, not how they're ordered."
| Lever | Question it answers | Where it is, in the vendor's words |
|---|---|---|
| Threshold | Which records clear a relevance floor? | LangChain: "score_threshold: Minimum relevance threshold for similarity_score_threshold". LlamaIndex: "Used to remove nodes that are below a similarity score threshold." Mem0: "Minimum semantic relevance score." Supermemory: "Similarity cutoff (higher = fewer, better results)". Mnemoverse (publisher): min_relevance, "Minimum relevance threshold". |
| Reranker | In what order should the candidates appear? | Cohere: "Given a query and a list of documents, Rerank indexes the documents from most to least semantically relevant to the query." Mem0: "Apply the managed reranker for better ordering (adds latency)." Supermemory: "If true, rerank the results based on the query." Graphiti: "A Cross-Encoder is a model that jointly encodes a query and a result, scoring their relevance by considering their combined context." |
| How many | How many results come back? | Cohere: top_n, "Limits the number of returned rerank results to the specified value." Letta, Python SDK passage search: "Maximum number of results to return." Mnemoverse (publisher): top_k, "Not a hard cap: association expansion can return more, and the relevance floor can return fewer". |
| Which pool | Which records can come back at all? | Mem0: "Always provide at least a user_id filter to scope searches to the right user's memories." Supermemory: "The namespace scopes results to a user or project." Zep: "A plan step needs one entity type, one edge type, a date range, or one source". Letta: "Filter results to passages created after this datetime". Mnemoverse (publisher): domain, "Filter by domain (null = all)"; since, "Only items whose time is at or after this ISO-8601 instant, inclusive; naive datetimes are read as UTC. Applied to the matched results, so a page can hold fewer than top_k". |
A pool filter may run before candidate selection or after it, on matched results; the second kind can shorten the list, as in Saha's case. Outcome scoring is a lever separate from thresholds and rerankers, and it does different things in different systems; the comparison is on outcome reranking for agent memory.
Start with the pool and the count. That is this page's advice, close to Mem0's: "Start simple with basic search and measure impact before enabling reranking". Read each count setting's description to see whether it is a hard cap, and enforce your own limit on what reaches the model where it matters. Duplicate results covers count settings in more depth.
Calibrate the threshold. Supermemory advises: "Raise the similarity threshold if irrelevant memories keep appearing." That fits weak and unrelated matches. This page's inference from Chroma's definition is that an embedding-similarity threshold is weaker against distractors, because closeness to the question is what makes a distractor. A cutoff also does not travel: "A cosine similarity score has no universal meaning," ji_ai writes, and the fix is to "measure the baseline similarity of unrelated pairs in your corpus, calibrate the threshold on a small labeled set, and recalibrate on every model change." Zep warns that its combined "Scores don't follow a fixed 0-1 scale".
Pair reranking with a cutoff. Ordering alone excludes nothing; a result count after the reranker cuts the list. Cohere recommends choosing a threshold on its scores from pairs with "a document that is considered borderline relevant to the query for your specific use case", using their average score as a reference. Graphiti's SearchConfig includes reranker_min_score. Zep can prune at "the knee of the cross-encoder score curve", but "If the cross-encoder cannot score every result, Zep returns the results without this filter." With a cutoff in place, Anthropic can call reranking "a commonly used filtering technique to ensure that only the most relevant chunks are passed to the model." Check the model too: in one LlamaIndex reranker, the default model "was trained for semantic textual similarity rather than passage re-ranking" (LlamaIndex).
A fact a workflow branch depends on should not be a search result
Some facts need a stronger route than search. Tom Jones gives the rule: "If a branch depends on it, it needs a field." Dimitris Kyrkos explains why: "a looked-up field cannot be outranked by something that merely sounds more relevant." If a miss only means "the response is a little less complete," retrieval "is probably an appropriate reliability tier," he adds in a follow-up. This is advice about decision-critical state, not a claim that fields are always right; decide what happens when the field is missing.
Jones also measured what to return, a different question from memory against a pasted note: "Same retriever, same store, same query, same ranking," and "The only thing that changed was the unit I returned." "Ten ranked chunks scored 9 of 14 tasks correct," while "Handing over the whole document that contained the top-ranked chunk scored 5 of 14," and "Both arms held those figures across two separate runs." He frames it himself: "n is 14, the corpus is private, one judge, one pair of runs" (Jones). For supporting material that is not a decision field, Anthropic describes agents that keep "lightweight identifiers" and "use these references to dynamically load data into context at runtime using tools."
How to test it on your own questions
Ka Ling Wu's article gives a design, not a result: "The test is simple: same model, same questions, and only the context changes."
- Collect real questions and the passage each one needs. For each, pick by hand the passage you would paste and write down the expected answer. Include questions that need memory and questions that do not.
- Run three arms and measure the noise first. Retrieved context, the hand-picked passage, no context; same model, same questions. Repeat every arm: in Jones's runs, "our no-retrieval control read 6 in one run and 4 in the next, so any comparison against it would sit inside its own noise."
- Mix in plausible look-alikes. Wu adds "an outdated version of each metric used, plus a few synthetic look-alikes", because "A look-alike definition that's obviously wrong tests nothing," and advises to "compare confident-wrong rates, not just accuracy."
- Pair every memory with a case where it should stay out. "For every memory that should change an answer, run a near-identical task where applying it would be overreach," Ali Khater wrote under an article by this page's publisher.
- Repeat when the data or the model changes. Wu's advice is to "rerun the test as your data grows"; ji_ai's is to recalibrate on every model change. Run the two separately, so a corpus change is not mistaken for a model change.
If the hand-picked passage works and retrieval does not, inspect the pool, the ranking and the cutoff. If both fail, inspect the passage and the task before blaming retrieval. If the no-context arm wins on a paired case, find out why memory was used there.
What this page does not claim
No benchmark of any system. The three kinds and the two causes are this page's sorting; that an embedding-similarity threshold is weak against distractors is this page's inference from the definition. Chroma measured long inputs to a model, not a retrieval system. Practitioners' figures are their own measurements on their own data, quoted with their caveats. The levers are the vendors' documented settings on the date in Sources; your version may differ.
Common questions
My assistant keeps retrieving irrelevant past context that degrades answer quality over time
Sort what comes back into copies, related passages that do not answer the question, and unrelated text. A threshold trims weak and unrelated matches, copies are a separate problem, and this page infers it is weaker against distractors. Check the search pool and the result count before tuning a threshold or a reranker, then test retrieved context against a hand-picked note and no context on your own questions.
Why does my assistant answer worse with memory than with a pasted note?
A pasted note carries the evidence you chose; retrieval can add look-alikes and unrelated text around it. Chroma found significantly higher performance on focused prompts than on full ones, but it measured long inputs to models, not a retrieval system, and says the evaluation is not exhaustive. Run the same comparison on your own questions.
Does a higher similarity threshold stop irrelevant memories from coming back?
Partly. A threshold compares each record with the query and cuts weak and unrelated matches; Supermemory advises raising it if irrelevant memories keep appearing. This page infers that it is weaker against distractors, which are close to the question by definition. Calibrate it on your own corpus and model.
Does a reranker remove irrelevant results?
Not by reordering alone. A reranker changes the order of the candidates and leaves some out only with a cutoff: a result count after it, a threshold on its scores, or a pruning rule such as Zep's cut at the knee of the score curve or Graphiti's reranker_min_score.
Why does retrieval get worse as my memory store grows?
This page looks at two possible causes: more close records compete for the same question, so the needed one slides down, and a ranking that counts earlier retrievals changes the order by itself. Both are hypotheses to test; a changed embedding model is another thing to rule out. Unwanted writes and outdated records are separate problems.
Sources
All read on 23 November 2026.
Research and context engineering
- Chroma, Context Rot: How Increasing Input Tokens Impacts LLM Performance.
- Anthropic, Effective context engineering for AI agents and Introducing Contextual Retrieval.
- Shi et al., Large Language Models Can Be Easily Distracted by Irrelevant Context; Liu et al., Lost in the Middle: How Language Models Use Long Contexts; Yoran et al., Making Retrieval-Augmented Language Models Robust to Irrelevant Context (abstracts).
Vendor documentation
- LangChain, VectorStore.as_retriever.
- LlamaIndex, Node Postprocessors.
- Cohere, Rerank overview, Rerank API, reranking best practices.
- Mem0, search, search API, advanced retrieval, Memory Decay.
- Zep, searching the graph; Graphiti, searching.
- Supermemory, search, search API reference, infinitely running stateful coding agents.
- Letta, Python SDK passage search.
- Mnemoverse, API reference.
Practitioners
- Tom Jones, the returned-unit measurement and the field rule; Dimitris Kyrkos, why a field cannot be outranked and when retrieval is enough: comments under an article by Dimitris Kyrkos on dev.to.
- Michael Truong, retrieval quality as the store grows and reply to our comment, dev.to.
- Swapnanil Saha, Filtering After Top-k Is a Silent Bug in RAG, dev.to.
- ji_ai, Cosine Similarity Threshold 0.8: Embedding Anisotropy Broke My RAG, dev.to.
- Ka Ling Wu, We tested how much context our analytics agent actually needs, Medium (a test design and expectations).
- Ali Khater, comment under our article, dev.to.
Related
- Why vector search returns duplicate results
- Outcome reranking for agent memory
- How memory APIs prune low-value context
- Rescorla-Wagner and agent memory
- The agent memory write gate
- Why agents need to forget
- Which source should retrieval trust?
- RAG vs agent memory
- Knowledge graph vs retrieval for agent memory
Sources were read on 23 November 2026; the page describes them as of that date.
Who wrote this. Mnemoverse publishes this page and is one of the systems in its lever table, so we are an interested party. Every lever is quoted from the vendor's own documentation on the date in Sources, ours included. Send corrections through contact.
Edward Izgorodin · Mnemoverse · 24 November 2026
