A navy-ink house on a linen field, its front wall split into pages; the single caramel page curls open with a small paperclip pinching the corner

Why agent memory is startingto look like a set of files Agent 的记忆为什么越来越像一套文件

We examined knowledge-base RAG, CLAUDE.md, progressive disclosure, and the memory systems in Claude Code, Codex, and Hermes. The harder questions are what survives, what enters the next turn, and where the boundary belongs in a shared physical space.我们回头看了知识库 RAG、CLAUDE.md 和渐进式披露,又拆开 Claude Code、Codex 与 Hermes 的实现。除了存储方式,我们更关心记忆怎样留下、怎样进入下一轮,以及到了多人空间里,边界该画在哪里。

Soon after we started building seenzus, we ran into a question we could not dodge: how should an agent remember a place it may live in for years? People should not have to repeat “I run cold” or “leave the ceiling lights off when the projector is on” every time they start a conversation. But the obvious alternative is not much better. If we keep a running summary of everything the agent has learned and inject it into every turn, old conclusions linger, one resident’s information can leak into another resident’s context, and the summary can become a second interpretation of facts rather than a record of them. For a product that can turn on lights, change the temperature, and close blinds, a bad memory is more than an awkward answer.

At first, we treated knowledge-base RAG, vector retrieval, AGENTS.md, CLAUDE.md, and progressive disclosure as competing options. That framing did not survive contact with the implementations. They solve different parts of the problem. Vector retrieval is good at finding relevant fragments in a large body of material. Readable files are a better home for durable knowledge that needs to be summarized, corrected, or removed. The implementations we examined are splitting those jobs apart. Retrieval still matters for large corpora. It simply no longer needs to carry the full meaning of “memory.”

Claude Code, OpenAI Codex, and Nous Research’s Hermes Agent have all moved in this direction, though each brings memory into the current context differently. seenzus has another complication. A space belongs to more than one person, and memory can shape actions in the physical world. Some boundaries are too important to leave to model judgment alone.

The mechanisms described below come from official documentation or source code pinned to specific commits, checked on July 29 and July 31, 2026. The sources are listed at the end. We do not have reliable data on which approach was most popular at any point, so we treat that part of the story as our own observation rather than an industry fact.

Vector retrieval is still useful but it no longer owns the whole problem

RAG is now often used as shorthand for “chat with a knowledge base.” The original paper was narrower: combine model parameters with a vector index of Wikipedia to solve knowledge-intensive tasks such as open-domain question answering. “Memory” in that paper meant external world knowledge. It did not distinguish public knowledge from facts about one person, and it had no semantics for user-scoped writing, correction, or forgetting.1

Early LLM applications quickly applied the same machinery to conversation. Many of them worked with context windows of only a few thousand tokens, and models struggled to maintain a coherent long-term record. A common pattern was to split previous conversations into chunks, store embeddings, retrieve chunks related to the new message, and place them back in the prompt.

LangChain’s route change is easy to see. It added vector-store memory in 2023, later deprecated it, and eventually removed the old memory module from the current codebase. Within LangChain, vector retrieval is no longer the recommended abstraction for conversational memory.2 That does not prove vector memory disappeared from the industry.

Vector retrieval remains a sensible way to search a large body of material. Hermes still offers an external memory provider that performs vector recall on every turn. The storage design in seenzus also leaves room for vector retrieval. The change is in the division of labor. Retrieval can find related material, but it does not decide whether an old preference is still true. It also does not know that “you remembered that wrong” should revise a prior belief rather than sit beside it as one more chunk.

Two studies from 2023 were already working on that gap. Generative Agents combined stored experience with dynamic retrieval, then periodically reflected on and distilled what the agent had observed. MemGPT borrowed tiered storage from operating systems and moved information between a limited context window and external storage. Storage, maintenance, and context composition were becoming separate design problems.3

AGENTS.md and CLAUDE.md put memory back into files people can read

The next approach looked almost too simple: write what the agent should know in Markdown and let it read the file. CLAUDE.md became visible with the Claude Code research preview. Later that year, AGENTS.md described itself as “a README for agents” and was adopted by Codex, Jules, Cursor, Gemini CLI, and other tools.4

Files give facts about a project or a user a stable, readable home. Changes can live in version history. Compared with a collection of conversation fragments in a vector store, a team can inspect one file and point to the line that is wrong.

The cost is just as plain. At launch, Claude Code fully loads the CLAUDE.md files it finds from the working directory upward. Files in subdirectories enter context later. Anthropic recommends keeping each CLAUDE.md under 200 lines and moving multi-step procedures or local material into skills or path-scoped rules. A long startup file spends tokens and makes the important lines harder to notice.5

Progressive disclosure keeps the entry point resident and the details elsewhere

A file does not need to be resident in the current context simply because it is durable. The system can keep a small index, summary, or compact library within a hard budget, then read full details only when the current task calls for them.

The idea predates the current terminology around agents. MemGPT applied an operating-system paging analogy to context, while “progressive disclosure” came from interaction design. Anthropic later made it a design principle of Agent Skills: names and descriptions stay available, the body of SKILL.md is read after a skill is triggered, and supporting files sit another layer down.6

In a memory system, that entry point might be an index, a summary, or a small block of full text with a hard capacity limit. All three implementations we examined budget resident content, though they disagree on whether details should be fetched later. The more durable agreement is not a particular file layout. It is that long-term storage should not enter every context window unchanged.

Models are beginning to maintain the memory themselves

Then models started writing. Information that once depended on a person or a fixed pipeline can now be extracted, merged, and corrected by the model. The files are no longer static notes waiting for a human edit.

The three products maintain memory at different times. Claude Code writes during normal work. Codex batches recent conversations in the background. Hermes lets the foreground agent write and also runs periodic background reviews.7

None of the vendors treats autonomous maintenance as a solved problem. When we checked, Codex local memories were still disabled by default.8 A model can write the wrong thing or fail to retain something that mattered. Capacity, triggers, and write boundaries still come from deterministic code around the model.

These layers still coexist: retrieval handles recall, files hold inspectable knowledge, progressive disclosure controls the current context, and models take on some of the editing work.

The division of labor in agent memory: vector retrieval and progressive disclosure bring durable content into the current context, while model maintenance writes conversations and evidence back to memory files.
This is a conceptual diagram, not a market-share chart or a strict timeline. A product may use only part of this arrangement, and retrieval may sit inside a file boundary. The division of labor is our reading of the public mechanisms, not terminology shared by the vendors.

The files look similar but the context paths do not

All three products use files as the main carrier, let a model participate in maintenance, cap resident content, and give users some way to inspect or disable memory. Their real disagreement appears at read time: what is already present when the session starts, and what the agent must choose to fetch.

Claude Code auto-memoryOpenAI Codex local memoriesHermes Agent
What it recordsBuild commands, debugging lessons, architecture notes, and style preferences selected by the agentDurable knowledge extracted from rollout logs; reusable procedures move into skillsDeclarative facts only, with preferences and corrections favored; procedures move into skills
How it is organizedRepository-level directory with a MEMORY.md index and topic filesState DB plus raw_memories.md, rollout summaries, a MEMORY.md registry, and memory_summary.mdTwo files, MEMORY.md and USER.md, split into § entries
When it enters contextFirst 200 lines or 25 KB of the index at startup; topic files on demandA summary of at most 2,500 tokens stays resident; registry and evidence are looked up as neededFull text is frozen into the system prompt at session start, with default limits of 2,200 and 1,375 characters; an optional provider can recall each turn
How it is maintainedThe main agent reads and writes during workA two-phase background extraction and consolidation pipeline triggered at startup and while idleA foreground memory tool plus a background review every ten user turns by default
What it may influenceKept separate from CLAUDE.md instructionsTeam constraints remain in AGENTS.md or other versioned documents; memory must be checked for stalenessFacts belong in memory, procedures in skills; writes can require approval

Mechanisms checked on July 29, 2026. Claude uses rolling documentation; Codex and Hermes are pinned to fixed versions. See note 7 for versions and sources. Future versions may behave differently.

The “when” row carries most of the architectural difference. Claude uses an index for progressive disclosure. Codex keeps a projection resident, then returns to the registry and evidence when necessary. Hermes skips the index. It freezes a very small complete store at session start, refuses further writes at capacity, and gives all entries back to the agent to reorganize. The three products all use files, but they implement three different forms of context engineering. Public material is enough to compare mechanics. It is not enough to compare recall quality under the same workload, because none of the vendors has published that evaluation.

Three ways file-based memory enters the current context in Claude Code, OpenAI Codex, and Hermes Agent.
Based on official documentation and pinned commits checked on July 29, 2026. Claude uses an index plus on-demand reads, Codex uses a resident projection plus lookup, and Hermes freezes a size-limited full store. This diagram does not compare recall quality.

The public mechanisms in all three systems also distinguish memory from instruction. Claude separates auto-memory from CLAUDE.md. Codex keeps strong team constraints in AGENTS.md or other versioned documents. In the Hermes version we checked, facts go into memory and reusable procedures into skills. Learning that something happened does not mean the agent must obey it forever. For a coding agent, that keeps information and rules from blurring together. For an agent that controls devices, the distinction is a safety boundary.

The default boundary for a coding agent breaks down in a physical space

The local memory in these systems is organized around a git repository, $CODEX_HOME, or a local profile. Each roughly describes “this person on this machine.” That is a good fit for a development tool. If the agent remembers the wrong build command, the user can usually fix it in a later session. We did not find a request-scoped Account × User × Site/Space authorization model in the public material. The products do not need to manage several residents, changing access to rooms, or device actions.9

A smart space has all of those problems at once. One keeper serves several members, but each person still has private information. An Account may contain several Sites, and each Site may contain several Spaces. Access can be granted or revoked at any time. The agent also does more than write a reply. It can turn on a light, change the temperature, or close a blind. A missed memory makes the product feel forgetful. A boundary failure can expose someone’s routine or let an old preference outweigh a clear instruction given today.

seenzus keeps file memory and moves its boundaries outside the model

seenzus also keeps durable memory in Markdown files. The agent maintains the prose, including uncertainty expressed in ordinary language rather than a precise-looking score field. A request keeps only the visible boundaries resident and reads the actual memory when a decision needs it. The difference is who enforces scope. Coding agents do not need the boundaries described below, so we implement as much of that work as possible in deterministic systems instead of asking the model to remember the rules every time.

First decide whether a fact belongs to a person or a place

Personal Memory belongs to a User and follows that person across Accounts. Environment Memory belongs to an Account and is scoped to a Site × Space. Our routing question is short: would this still be true in a different home, studio, or shop? “I prefer 26°C” follows the person, so it is personal. “Use warm light in this living room at night” loses its meaning elsewhere, so it belongs to the environment. When the answer is unclear, we keep the memory private.

Shared memory also has a content boundary. Inferences about a person’s body, health, mood, or whereabouts do not go into Environment Memory. A space has one keeper. It can read the preferences of several members and resolve conflicts, but we do not create a separate keeper for each person and leave them to disagree in isolation.

Rebuild the visible memory map for every request

Every request to the Conversation Agent receives a fresh Memory Index. The index lists only the boundaries visible at that moment. The personal axis has at most one entry. The environment axis contains each authorized Site · Space that has memory content. The index contains no facts, summaries, or filenames.

The system computes this map from current permissions, uses it for one request, and does not cache it. If either the personal or environment axis fails to resolve, that part of the map is omitted rather than replaced with a stale copy; the other axis remains available when it is still valid. When a member loses access to a Site, that Site disappears from the next request, including any hint that the Site exists. This boundary is applied on every request rather than left for the model to remember. The agent reads a full memory boundary only when the current decision needs it. The index itself is never a source of facts.

Start maintenance from evidence instead of a timer

A single device event does not wake a maintenance model. The system aggregates and deduplicates events, then compares the result with the evidence processed last time. Only when the Evidence Gate decides that the new batch might change existing knowledge does the model receive a bounded set to review.

Existing memory does not fade merely because time passed. A belief changes when new evidence conflicts with it. The wording of provenance also limits what the system may do. If a resident explicitly stated a preference, later behavior cannot silently replace it. The system may record the conflict, but it waits for another explicit statement before deleting or rewriting the original. Forgetting removes a current record. It does not prevent the system from learning the same fact again. If a resident says “do not remember my routine,” that instruction becomes a personal preference, and later maintenance must honor it.

Memory can inform an action but it can never authorize one

Memory may help the agent perform an already permitted action in a more suitable way. Permission itself comes only from the current request, a Policy, or an approval path. The system applies this boundary with the Memory Index on every request instead of relying on the model to remember it.

The seenzus authorization boundary: memory informs Agent judgment, while permission for a device action comes only from the current request, Policy, or approval.
Memory connects only to judgment; no path runs from memory to any of the three permission sources. How the per-request Memory Index computes visibility is described in the body. The diagram does not describe semantic recall quality.

Some risks remain soft boundaries. Routing writes between the personal and environment axes still involves model judgment. A deterministic visibility boundary cannot prove that the model will always find, cite, or update the right memory. We still need evaluations for missed reads, bad citations, and boundary violations.

In daily use, memory should mean less explaining and less reason to worry

When someone says “make this room comfortable,” the keeper can combine Environment Memory for the current Space with the person’s preferences and interpret “comfortable” as roughly 26°C with warm light. It should not answer with a questionnaire.

If the same person says “set this room to 22°C,” the explicit instruction wins. A historical preference cannot override a complete current request. If permissions changed yesterday, the visible memory map must change today.

Correction should also sound like conversation. “You remembered that wrong. I do not run cold” is the strongest form of evidence. The keeper should say the memory is fixed only after the write has reached storage. Nobody should need to hunt through settings for a memory toggle just to correct one sentence.

These are design goals derived from the mechanism, not results from user research. We can verify that the request-scoped view changes with current permissions. We do not yet have evidence that people living with seenzus feel better understood. Answering that question requires the product to run in real spaces for long enough to accumulate useful mistakes and corrections.

Memory design should follow the agent’s lifespan and risk

Before choosing a memory architecture, ask how long the agent will live, whom it serves over that time, and what a wrong memory can cause.

A one-shot question-answering agent may not need durable memory at all. When it works over a large body of material, retrieval may be enough. A development agent that serves one person over time can combine files, a context budget, and model maintenance. Claude, Codex, and Hermes show three workable versions. When the user becomes a group and the agent can act in the physical world, the file substrate still works, but the system must say whose memory is visible in which place and how far that memory may influence action. The current seenzus design is our answer to that narrower problem.

Evaluation is the missing piece. The three context strategies have no comparable public recall data. seenzus can define scope but not prove semantic quality. Vector retrieval may eventually return inside one of our memory boundaries. Once we have those results, we expect parts of today’s design to change.


Notes and sources

  1. Lewis et al., Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks, arXiv:2005.11401, May 22, 2020.
  2. VectorStoreRetrieverMemory was introduced in PR #2804 on April 13, 2023. In langchain==0.3.27, it was marked deprecated since 0.3.1 with removal planned for 1.0.0. When checked on July 31, 2026, the master branch no longer contained the old langchain/memory/ directory.
  3. Park et al., Generative Agents, April 7, 2023; Packer et al., MemGPT, October 12, 2023.
  4. Claude Code launched as a research preview on February 24, 2025. The AGENTS.md specification repository received its first commit on August 19, 2025.
  5. Anthropic, How Claude remembers your project, checked July 31, 2026. The documentation recommends fewer than 200 lines per CLAUDE.md and distinguishes startup loading, on-demand subdirectory loading, path-scoped rules, and skills.
  6. Nielsen Norman Group, Progressive Disclosure, December 4, 2006; Anthropic, Equipping agents for the real world with Agent Skills and Introducing Agent Skills, October 16, 2025.
  7. Claude Code is based on its rolling documentation. OpenAI Codex is based on the Memories documentation and source commit 406dc923…. Hermes Agent is based on the Persistent Memory documentation and source commit 5a23e3c5…. Mechanisms checked July 29, 2026.
  8. OpenAI’s Memories documentation stated that Local Codex memories were off by default and had to be enabled by the user. Checked July 29, 2026.
  9. The scope comparison comes from each product’s public storage documentation and pinned source, with versions listed in note 7: Claude by git repository, Codex under $CODEX_HOME, and built-in Hermes memory by local profile. The public material did not show a request-scoped Account × User × Site/Space authorization model. This describes the evidence we could inspect, not an assertion about undisclosed internals.

做 seenzus 没多久,我们就碰到一个躲不开的问题:一个长期住在你家里的 Agent,该怎么记事?住户不会愿意每次都重新解释「我怕冷」或「投影仪开着时别开顶灯」。但把过去学到的东西全都摘要出来,长期塞在上下文里,同样会出问题:旧结论可能迟迟不改,不同住户的信息可能串到一起,摘要还可能变成事实之外的第二份解释。对于一个真的会开灯、调温、拉窗帘的产品,漏读和读错都不是小事。

最开始,我们也把知识库 RAG、向量检索、AGENTS.md、CLAUDE.md 和渐进式披露当成一排待选方案。逐项拆开以后才发现,它们回答的并不是同一个问题。向量检索擅长从大量材料里找回相关片段;可读文件更适合承载那些需要归纳、纠错和删除的长期认知。在我们拆开的这些实现里,两者正在重新分工。大规模召回仍然是检索的工作,只是不再需要它包办「记忆」的全部语义。

Claude Code、OpenAI Codex 和 Nous Research 的 Hermes Agent 都在这么做,只是把记忆带进当前上下文的方式不同。seenzus 面对的场景又多了一层麻烦:空间由多人共享,记忆可能影响真实设备,所以有些边界不能只靠模型自己把握。

下文涉及三家产品的机制,都能在官方文档或固定 commit 的公开源码中找到,查证日期是 2026-07-29 和 2026-07-31。来源列在文末。至于「当时行业里最流行什么」,我们没有可靠统计,只能把亲历的变化当作观察来写。

向量检索没有过时,只是不再包办所有事情

RAG 这个词今天常被当成「知识库问答」的同义词,但原始论文讨论的范围窄得多:把模型参数与 Wikipedia 的向量索引组合起来,解决开放域问答等知识密集型任务。这里的 “memory” 是外部世界知识,不区分公共知识和关于某个用户的事实,也没有按用户写入、纠错或遗忘的语义。1

早期 LLM 应用很快把这套办法用到了对话。许多应用可用的上下文窗口只有几千 token,模型也很难稳定整理长期记录。常见做法是把聊过的内容切片存进向量库,下一轮再按当前输入捞出相关片段,塞回 prompt。

LangChain 的路线变化很直观:它在 2023 年加入向量库记忆,后来将其弃用,新版代码也移除了旧的 memory 模块。至少在 LangChain 内部,向量检索已经不再是推荐的对话记忆抽象。2

这只能说明 LangChain 改了路线,不能据此宣布向量记忆已经被行业淘汰。向量检索至今仍适合大规模知识召回。Hermes 的外部 memory provider 还在用逐轮向量召回补充内置记忆;seenzus 的存储设计也给向量检索留了位置。变化发生在分工上:检索擅长把相关内容找回来,却不负责判断一条旧偏好是否仍然成立,更不会因为用户说了一句「你记错了」就自动改掉它。

2023 年的两项研究已经开始处理这个缺口。Generative Agents 除了保存和检索经历,还会定期反思并提炼记忆;MemGPT 则借用操作系统的分层存储,在有限上下文与外部存储之间搬运数据。检索之外,怎样整理记忆、怎样把需要的部分带进当前上下文,开始成为独立问题。3

AGENTS.md 和 CLAUDE.md 把记忆放回了人能看懂的文件里

后来出现的做法朴素得多:把 Agent 该知道的事写进 Markdown,需要时直接读。CLAUDE.md 随 Claude Code 的 research preview 进入公众视野;同年出现的 AGENTS.md 把自己称作 “a README for agents”,后来被 Codex、Jules、Cursor 和 Gemini CLI 等工具采用。4

文档给「关于这个项目、这个用户的事实」找到了一个稳定且可读的落点,修改还会留在版本历史里。相比散落在向量库中的会话切片,团队更容易检查一份文件,也更容易指出哪里写错了。

问题也很直接。Claude Code 会在启动时全文加载从当前工作目录向上找到的 CLAUDE.md,子目录里的文件则等读到对应目录时再进入上下文。官方建议把单文件控制在 200 行以内,并把多步骤流程或局部内容移到 skills 或 path-scoped rules。启动时加载的文件一长,不但占 token,也会让真正重要的内容变得不显眼。5

渐进式披露:常驻的是入口,不是全部

文件变长以后,读取方式也得跟着变。长期保存的内容不必全部常驻在当前上下文里;可以只放一份有硬上限的索引、摘要或微型库,细节等真正用到时再读。

这个思想比它的名字老。MemGPT 已经用操作系统分页的方式处理有限上下文与外部存储;“progressive disclosure” 一词则来自交互设计。Anthropic 后来把它写进 Agent Skills 的设计原则:skill 的名字和描述常驻,SKILL.md 正文等触发后再读,附加文件放得更深。6

放到记忆里,这个入口可以是一份索引、一份摘要,也可以是一小块有容量上限的全文。我们拆开的三套实现都给常驻内容设了硬预算,至于细节是否按需读取,各家选择不同。更稳定的共识不是某种文件结构,而是长期保存的内容不该原样挤进每一轮上下文。

现在,模型开始自己整理这些记忆

再往后,变化发生在写入端。过去主要由人或固定管线整理的内容,现在开始交给模型抽取、合并和纠错。文件不再只等着人来更新,而是在使用过程中持续改写。

三家的维护发生在不同时间。Claude Code 边工作边写;Codex 在后台批量整理近期会话;Hermes 既允许前台 Agent 主动写,也会定期在后台复盘。7

厂商对此并不激进。到我们查证时,Codex 的 local memories 默认仍是关闭的。8模型会写错,也会漏掉本该保留的内容。即使让它负责维护,容量、触发条件和写入边界仍然要由系统规定,三家都保留了这样的外壳。

这些层现在仍然同时存在:检索负责召回,文档提供可读的载体,渐进式披露控制本轮上下文,模型承担一部分整理工作。

Agent 记忆的分工:向量检索与渐进式披露把长期内容带入本轮上下文,会话和证据再经模型维护写回记忆文件。
这是一张概念图,不表示行业份额或严格时间线。具体产品可能只采用其中一部分,也可能把检索放在某个文件边界内部;“分工变化”是 seenzus 对公开机制的归纳,不是供应商共同使用的术语。

同样使用文件,三家带入上下文的方式并不一样

共同点不难找:三家都以文件为主要载体,让模型参与维护,给常驻内容设上限,也允许用户查看或关闭。差别主要出现在读取时:哪些内容从一开始就在上下文里,哪些内容要等 Agent 主动去找。

Claude Code auto-memoryOpenAI Codex local memoriesHermes Agent
记什么构建命令、调试洞见、架构笔记、风格偏好,agent 自判后台从会话记录抽取的持久知识;可复用流程单独进 skills只写 declarative 事实,偏好与纠正优先;流程进 skills
怎么组织仓库级目录:MEMORY.md 索引 + topic 文件state DB + raw_memories.md、rollout summaries、MEMORY.md registry、memory_summary.mdMEMORY.md + USER.md 双文件,§ 分条
何时进上下文索引前 200 行/25KB 启动常驻;topic 按需读≤2,500 token 的 summary 常驻;registry/evidence 按需搜全文冻结进 session 开始的 system prompt(默认 2,200/1,375 字符);可选 provider 逐轮召回
怎么维护主 agent 工作中自主读写startup + idle 触发的后台两阶段抽取/合并前台 memory 工具主动写 + 默认每 10 用户轮后台 review
影响什么与 CLAUDE.md 指令明确分离团队强约束留在 AGENTS.md;读记忆时要求检查是否已过时写事实不写命令;可开启写审批

表中机制查证于 2026-07-29。Claude 依据滚动文档,Codex 与 Hermes 依据固定版本;具体版本和来源见注 7。未来版本可能改变。

「何时进上下文」这一行差别最大。Claude 用索引做渐进式披露;Codex 常驻一份投影,需要时再回查;Hermes 干脆不做索引。它把微型全文冻结在 session 开始时,容量满了便拒绝继续写入,并把全部条目交还给 agent 当场整理。三者虽然都用了文件,做的却是三种不同的上下文工程。公开材料足以比较机制,无法比较实际召回效果;这需要在相同负载下评测,而三家都没有公开这样的数据。

Claude Code、OpenAI Codex 与 Hermes Agent 将文件记忆带入当前上下文的三种路径。
机制依据 2026-07-29 查证的官方文档与固定 commit。Claude 使用索引加按需读取,Codex 使用常驻投影加按需回查,Hermes 使用有硬上限的冻结全文;这张图不比较召回质量。

三家的公开机制也都区分记忆和指令。Claude 区分 auto-memory 与 CLAUDE.md 指令;Codex 要求团队的强约束继续留在 AGENTS.md 或版本化文档中;Hermes 在我们查证的版本里要求 memory 只写事实,可复用的 procedure 则进入 skill。Agent 学到一件事,并不等于以后必须照着做。对开发工具来说,这能避免信息和规则混在一起;对会控制真实设备的 Agent 来说,它直接关系到安全。

开发 Agent 的默认边界,到了物理空间里不够用了

三家的本地记忆分别围绕 git 仓库、$CODEX_HOME 和本地 profile 组织,大体对应「这台机器上的这个人」。这很符合开发工具的使用场景。一个 Agent 记错构建命令,通常还能在下次使用时改回来。我们在三家的公开材料中没有找到可以直接搬用的 Account × User × Site/Space 请求级授权模型。它们原本就不需要处理多个住户、动态变化的空间权限和设备动作。9

到了智能空间,这些约束一个也绕不过去。同一个管家要面对多位成员,而每个人都有自己的隐私。一个账号下还可能有多个 Site,每个 Site 又有多个 Space,成员的访问权随时可能被授予或撤销。更重要的是,Agent 给出的不只是文字建议,它真的会开灯、调温或拉窗帘。漏读会让它显得健忘;越界则可能泄露某位住户的作息,甚至让一条旧偏好压过今天说得很清楚的指令。

seenzus 沿用文件记忆,但把边界放到了模型外面

seenzus 也把长期记忆放进 Markdown 文件,由 agent 整理内容,把握程度直接写进文字,而不是塞进一个看似精确的数字字段。请求里常驻的是可见边界,具体记忆等判断需要时再读。不同之处在于边界由谁来守。这些开发 Agent 不需要处理的部分,我们尽量用确定性系统来完成,而不是寄希望于模型每次都判断正确。

先分清这是人的偏好,还是这个空间的习惯

Personal Memory 归 User 所有,跟着人跨账号走;Environment Memory 归 Account 所有,绑定到 Site×Space。判断时我们只问一句:换个家还成立吗?「我喜欢 26°C」换个屋檐仍然成立,所以是个人记忆;「这个客厅晚上开暖光」离开这里就没有意义,所以是环境记忆。分不清时,默认留在私有一侧。

共享记忆还有一条内容红线:关于某个人身体、健康、情绪或行踪的推断,不会写进去。一个环境只有一个管家,它可以读取多位成员的偏好并处理冲突,但不会为每个人各建一个彼此隔离、互不协调的管家。

每次请求都重新画一张可见范围

Conversation Agent 每次收到请求时,都会拿到一份新的 Memory Index。它只列出这一刻可见的记忆边界:个人轴至多一个入口,环境轴则按行列出已经授权且确实有内容的 Site · Space。里面没有事实、摘要或文件名。

这份 Index 根据当前权限现算,用完即丢,也不会缓存。个人轴或环境轴解析失败时,对应边界会缺席,不会退回上一次的旧视图;另一条仍然合法的轴不受牵连。某位成员失去一个 Site 的权限后,下一次请求里连那个 Site 的存在都看不到。这是系统每次请求都会执行的边界,不需要模型自觉遵守。只有当当前判断确实需要长期信息时,Agent 才沿着这张图读取完整的记忆内容。Index 自己不是事实源。

维护从证据开始,不从定时器开始

单条设备事件不会直接唤醒维护模型。系统先聚合和去重,再和上次处理过的证据比较。只有 Evidence Gate 认为这批变化可能改变已有认知时,才把一个有预算上限的批次交给模型判断。

已有记忆也不会单纯因为时间过去而变淡。要改写一条信念,得先有与它矛盾的新证据。文字中的出处还决定了系统可以怎么改:「明确说过……」来自住户本人,即使后续行为与它不一致,系统也只能把冲突并列写下,不能擅自替换;要删除或改写,得等住户再次明确说明。至于遗忘,它表示删掉现有记录,而不是永久禁止系统再学到同一件事。如果住户说「别再记我的作息」,这句话本身会成为一条个人偏好,后续维护也会遵守。

记忆永远不授权行动

记忆可以帮助 Agent 把一个已经获得许可的动作做得更合适,但许可本身只能来自当前请求、Policy 或审批路径。这条限制会在每次请求中与 Memory Index 一起施加,不靠模型自己记住。

seenzus 的授权边界:记忆为 Agent 判断提供参考,设备动作的许可只来自当前请求、Policy 或审批。
图里记忆只连到判断;许可的三个来源与记忆之间没有路径。可见范围如何由每次请求的 Memory Index 现算,见正文;这张图不代表语义召回质量。

这套设计并没有把所有风险都变成硬边界。个人轴与环境轴之间的写入分流仍然包含模型判断。确定性的可见范围也不能证明模型会每次都找对、引对或改对记忆。我们还需要评测漏读、错误引用和越权,这部分尚未完成。

放回日常使用里,记忆应该意味着少解释,也少担心

你说「把这屋弄舒服点」,管家可以结合这个 Space 的环境记忆和你的个人偏好,知道这里的「舒服」大概是 26°C 加暖光,不必反过来追问一长串参数。

但如果你明确说「把这屋调到 22°C」,它就应该照做。历史偏好不能压过一条参数完整的当前指令;权限昨天发生变化,今天的可见范围也必须跟着变。

记错时,纠正也应该像平常说话一样简单。住户说「你记错了,我不怕冷」,这句话就是最高等级的证据。管家要等那条记忆真正写回存储以后,才能回答「改好了」,不必再让人钻进设置页找开关。

目前这些仍是从机制推导出来的设计目标,不是已经被用户研究验证的效果。我们能验证请求级可见范围会随权限重新计算,却还拿不出「住户真的觉得它更懂自己了」的数据。要回答这个问题,产品得先在真实家庭里运行足够久。

记忆方案得跟着 Agent 的寿命和风险走

所以,设计 Agent 记忆之前,先看清它会活多久、长期服务谁,以及一次错误会带来什么后果。

一次性的问答 Agent 可能根本不需要长期记忆;面对大规模材料时,检索往往已经够用。长期服务一个人的开发 Agent,可以采用文件、上下文预算和模型维护这套组合,Claude、Codex 与 Hermes 已经给出了不同实现。等到用户变成多人,Agent 的动作也会落进物理世界,文件底座仍然能用,但系统还要明确谁的记忆在哪个空间可见,以及它最多能影响到哪里。seenzus 现在的设计,就是我们对这部分的回答。

接下来最缺的是评测。三条上下文工程路线没有可比的召回数据;seenzus 能定义边界,却还不能证明语义质量;我们也可能把向量检索重新放进某个记忆边界内部。等这些结果出来,我们很可能还会修改今天的设计。


注释与来源

  1. Lewis et al., Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksarXiv:2005.11401,2020-05-22。
  2. VectorStoreRetrieverMemory 于 2023-04-13 通过 PR #2804 引入;在 langchain==0.3.27 中已标记自 0.3.1 起弃用并计划于 1.0.0 移除。查询于 2026-07-31,当时 master 分支已无旧的 langchain/memory/ 目录。
  3. Park et al., Generative Agents,2023-04-07;Packer et al., MemGPT,2023-10-12。
  4. Claude Code 于 2025-02-24 以 research preview 发布。AGENTS.md 规范仓库初始提交于 2025-08-19。
  5. Anthropic,How Claude remembers your project,查询于 2026-07-31。文档建议每份 CLAUDE.md 少于 200 行,并区分启动加载、子目录按需加载、path-scoped rules 与 skills。
  6. Nielsen Norman Group,Progressive Disclosure,2006-12-04;Anthropic,Equipping agents for the real world with Agent SkillsIntroducing Agent Skills,2025-10-16。
  7. Claude Code 依据官方滚动文档;OpenAI Codex 依据 Memories 文档与源码 commit 406dc923…;Hermes Agent 依据 Persistent Memory 文档与源码 commit 5a23e3c5…。机制查询于 2026-07-29。
  8. OpenAI Memories 文档当时写明 Local Codex memories 默认关闭,需要由用户开启。查询于 2026-07-29。
  9. 作用域判断来自三家的公开存储说明与固定版本源码,版本见注 7:Claude 按 git repository,Codex 位于 $CODEX_HOME,Hermes 内置记忆按本地 profile。公开材料未展示 Account × User × Site/Space 请求级授权模型;这是对可见资料范围的说明,不是对内部实现的断言。