Memory as Bookkeeping
When you write a note, you can't know whether it will ever be used, and it may already be out of date. Archivists paid for this lesson two centuries ago. Adding a layer of dreaming on top is a spiral fix.

Build AI memory as bookkeeping and you end up in a spiral fix, with each new system patching the last one. That goes for the older approach of storing memories in a vector database for RAG, and for the so-called dreaming mechanism.
The raw record of conversations and actions is already there. Writing extra memory notes and maintaining topic wikis means picking out what matters and sorting it by today's understanding at the moment of storage. The trouble is that when you write something down, you have no idea whether that summary will ever be used. It may already be out of date as you write it.
Archivists ran into a similar problem. After the French Revolution, masses of documents from the Church, the nobility and the old government were nationalized. Archivists found them too messy to leave as they were, so they took the files apart and refiled them under the topics that seemed important at the time: land, taxes, religion. Prussia after 1815 is an even clearer case. Files poured in every day from the new government's ministries and were broken up to fit subject categories designed for the old Brandenburg state. Later writers called this new wine in old bottles.
The result was that neither officials working on later cases nor historians could find their way through. First, one piece of government business often touched several areas. Forced under one topic, it went into whichever slot the archivist judged best at the time, and anyone coming from another angle could not find it. Second, files in their original office had been received and sent one after another. Petition, inquiry, ruling, later reversal: the chain of cause and effect was held together by the order of the case file. Pull one sheet out and file it by topic, and later readers see an isolated piece of paper. They can't tell what it was answering, or whether its decision was later voided. Prussia stayed in this mess for decades. Apart from a few old archivists who had done the filing themselves, outsiders couldn't piece together how a single matter had unfolded.
It took until 1881 for the Prussian State Archives to set the rule: files stay with the administrative unit that produced them, in their original registry order and numbering, and nobody may break up a file to rearrange it by topic. The order in which documents were produced is itself evidence of how the work was done. If you want to search by topic, make a catalog or an index. Those are finding aids, and they can be rewritten whenever the question changes. The originals underneath stay untouched.
The deeper problem behind this lesson is that what matters in a record and what counts as background can't be defined at the moment things happen. Wittgenstein writes in Philosophical Investigations that, for a large class of cases, the meaning of a word is its use in the language. What a past conversation means gets produced when someone comes back with a specific question and uses it. Neuroscience has a similar proposal about human memory (Easton et al. 2024): events are encoded when they happen, but what is the focus of a memory and what is its context get reconstructed at recall, according to the question at hand.
Plato writes in the Phaedrus that writing is a drug for reminding, and that what it gives people is the appearance of wisdom. Having an AI write notes as it works forces it to lock the context in before the question exists. People keep doing it because output tokens cost the model almost nothing, and watching a state file or a wiki grow gives a person the reassuring feeling that things are under control. Much of this bookkeeping is a performance that buys psychological comfort.
When those notes and wikis go stale and start contradicting each other, the premise that bookkeeping is memory stays untouched, and another layer of dreaming goes on top to clean and patch on a schedule. That is the spiral fix. Anthropic's own post, “The components of agent memory”, is clear about this: dreaming can correct errors because it goes back and checks the raw transcript underneath. They call the transcript a ground truth themselves.
Scientific analysis often runs for a long time, with code to run, cluster jobs to submit, and hypotheses overturned and revised along the way. When we were building our own research agent system, we too first had the agent maintain a state file. It didn't know which turn would be the last, so it wrote every turn as a handover, copied what the record already held into a running log, and even wrote scripts to check the numbers in its notes. The notes still went stale. In research, a conclusion cut off from which run produced it, what code it ran, which version of the data it used, and whether the parameters changed later can't serve as evidence.
So we ended up building the system on the archivists' principle. The raw transcript, the record of every computation and the abandoned branches are all kept as they were, in the order they were produced, labeled by source, append-only. Search indexes, notes and wikis are only finding aids: they help you find things, and they get rebuilt when they break or the question changes. They are never the factual basis. The host doesn't digest or push memory for the model ahead of time. It provides read-only query tools, and leaves interpretation and judgment to the model and the researcher at the moment of use.
把 AI 记忆做成记账
写下笔记的那一刻,你不知道它以后会不会用到,甚至可能已经过时。档案学两百年前就为这件事吃过亏,再往上加一层做梦机制,只是螺旋修补。

把 AI 记忆做成记账,最后总会变成用一套新系统去修上一套旧系统的螺旋修补。不管是前时代把记忆存进向量数据库的 RAG,还是所谓的做梦机制(dreaming)。
对话和操作的原始记录本来就在那里,额外去写记忆笔记、维护主题 wiki,其实是在存的时候就按眼下的理解去挑重点、做归类。问题在于,写下来的那一刻,你根本不知道这些总结以后会不会用到,甚至在写下的当下它可能就已经过时了。
历史上的档案学遇到过类似的问题,法国大革命后,教会、贵族和旧政府的大批文书收归国有,档案员觉得原样留着太乱,就按土地、税收、宗教这些当时认为重要的主题,把文件全部拆开重新归档;1815 年后的普鲁士更典型,新政府各部每天产生的文件源源不断进来,却被拆散塞进为勃兰登堡国家设计的主题框里,后人管这叫旧瓶装新酒。
结果不管是后来办案的官员还是历史学者,进去都查不动。一来,一桩政务往往同时牵涉好几个领域,硬按单一主题分,只能凭档案员当时的判断塞进某一个格子里,换个角度来查的人根本找不到。二来,文件在原来的机构里是一份接一份收发的,从请愿、调查、批复到后来改判,前因后果全靠卷宗里的先后顺序连着。一旦把单张文件抽出来按主题归档,后来的人只看得到一张孤立的纸,既不知道它当初是在回应什么,也不知道上面的决定后来有没有作废。普鲁士就这样混乱了几十年,除了少数亲手归档的老档案员,外人连一桩事的来龙去脉都拼不出来。
一直折腾到 1881 年,普鲁士国家档案馆才立下规矩:文件一律按产生它的行政单位存放,并且严格保持收发登记时原有的顺序和编号,谁也不准按主题拆卷重排。因为文件产生的顺序本身,就是当时怎么做事的证据。想按主题查可以,另外编目录和索引就行;目录叫检索工具,问题变了随时可以重写,底下的原件不能碰。
档案学踩出来的这条经验,背后更底层的问题在于:一段记录里什么重要、什么算背景,在事情发生的那一刻根本还没法定义。维特根斯坦在《哲学研究》里说,对很大一类情形来说,词的意义在于它在语言中的用法;一段过去的对话有什么意义,要等后来有人带着具体问题回来查,在使用的那一刻才被生产出来。神经科学里关于人类记忆(Easton et al. 2024)也有类似的观点:事件发生时虽然被编码下来,但什么是记忆的焦点、什么是语境,要到回想时才根据当下的问题重构出来。
柏拉图在《斐德罗篇》里讲过,文字只是提醒人的药,给人的却是智慧的样子。让 AI 边干活边写笔记,就是逼它在问题还没出现的时候提前把语境锁死。之所以大家还是热衷于这么干,是因为模型输出 token 几乎没有成本,而人看着状态文件或 wiki 越积越厚,心里会有一种事情掌握的踏实感。记账很大程度上是在图这种表演式的心理安慰。
等到这些笔记和 wiki 开始过期、自相矛盾,不去动“靠记账当记忆”这个前提,反而再往上加一层做梦机制去定期清理和修补,就是螺旋修补。况且 Anthropic 自己在《The components of agent memory》里也写得很明白,dreaming 之所以能纠错,靠的还是回头核对底下的原始 transcript,连他们自己都管 transcript 叫 ground truth。
科研分析往往跨度很长,中间要跑代码、交集群任务、反复推翻和修改假设。我们在构建自己的科研 agent 系统时,最早也试过让 agent 维护一份状态文件,结果它因为不知道哪一轮是最后一轮,就把每一轮都当交接来写,把记录里本来就有的内容反复抄成流水账,甚至自己写脚本去核对笔记里的数字,最后照样过时。在科研里,一条结论如果脱离了它当初是哪次运行、跑了什么代码、用了哪版数据,以及后来参数改没改过这些前后顺序,是根本没法拿来当依据的。
所以我们最后直接按档案学的原则来建这套系统:把原始 transcript、每次计算的记录和试错分支全部按产生时的顺序原样留着,标清来源,只增不改;搜索索引、笔记和 wiki 都只算检索工具,用来帮着找东西,坏了或者问题变了随时重建,绝不拿来当事实依据。宿主系统不替模型提前消化和推送记忆,只提供只读的查询工具,把解释和判断留给模型和研究者在使用的那一刻。