Back to home

Compare

Comparing: Why AI Assistants 'Forget'? Three-Layer Memory: Why More Memory Is Riskier & AI 助手为何总"失忆"? 三层记忆架构告诉你:记太多比记太少更危险

AEN
Agent memorycontext managementRAG·

Why AI Assistants 'Forget'? Three-Layer Memory: Why More Memory Is Riskier

What this is

This week we read Chapter 9 of an Agent engineering doc titled "Memory Systems." It breaks "memory" into three layers and drops a counterintuitive judgment: the "goldfish memory" of most AI assistants is usually not a bug — remembering more is more dangerous than remembering less.

An Agent (an AI program that autonomously executes multi-step tasks) has its memory split into three layers, mirroring human memory models:

  • Short-term memory: current conversation context, cleared at session end
  • Working memory: intermediate state of the current task, cleared at task end
  • Long-term memory: user preferences, historical conclusions, retained across sessions

Core tension: memory design is not a "whether to remember" question but a "what goes in which layer" question. Remembering too much pollutes current judgments (memory noise interference); remembering too little turns the Agent "amnesiac" — giving irrelevant answers, repeating questions. The solution is layering plus on-demand injection: by default only carry a small core of memories, store the bulk externally, and pull them when needed.

Industry view

This architecture explains why most current AI assistants feel like goldfish — they usually only get the first layer (short-term) right; the second and third are either absent or roughly implemented. That's why you have to re-explain context every time you start a new session.

The author emphasizes a counterintuitive principle: better sparse than polluted. Memory is a scarce resource (it eats into the context window), and wrong or stale memories are worse than none. This runs counter to most product teams' instincts — they tend toward "remember everything you can," flooding the context with noise.

Dissent / risks: some argue that instead of engineering a complex three-layer memory, you can just use RAG (Retrieval-Augmented Generation — having the AI search a knowledge base first before answering) to replace long-term memory. But the author sees them as complementary, not substitutes: RAG handles "knowledge queries," memory handles "individual user continuity" — different use cases.

Another frequently overlooked risk: long-term memory requires expiration mechanisms and capacity caps, or it grows unbounded. Before writing, you must also scrub for PII (phone numbers, emails, etc.) and run permission checks — otherwise you've left the door open for data leaks.

Impact on regular people

  • For enterprise IT: when evaluating AI customer service or digital employees, make "how is the memory architecture designed" a mandatory question — this is the technical line that separates "toy" from "tool."
  • For individual professionals: why doesn't your current AI tool remember project context? Because most only ship the shallowest layer. When choosing a tool, this is a question worth asking the vendor directly.
  • For the consumer market: don't expect AI assistants to "remember everything" — there are technical ceilings. It's more realistic to expect them to "remember key preferences and commitments"; record the rest yourself.
Source: juejin.cn
BZH
Agent 记忆上下文管理RAG·

AI 助手为何总"失忆"? 三层记忆架构告诉你:记太多比记太少更危险

这是什么

这周读到一份 Agent 工程文档第 9 章「记忆系统」,里面把"记忆"拆成三层——还抛出一个反直觉判断:AI 助手的"金鱼记忆",多数时候不是 bug,记太多比记太少更危险

Agent(能自主执行多步骤任务的 AI 程序)的记忆被拆成三层,对应人类记忆模型:

  • 短期记忆:本次对话上下文,会话结束即清空
  • 工作记忆:当前任务的中间状态,任务结束清理
  • 长期记忆:用户偏好、历史结论,跨会话保留

核心矛盾:记忆设计不是"记不记"的问题,而是"什么放哪层"。记太多会污染当前判断(记忆噪音干扰),记太少 Agent 会"失忆"——答非所问、重复提问。解法是分层 + 按需注入:默认只带少量核心记忆,大量记忆存在外面、用时再取。

行业怎么看

这套架构解释了为什么当前绝大多数 AI 助手用起来像金鱼——它们往往只做好了第一层(短期),第二三层要么没做、要么做得粗糙。所以你每次开新会话都要重新交代背景。

作者强调一个反直觉原则:宁缺毋滥。记忆是稀缺资源(要占上下文窗口),写错/写废的记忆比没有更糟。这跟多数产品团队的直觉相反——大家倾向于"能记就记",结果上下文被噪音淹没。

反对意见 / 风险:有观点认为,与其搞复杂的三层记忆,不如直接用 RAG(检索增强生成——让 AI 先从一个知识库里查资料再回答)替代长期记忆。但作者认为二者是配合关系而非替代:RAG 解决"知识查询",记忆解决"用户个体延续",场景不同。

另一个常被忽视的风险:长期记忆需要过期机制和容量上限,否则会无限膨胀;同时写入前必须做脱敏(手机号、邮箱等个人信息)和权限校验,否则就是给数据泄露留口子。

对普通人的影响

  • 对企业 IT:评估 AI 客服或数字员工时,把"记忆架构怎么设计"列为必问项——这是区分"玩具"和"工具"的技术分水岭。
  • 对个人职场:你现在用的 AI 工具为什么记不住项目背景?因为大多数只做了最浅一层。选工具时,这是一个值得直接问供应商的问题。
  • 对消费市场:别指望 AI 助手"什么都记住"——技术上限在那里。期待它"记住关键偏好和承诺"更现实,其余该自己记录。
Source: juejin.cn