Agents Are Stuck in a Loop: Memory Growth and Propagation ✍ Siddharth🕐 2026-04-20📦 12.9 KB 🟢 已读 𝕏 文章列表 文章深入探讨了 AI Agent 面临的记忆系统瓶颈:无限记忆增长(UMG)导致检索效率低下和噪声干扰,以及虚假记忆传播(FMP)利用思维链错误放大幻觉。作者指出现有的 RAG 系统因读写混合而加剧了该问题,并提出可以借鉴强化学习(RL)机制,根据任务验证结果对记忆进行奖惩打分,从而过滤无效记忆。 AgentLLMMemoryRAGReinforcement LearningHallucinationMemGPTCoT # Agents Are Stuck in a Loop. Memory Growth and Propagation is why ! **作者**: Siddharth **日期**: 2026-04-19T16:33:38.000Z **来源**: [https://x.com/Pseudo_Sid26/status/2045903661042479135](https://x.com/Pseudo_Sid26/status/2045903661042479135) ---  Agents are in an unapologetic loop. They somehow never have the right memory and the bandwidth. You give them a long task, they hallucinate something mid way, store it, retrieve it later, and now that hallucination is load bearing. That's not a model problem. That's a memory problem. These 2 problems are the main bottlenecks when it comes to agent memory at scale: Uncontrolled Memory Growth: memory continues piling up without intelligent eviction, causing the entire system to choke because of too much history. False Memory Propagation: after storing one single false fact, this piece of information will repeatedly be retrieved and reinforced, and before you know it, the agent ends up being absolutely certain about anything and everything. Lets discuss both of these problems in detail with simple intuitions, as well as a list of other reasons why this keeps happening. ## Memory in Agents: A Quick Preview When people say agent memory they usually mean one of three things. > Firstly, there’s in context memory – the prompt window. > Secondly, there’s external memory, e.g., a vector database, an offloaded file generated by the agent itself. > Thirdly, there’s parametric memory – memories acquired via the learning process and thus cannot be updated while the agent runs. Production agents today rely primarily on the first two types, having a window of rolling context along with a retrieval store for the older information. This sounds reasonable until you realize neither system has good answers for what to forget, what to trust, or what to do when something wrong gets stored. The MemGPT paper is one of the few serious attempts at thinking about this as a real systems problem. They treat the LLM as a CPU and memory tiers as explicit architectural components. Worth reading if you haven't. The core insight is that you need deliberate memory management, not just a naive one.  ## Uncontrolled Memory Growth (UMG) This is how most agent pipelines work in reality. Every action, every tool output, every intermediate idea ends up stored in the memory bank. Nothing is ever forgotten. The logic is that the more context there is, the better. No way !!!! It leads to excessive noise, slows down retrieval, and ultimately leads to retrieving obsolete information in place of relevant new data. > Vectors do not have expiry. Embeddings keep on accumulating infinitely, while older embeddings get further away from being relevant. > Retrieval time will increase linearly with the size of the vector store, particularly when performing long-running multiple-step agent workloads. > Outdated information does not simply lie dormant. Instead, it comes to light through query embeddings that inadvertently retrieve stale information, corrupting present-day inference processes. > There is no intrinsic notion of this information is now outdated in many information retrieval systems. Intuition: It often happens with us that we start making notes from the very first lecture in clg, a lot of those notes are rough, irrelevant, sometimes from different course too in the same notebook. Later on during exams, when we search for the right note, we struggle finding it, this is a classical example of uncontrolled memory in agents, the context starts to rot and finding appropriate answers from the context pool becomes difficult. ## False Memory Propagation (FMP) The FMP approach is more sophisticated and actually more frightening. First, there is one piece of information that is simply false. Perhaps the machine imagined some result from a tool call operation. Perhaps a user entered erroneous input. Perhaps the API provided bad data. For whatever reason, this false fact is recorded in memory. On the next recall, it comes out. It is used to reason about other things. The entire process is saved in memory. The Chain of Thought paper shows that reasoning chains dramatically improve accuracy. But there's a flip side nobody talks about. If the initial stage of the process chain was incorrectly formed and this stage turns out to be a part of memory, all subsequent processes will inevitably include the mistake. CoT acts as a power magnifier both for right and for wrong logic.  > It is not failure in appearance for FMP. The agent is certain, consistent, and totally wrong. > The more time the agent spends executing, the more ingrained the false memory becomes in the ranking of recall. > Standard measurement tools cannot detect this as they test only final results and not internal states. Intuition: Now, for me there is a very interesting intuition for this and we all have experienced this. Sometimes we write an exam and we copy some formula from someone else, or we do a project and someone does a certain calculation somewhere. Without confirming we move on and and eventually now everyone is using the wrong formula or calculated value. This is what false memory propagation in agents is, one wrong context or memory and it all scrambles. ## Why RAG Makes This Worse, Not Better Everyone falls back on RAG for memory. Of course, it's simple and elegant in concept. Find relevant documents, ground the generation, avoid hallucinations. It's perfect for cases where your knowledge base is carefully curated and static, like an internal corporate wiki or a set of legal documents. The issue lies in the fact that agents write into their retrieval databases. This is the fundamental flaw with the approach. Instead of sourcing information from a separate and pure data set, your retriever is now reading from a database that your agent has been writing to, possibly containing mistakes from past queries. > Ground truth is an assumption in RAG that the retrieval corpus holds. The agent memory is not ground truth; rather, it is the ongoing transcript of the agent’s thoughts. > Factual accuracy is not embedded in similarity. Two memories, one erroneous and one accurate, can be extremely similar if they fall under the same topic. > Each retrieval of the agent loop where a mistaken memory pops up is a signal of validation for that memory as well. ## RL as a Fix for FMP This is a dimension that is often overlooked by most individuals. In the case where FMP is a reinforcement problem, perhaps the solution to the problem can also be approached from the perspective of a reinforcement problem. In this regard, it will be possible to approach the validation of memories as a reward signal. When the agent uses a memory and applies it in a step in the reasoning process, the result of the step becomes the feedback to indicate the validity of the memory used. When the step results in the production of verifiable results, the agent increases the confidence score of the memory. However, when the step fails, the memory receives penalties and may be deleted. The InstructGPT paper laid out the RLHF framework for aligning model outputs with human preferences through reward modeling. The same logic extends naturally here. You're not scoring model outputs, you're scoring memory entries based on how reliable they prove to be over time.  > Reward signal is obtained from successful completion of the task, corrections made by the user, or verification of results with a known source. > Memories with low confidence ratings are not used for recall or are even deleted, interrupting the feedback cycle. > This system demands that each memory be uniquely identifiable and assessable, something current pipelines cannot provide. ## File-Based Memory as a Starting Point Before getting into building the full graph memory system, it is useful to implement a file based memory system first. The logic here is rather straightforward. While vector appending will do fine in the case of raw memories, adding structured memories to files that contain meta-information can be more beneficial. In particular, the metadata includes a timestamp, the importance of the memories, its source, and the level of certainty. As an example of how well it works in practice, the Generative Agents paper can be referenced. Namely, the memory stream they used included an importance score for the memories based on their relative importance according to the agent's perspective. Recall was then performed using the parameters of recency, importance, and relevance. > Metadata aware retrieval lets you filter out old or low-confidence memories before they even enter the ranking stage. > JSONL format keeps it auditable. You can inspect, debug, and manually correct memory entries, something you can't easily do with a black box vector store. > The access count field lets you track which memories are being retrieved most, which is a proxy for influence on agent behavior. ## Graph Memory as the Real Upgrade File based memory systems are decent. Graph-based memory systems are better. List-based memory systems treat each memory as separate data, which means they lack relational memory. User prefers Python and user's project uses asyncio are two separate memories that are related to each other. Storing and retrieving these two memories separately will mean that their relationship cannot be determined at retrieval time. Graph-based memory systems are based on the concept of nodes. Nodes represent the memories, while edges represent relations between memories. Relations include contradiction, dependency, derivation and updates. Retrieving any node also means traversing the edges, meaning you always get relational context and contradictions at retrieval time. > Detection of contradiction happens structurally, whereby the introduction of memory whose edge is marked contradicting will alert the system to do an investigation rather than overwriting it silently. > Using graph traversal helps achieve richer results through retrieval without having to increase the number of similarity queries. > MemoryBank proves that graph structured memory enables agents to retain far more consistent personae and factual information than would be the case with flat retrieval systems. > The derived from edge becomes particularly helpful in detecting FMPs because one wrong root memory generates several other memories that may need pruning. ## The Context Window is Not Your Friend Here People think bigger context windows solve memory problems. They don't. A 1M token context window just means you can fit more potentially wrong information in one shot. The retrieval problem doesn't disappear. It shifts. Instead of deciding what to retrieve, you're now deciding what to include in a very long prompt, and the model has to figure out what's relevant inside that wall of text. The Lost in the Middle paper showed something uncomfortable. LLMs perform significantly worse at using information that appears in the middle of long contexts compared to information at the start or end. So even if you dump everything into context, the model is not treating all of it equally. Position matters. Recency matters. The retrieval problem just moved inside the context window.  > Long context is merely a cheat to delay the problem, without addressing it. > The middle part of the context is automatically undervalued, meaning that any important memory stored there will simply be overlooked. > Intelligent external memory with selective recall always beats context dumping for complex multi stage processes. CONCLUSION The bottleneck for agents is not computation; it’s epistemology. An agent that can’t tell the difference between what it knows and what it believes itself to know cannot be trusted. UMG inflates the search space. FMP contaminates the data source. RAG pulls from a poisoned source. And a wider context simply means more poison to work with. The solution is not going to come from one research paper or even one framework. It comes from taking agent memories seriously, just like we take database management seriously. Schemas, validation processes, eviction strategies, scoring algorithms, audits. Until we do that, agents will continue to loop around, confidently but mistakenly. ## 相关链接 - [Siddharth](https://x.com/Pseudo_Sid26) - [@Pseudo_Sid26](https://x.com/Pseudo_Sid26) - [35K](https://x.com/Pseudo_Sid26/status/2045903661042479135/analytics) - [Upgrade to Premium](https://x.com/i/premium_sign_up) - [12:33 AM · Apr 20, 2026](https://x.com/Pseudo_Sid26/status/2045903661042479135) - [35.4K Views](https://x.com/Pseudo_Sid26/status/2045903661042479135/analytics) - [View quotes](https://x.com/Pseudo_Sid26/status/2045903661042479135/quotes) --- *导出时间: 2026/4/20 14:49:30*
M Memory Transfer Learning for Coding Agents 技术解析 本文深入探讨了一篇关于编码智能体的 Memory Transfer Learning (MTL) 论文。文章解释了如何将过往编码任务的“记忆”复用到新任务中,比较了 Trajectory、Workflow、Summary 和 Insight 四种记忆格式的效果。研究通过在多个基准测试中复用异构记忆池,证明了提取的元知识能有效提升智能体解决新问题的能力。 技术 › Agent ✍ AVB🕐 2026-04-21 AgentLLMMemoryTransfer LearningCoding AgentRAGReinforcement Learning论文解读
A Agent 的数据面概念扫盲-建立技术侧认知体系 本文深入解析了 Agent 数据面的核心概念,将其比作操作系统的内存管理单元。文章详细阐述了 Context Engineering 的演变、Session/Thread/Profile 的架构差异,以及 Session Memory 与 Long-term Memory 的区别。作者还重点介绍了 Hermes 中的 Memory 设计方案、SQLite FTS5 与 BM25 算法原理,以及向量检索与关键词检索在 RAG 中的混合应用,旨在为开发者建立一套完整的 Agent 数据面技术认知体系。 技术 › Agent ✍ MateMatt🕐 2026-07-12 AgentContext EngineeringRAGMemoryBM25SQLite FTS5向量检索HermesLong-term MemoryLLM
A Agent Memory Framework: Remember, Cite, Forget 本文提出了一个智能体记忆系统的可靠框架,该框架需同时完成三个核心任务:记住该记的、引用可信的、遗忘过期的。文章详细介绍了记忆的六个层级(如会话状态、项目记忆、索引检索等),阐述了如何通过权威排序解决冲突,并强调了通过硬过期、双时序或软衰减等机制让旧记忆失效的重要性。 技术 › Agent ✍ Vox🕐 2026-05-23 AgentMemoryRAGLangGraphMem0ZepGBrainLLM系统架构工程实践
A Agentic Memory: 详解 Agent 记忆系统的架构与实现 文章通过生动的类比,指出缺乏记忆是当前 LLM Agent 的主要短板。作者详细拆解了 Agent 记忆系统的三个核心功能:连续性、上下文和学习。文章重点介绍了四种记忆类型:上下文记忆、外部记忆、情景记忆和参数记忆,并深入探讨了如何通过检索增强(RAG)和反思循环来构建持久的智能。 技术 › Agent ✍ Ramakrishna (techwith_ram)🕐 2026-05-17 AgentLLMMemoryArchitectureRAGVectorStoreContextEpisodic向量数据库系统设计
A Agent Memory Engineering 文章探讨了 AI Agent 的记忆机制,解释了为何不同 Agent(如 Claude Code 和 Codex)之间无法直接通过复制文件来迁移记忆。作者指出,这是因为模型在后期训练时与特定的记忆层“融合”了。文章对比了 Hermes、Codex CLI 和 Claude Code 三种实现,并得出结论:最聪明的架构(如向量数据库、知识图谱)输给了最简单的方案(LLM + Markdown + Bash 工具)。核心在于 Agent 遵循的读写规范,而非数据结构本身。 技术 › Agent ✍ Nicolas Bustamante🕐 2026-05-02 AgentMemoryLLMEngineeringClaude CodeCodexRAGPost TrainingMarkdownHermes
W Why Karpathy’s Second Brain Breaks at Agent Scale. How Mercury Solves It. 本文探讨了 Andrej Karpathy 的 LLM Wiki 工作流在人类“第二大脑”场景下的优势,指出其在处理 AI Agent 时的局限性。文章强调,人类记忆优先考虑可读性和反思,而 Agent 记忆系统则需要快速检索、低 Token 成本和冲突解决。Mercury 提出的混合架构方案,主张使用 Markdown 作为人类界面,同时采用结构化内存作为 Agent 的底层设施,以实现上下文的持续累积和可靠运行。 技术 › Agent ✍ Zaid🕐 2026-04-29 AgentMemoryLLMKarpathyRAGMercuryArchitectureSecond BrainDesign
A AI 记忆工具两大阵营:Memory Backends 与 Context Substrates 文章深入分析了 GitHub 上的 AI Agent 记忆工具,将其分为两大阵营:一是“记忆后端”,如 Mem0 和 Supermemory,主要提取事实并存储于向量数据库;二是“上下文基底”,如 OpenClaw,通过人类可读的结构化文件让会话在上下文中累积。作者指出,虽然 Camp 1 主导了市场,但 Camp 2 的架构才是支持连续、多会话工作的未来方向,例如 Zep 已开始从“记忆”转型为“上下文工程”。 技术 › Agent ✍ witcheer🕐 2026-04-17 AgentOpenClawMem0ContextMemoryRAGLLM向量数据库知识图谱
本 本周顶级 AI 论文精选 文章精选了本周 6 篇顶级 AI 论文,涵盖 Harness Handbook、MSCE 记忆技能框架、PRO-LONG 长程记忆机制、Anthropic 全局工作空间解释性研究、Meta 的 GAMUT 完整性基准测试以及渐进式披露模式。 技术 › LLM ✍ DAIR.AI🕐 2026-07-27 AI论文AgentMemoryInterpretabilityAnthropicMetaLLMResearch
2 2026年如何成为AI工程师(无需CS学位) 文章指出2026年AI工程师角色已分化为机器学习工程师和应用AI工程师。对于非CS学位求职者,后者是主要机会。文章详细列出了必备技能(Python、LLM行为、RAG系统、评估观测),并提出了三个能替代学历证明的实战项目建议。 技术 › LLM ✍ Harman🕐 2026-07-24 AI工程师职业发展RAGLLMAgentPrompt无学位
A Agent Wikis 的现状与发展 文章探讨了 LLM Wiki 模式的兴起,即通过在摄取时编译知识而非查询时检索,解决传统 RAG 无法积累知识的问题。介绍了 Cognition、FactoryAI、LangChain 等团队构建的 Agent Wiki 系统,分析了其架构原理及在维护成本上的优势。 技术 › Agent ✍ mem0🕐 2026-07-22 LLMAgentWikiRAGCognitionLangChainDeepWikiAutoWiki
从 从 CoT 到 ReAct:用 Python 搭建 LLM Agent 实战指南 本文通过 Python 演示了如何搭建一个具备规划、工具调用、验证和复盘能力的完整 LLM Agent。教程详细拆解了 Plan-and-Solve、ReAct、Verification、Self-Refine 和 Reflexion 五个核心模块,强调了结构化数据控制流程的重要性,并提供了工程落地的具体代码实现与原则。 技术 › Agent ✍ Mr Panda🕐 2026-07-19 LLMAgentPythonReActCoT工程实践ReflexionPrompt Engineering教程
写 写作即编排——当方法论指向自己 本文是“AI时代的知识编排”系列收官之作。作者回顾了利用AI与结构化知识库高效产出技术博客的实践,发现写作过程本身遵循着“文档驱动”(SDD)的逻辑。文章通过信息论、认知科学及实证数据论证了结构化输入的重要性,并指出知识编排已成为AI时代内容生产的生存必需,强调了核查与人工判断不可替代。 技术 › AI ✍ SagaSu🕐 2026-07-16 AI知识编排写作方法论SDDRAG结构化输入信息核查AgentLLM