T
traeai
登录
返回首页
mem0(@mem0ai)

Mem0 推出记忆衰减功能:让AI记忆更懂时间

9.0Score
Mem0 推出记忆衰减功能:让AI记忆更懂时间

TL;DR · AI 摘要

Mem0推出记忆衰减功能,通过时间感知排序机制,让近期记忆优先呈现,解决长期运行AI的噪声问题。

核心要点

  • 记忆衰减使用0.3×至1.5×权重调节,实现新鲜度感知排序。
  • 支持通过仪表盘或SDK一键开启,无需重索引。
  • 旧记忆仍可返回,但仅在高度相关时才靠前显示。

结构提纲

按章节快速跳转。

  1. 长期运行的AI代理面临记忆过载问题,所有记忆默认等权重导致当前上下文被淹没。

  2. 引入时间感知的软重排序机制,使近期访问的记忆获得优先展示,提升相关性。

  3. 每个记忆记录最近20次访问时间戳,搜索时根据时效性生成0.3×至1.5×的权重系数。

  4. 无需重索引,API兼容性保持不变,搜索延迟不受影响,历史记忆自动补全初始状态。

  5. 适用于代码助手、个人助理和客服机器人,显著提升对最新上下文的响应能力。

思维导图

用一张图看清主题之间的关系。

查看大纲文本(无障碍 / 无 JS 友好)
  • Mem0 记忆衰减机制
    • 核心目标
      • 解决长期记忆噪声问题
      • 保持历史记忆可用性
    • 技术实现
      • 基于访问时间戳的权重调节
      • 0.3×~1.5×动态缩放因子
      • 无需重索引,无侵入式更新
    • 应用价值
      • 提升上下文相关性
      • 优化代码/客服/助手场景

金句 / Highlights

值得收藏与分享的关键句。

  • Nothing gets deleted or hidden, old memories can still surface when they are genuinely relevant, but long-running agents no longer treat every stored fact as equally important forever.

    第 2 段

    ⬇︎ 下载 PNG𝕏 分享到 X
  • The lowest scaling factor a memory can pick up is 0.3×, which means stale memories still come back when they're the best match for a query.

    第 4 段

    ⬇︎ 下载 PNG𝕏 分享到 X
  • A memory accessed today can pick up a 1.5× boost. One that's been sitting untouched for weeks gets dampened toward 0.3×. That's a 5× spread between fresh and stale.

    第 6 段

    ⬇︎ 下载 PNG𝕏 分享到 X
#AI Agent#Memory Management#Mem0#Time-Aware AI#Search Ranking
打开原文

Most agent memory systems are built to remember. But long-running agents need something harder: knowing what still matters. Memory without time becomes noise. That’s why we built Memory Decay.

Today, we’re introducing Memory Decay in Mem0, a new way to make agent memory stay useful as it grows. Memory Decay adds recency-aware ranking to search, so memories that have been accessed recently get a soft boost, while memories that have been idle for a while gently move lower in the results.

Nothing gets deleted or hidden, old memories can still surface when they are genuinely relevant, but long-running agents no longer treat every stored fact as equally important forever.

AI memory has a freshness problem.

The longer an AI app runs, the more it remembers. That sounds useful, until old details start competing with the things that matter right now. A breakfast order from this morning, a project from last week, and a preference from six months ago can all sit in memory with the same weight. For short demos, that is fine. For long-running agents, it gets noisy.

Memory Decay is the fix.

It's a soft re-rank, not a filter. The lowest scaling factor a memory can pick up is 0.3×, which means stale memories still come back when they're genuinely the best match for a query. They just sit lower in the order. Nothing gets hidden, nothing gets deleted.

This feature make Mem0’s memory layer more time-aware: recent context is easier to surface, and old facts can remain available without competing as if they are still current.

History stays in memory. The present gets ranked correctly

Memory Decay is a per-project toggle that automatically biases search ranking toward r ecently-used memories. Every memory carries a quiet record of when it was last retrieved. At search time, that history becomes a scaling factor on the relevance score: recent memories get a boost, idle ones get gently dampened.

Image 1: Image

Figure 1: Memory Decay Toggle

The lowest scaling factor is 0.3×, stale memories still surface when they're the best match for a query, they just sit lower in the ordering.

Nothing your customer ever wrote disappears.

How to enable

Memory Decay can be enabled directly from the Mem0 dashboard:

  1. Go to the

dashboard

  1. Click Settings → Instructions
  1. Toggle on Memory Decay

Decay is now active for the project. Memory Decay can also be enabled programmatically through the Mem0 SDK:

Python

python

code
from mem0 import MemoryClient

client = MemoryClient(api_key="your-api-key")

# Turn decay on for this project
client.project.update(decay=True)

# Searches now return recency-biased rankings.
client.search("what does the user want for breakfast?", user_id="alice")

Node.js

javascript

code
import { MemoryClient } from "mem0ai";

const client = new MemoryClient({ apiKey: "your-api-key" });

await client.project.update({ decay: true });
await client.search("what does the user want for breakfast?", { user_id: "alice"});

Decay works without reindexing or migration, and your existing add or search code stays the same. Disable it at any time with decay: false.

A memory accessed today can pick up a 1.5× boost. One that's been sitting untouched for weeks gets dampened toward 0.3×. That's a 5× spread between fresh and stale, which is enough to meaningfully reorder candidates without ever swamping the underlying relevance score. Strong matches still win even when they're old.

Under the hood:

  • Each memory tracks up to its last 20 access timestamps.
  • At search time the candidate pool widens slightly so the scaling factor has room to reorder before truncation.
  • The public score stays clamped to [0, 1] so existing API contracts hold.
  • Reinforcement runs fire-and-forget on a bounded executor, so search latency does not change.
  • For memories that pre-date the toggle being on, the last-update timestamp serves as a fallback. They get a fair starting point on the first search after the flag flips, then accumulate access history naturally as they're surfaced again.

Storage, embeddings, categories, metadata: all untouched. Decay is a search-time concern only, which is why turning it on doesn't require any of the painful operations.

Here are a few concrete ways you’ll feel the difference:

  • Coding agents: Keep the current sprint’s context on top, instead of resurfacing details from an old side project.
  • Personal assistants: Prioritize what the user has been doing lately, like this month’s breakfast routine, not a one-off cafe from last year.
  • Support bots: Surface recent, relevant tickets first, so a resolved issue from a year ago does not drown out what is happening now.
  • Category-aware weighting, where a fact tagged health carries more weight than a passing observation tagged misc. Important categories shouldn't be dampened the same way as noise.
  • Per-project auto-tuning, where Mem0 learns how aggressively to scale based on each project's actual access patterns. The fixed band gets replaced by one that fits each workload.

Both ship as in-place updates. If you have Memory Decay on today, you'll pick up the new behavior automatically. No migration on your side. Read more on

.

  • Will Decay ever drop a memory from results?

No. The lowest scaling factor is 0.3×. It can pull a memory's score down but never zero it out. Anything that would have surfaced without Decay can still surface with Decay on.

  • What about memories from before I turned it on?

They get a fallback. Their last-update timestamp counts as a single past touch, so they get a fair starting point on the first search after the flag flips. From there, access history accumulates naturally.

  • Why does my score sometimes come back below my threshold?

Threshold filtering happens before the scaling factor is applied. A stale-but-relevant candidate that just cleared the threshold can come back with a final score slightly under it. The candidate stays visible but visibly dampened. If you need a hard floor on the response, filter client-side after the call.

  • Does it slow down add?

No. The add API is unchanged. Decay only affects search-time ranking.

  • Can I tune how aggressive it is?

Not in this release. The scaling band is calibrated to be conservative across workloads. Per-project tuning is on the roadmap.

Mem0 is an intelligent, open-source memory layer designed for LLMs and AI agents to provide long-term, personalized, and context-aware interactions across sessions.

  • Get your free API Key here :
  • or self-host mem0 from our open source

AI 可能会生成不准确的信息,请核实重要内容