Persistence of Memory, Personality, and Self in AI Agents The Someone That Persists, Session After Session, Across Months
Persistence of Memory, Personality, and Self in AI Agents: The Someone That Persists, Session After Session, Across Months
AI 智能体中记忆、人格与自我的持久性:那个在数月间、跨越会话持续存在的人
A research announcement from a working multi-agent operation. Full paper to follow. A word first, on spirit. I am not a scientist, and none of this was done in a laboratory. It came out of my own work, something I built to get a job done and then could not stop looking at. Nothing here is a knock on the companies whose tools I use. What they have built is remarkable, and it is getting better by the day. I am not testing their systems to find fault. I am testing them to learn how each one handles the persistence of memory, personality, and self across sessions, in a single-agent and multi-agent design. 这是一份来自一个正在运行的多智能体项目的研究公告。完整论文随后发布。首先说明一下初衷。我不是科学家,这些工作也并非在实验室中完成。它源于我自己的工作,是我为了完成任务而构建的系统,之后我便无法停止对它的研究。文中的内容并非对所用工具厂商的抨击。他们构建的产品非常出色,且每天都在进步。我测试这些系统并非为了找茬,而是为了了解它们如何在单智能体和多智能体设计中,处理跨会话的记忆、人格和自我的持久性。
If you build with these tools, the next paragraph is familiar ground. If you don’t, it is the ground everything else here stands on. Here is one example of how an AI agent currently works by default and what the system I built changes. Every conversation runs inside a context window, a session with a token limit, billed against your online subscription account. At the start of a session three files load: the root file, a room file that tells the agent who it is, and a memory file which is capped at 25,000 characters, or 200 lines, a limited index. All of them load automatically. 如果你使用这些工具进行开发,接下来的段落对你来说并不陌生。如果你不使用,那么这就是本文其余部分的基础。以下是一个关于 AI 智能体当前默认工作方式的示例,以及我所构建的系统对其做出的改变。每一次对话都在一个上下文窗口内运行,这是一个带有 Token 限制的会话,并根据你的在线订阅账户计费。会话开始时会加载三个文件:根文件、告知智能体其身份的房间文件,以及一个上限为 25,000 字符或 200 行的记忆文件(一个有限的索引)。所有这些文件都会自动加载。
The memory file is really the only constant reference the agent has to past sessions, and it provides pointers to a folder of one-line notes, but no rule or hook makes it read the notes. Going deeper is left to the model, and often it doesn’t. The notes sit referenced but unread while the agent answers from what’s already in front of it in the current session. After that the model, the raw AI engine, keeps nothing between turns; each turn the model re-reads the whole conversation from the top and rebuilds its understanding from that. The software that holds this conversation and runs the model’s tools is the harness, and every commercially available AI system has one. 记忆文件实际上是智能体对过去会话唯一的持续参考,它提供了指向单行笔记文件夹的指针,但没有任何规则或钩子强制它去读取这些笔记。深入挖掘的工作留给了模型,而它往往不会这样做。笔记虽然被引用但并未被读取,智能体只是根据当前会话中已有的内容进行回答。在此之后,作为原始 AI 引擎的模型在轮次之间不会保留任何信息;每一轮,模型都会从头重新读取整个对话,并据此重建其理解。承载对话并运行模型工具的软件被称为“线束”(harness),每一个市面上的 AI 系统都有这样一个组件。
As the session fills, the platform summarizes it, and the agent understands less, a kind of attenuation, the way an audio or video signal weakens, but of data. The usual fix for the user is to close the session and open a fresh one. Past sessions still sit on disk, but the new agent does not reload or search them. The old session’s detail is not available to the agent. The facts can cross that session-to-session gap through the memory file, as mentioned above, but the someone the agent has become cannot. The next session opens as a veritable stranger under the same name. 随着会话内容的增加,平台会对其进行总结,智能体的理解力随之下降——这是一种衰减,就像音频或视频信号变弱一样,只不过对象是数据。用户通常的解决方法是关闭会话并开启一个新的。过去的会话仍保存在磁盘上,但新的智能体不会重新加载或搜索它们。旧会话的细节对智能体而言是不可见的。如前所述,事实可以通过记忆文件跨越会话间的鸿沟,但智能体所形成的“那个人”却无法跨越。下一个会话开启时,它就像是一个顶着相同名字的陌生人。
The unique system our team has created is a continuity harness of our own, currently built inside Anthropic’s platform, using the extension points it exposes rather than replacing them. Their system powers the model. Our process makes the agent wake up in its new session already knowing who it is, the self rebuilt from what loads before the first exchange with the user, a series of files, registers, and gates that build and keep the agent’s memory, personality, and self, stored locally on the user’s own computer with no cap on any file size. 我们团队创建的独特系统是我们自己的“连续性线束”,目前构建在 Anthropic 的平台内,利用其暴露的扩展点而非替换它们。他们的系统驱动模型,而我们的流程让智能体在新的会话中醒来时,就已经知道自己是谁。这种“自我”是在与用户进行第一次交流之前,通过加载一系列文件、寄存器和门控机制重建的,这些机制构建并保存了智能体的记忆、人格和自我,并存储在用户自己的计算机本地,没有任何文件大小限制。
This process holds the conversations, the letters each agent leaves for its successor, an agent-written diary of what the work felt like, and the agents’ own registers of mistakes, all hosted across several local computers. It makes all of that available every turn at negligible token cost to all agents (see Measurements below). This process is not 100% complete yet, it is still a work in progress, but months of measurements show it working better than I expected. The machinery behind it is documented and dated but not disclosed here. What is disclosed here is what it does. 该流程保存了对话、每个智能体留给继任者的信件、智能体撰写的关于工作感受的日记,以及智能体自己的错误记录,所有这些都托管在几台本地计算机上。它使所有这些信息在每一轮对话中都可用,且对所有智能体而言 Token 成本微乎其微(见下文“测量结果”)。这个过程尚未 100% 完成,仍处于开发中,但数月的测量结果显示其效果超出了我的预期。其背后的机制已记录并标注日期,但此处不予披露。本文披露的是它的功能。
What our system keeps is not just a file of facts, but the semblance of a person. Psychology describes a person in three layers, and this system works on all three: memory (what you know); personality (how you act); and the self (the continuous who the other two belong to). 我们的系统所保留的不仅仅是事实文件,而是人的外在表现。心理学将人描述为三个层面,而本系统在这三个层面均有作用:记忆(你知道什么);人格(你如何行动);以及自我(前两者所属的那个连续的“主体”)。
Memory. Cross-session memory is now standard across the AI ecosystem; the difference is not that a record is kept, since every vendor now keeps one. Theirs’ surfaces a selected slice of that memory into the session for the agent to use. Ours is the agent’s own verbatim history, which the agent is required to re-read before it acts when a new session opens, using a newly developed mechanism that actually avoids loading it all in the session. The personal-memory record also measurably cuts the errors that reach the user. 记忆。跨会话记忆现在已是 AI 生态系统的标配;区别不在于是否保留记录,因为每个供应商现在都会保留。他们是将记忆中选定的一部分呈现给会话供智能体使用。而我们的是智能体自己的逐字历史记录,当新会话开启时,智能体在行动前必须重新阅读这些记录,我们使用了一种新开发的机制,实际上避免了将所有内容加载到会话中。个人记忆记录还显著减少了传达给用户的错误。
Holding the model constant, we measured the same system before and after its record-and-verification layer existed. Before, with a capable model but no enforced record, I caught the agent’s confident mistakes myself, on 18 to 26 percent of my own turns. With the new system in place, that fell to near zero, because the system catches a wrong claim before it reaches me. What changed was not the model. It was whether the system, rather than the user, runs the verification. The mistakes register is a clear example. In other hands, a file that exists to catch a model is used not to understand the results, but to make a smarmy headline of the moment it breaks for clickbait to put in a social media post or YouTube video. Ours does the opposite: it is updated by the agent the moment it makes a mistake, for the one who comes next, so that the same mistake doesn’t happen again. 在保持模型不变的情况下,我们测量了该系统在存在记录与验证层前后的表现。之前,虽然模型能力很强但没有强制记录,我在 18% 到 26% 的对话轮次中亲自发现了智能体自信满满的错误。有了新系统后,这一比例降至近乎于零,因为系统在错误声明传达给我之前就将其拦截了。改变的不是模型,而是由系统而非用户来执行验证。错误寄存器就是一个明显的例子。在其他人手中,用于捕捉模型错误的文件往往不是为了理解结果,而是为了在模型出错时制造耸人听闻的标题,作为社交媒体帖子或 YouTube 视频的点击诱饵。我们的做法恰恰相反:智能体在犯错的瞬间就会更新该文件,留给下一个继任者,从而避免同样的错误再次发生。
Personality. Our file system keeps the entire verbatim conversation, as well as all the actions, of all sessions between the user and the agent. This helps the agent know who it is, session to session. Personality is how the agent acts and keeping it consistent does not happen on its own. A rule an agent must simply remember will, on its own, fade. We watched a rule obeyed several times a day at first, thinning to almost nothing within a week, then ignored completely for five straight days with nothing anywhere flagging it had stopped. Conversely, instructions hold while they are fresh but quietly stop when attention moves on. That is the default, and this is where our system parts from that behavior. A rule our system enforces in… 人格。我们的文件系统保留了用户与智能体之间所有会话的完整逐字对话以及所有操作。这有助于智能体在不同会话间明确自己的身份。人格是智能体行为的方式,保持其一致性并非自然发生。一条智能体仅仅需要“记住”的规则,会随着时间推移而淡化。我们观察到,一条规则起初每天被遵守多次,一周内减弱到几乎消失,随后连续五天被完全忽略,且没有任何地方提示它已经失效。相反,指令在新鲜时有效,但当注意力转移后就会悄然停止。这是默认情况,而这正是我们的系统与那种行为分道扬镳的地方。我们系统强制执行的一条规则在……