State belongs in the system

The context window is a place to reason, not the place where a team's work should live. Durable systems keep task state, decisions, and artifacts outside the model.

An agent can appear to remember a great deal. It can refer to an earlier decision, explain why it chose one file over another, and continue a task across many messages. That experience is useful, but it can conceal a fragile assumption: that the model's current context is the system of record.

It is not.

Context is an instrument for reasoning in the present. It may be trimmed, summarized, replaced with a different model, or lost when a session ends. It cannot be the only place where a task's state, an organization's policy, or a product's operating history exists.

The difference becomes obvious during a handoff. If a new engineer cannot determine the active branch, the confirmed facts, the unresolved question, and the evidence already gathered without asking the agent to retell its history, then the work has not been stored in a usable system. It has been stored in a conversation.

What should persist

Not everything deserves durable storage. An exhaustive trace of every model token is expensive and difficult to read. A good system preserves the artifacts that affect future action.

For a software task, that generally includes:

  • the objective and the constraints that shaped it;
  • the workspace, revision, and files that were materially changed;
  • the plans or decisions that were adopted and the assumptions behind them;
  • the outputs of checks that still describe the current state;
  • outstanding failures, risks, and approvals;
  • a clear boundary between a proposal and an accepted change.

These objects can live in familiar places. Code belongs in a repository. A durable decision can live beside the work it governs. A test result belongs to a revision and command. A production action needs an audit record with an identity and policy decision. The important point is that these records remain available even if the model that produced them is gone.

The case against the infinite transcript

The obvious response to lost context is to preserve everything. That trades one problem for another. A task that stores every tool result, every noisy log line, and every rejected thought becomes difficult to resume because the important facts are buried in exhaust.

Selective memory is not a loss of rigor. It is a design decision. The system should retain the state that changes the next decision and summarize or discard the rest. A failed command is valuable when it revealed an environmental constraint. It is less valuable when it was a typo immediately corrected. A review comment is valuable when it changes the accepted design. It is less valuable when it only repeats a resolved question.

This is why durable state needs provenance. A stored fact should have a source, a time, and a relationship to the system it describes. A test result from yesterday's branch may no longer be relevant after a dependency upgrade. A permission granted for one task should not silently travel to another. A user preference should not be mistaken for a production policy.

The model proposes; the system persists

An agent can write a task note, update a plan, create a branch, or propose a change to a configuration file. It should not be the sole authority that decides which of those outputs become organizational state.

This division of labor is healthy. The model is good at synthesizing information, generating alternatives, and interpreting local context. A trusted subsystem is better suited to persist records, enforce schemas, attach identities, validate permissions, and preserve history. The model proposes; the system persists.

That separation also improves correction. If a model makes a wrong inference, the team can amend a decision record or reject a change without trying to erase the fact that the model once held a different idea. If a new model is adopted, it can read the durable artifacts and continue the task without inheriting hidden assumptions from a previous context window.

Memory is not one thing

"Memory" is often used as though it named a single feature. In real work, several different things are being remembered:

  • Working context: temporary details needed to complete the current task.
  • Project knowledge: stable information about a codebase, product, or research program.
  • Operational history: what happened in a particular run, including approvals and external actions.
  • Policy: rules about who may do what, which should be explicit and reviewable.
  • Human preference: choices about style or workflow that should not be confused with system truth.

These categories have different lifetimes and different risks. A working note may expire after a task. A security policy must remain explicit until it is deliberately changed. A production audit record may need to be preserved even if the work itself is removed. Treating all of them as chunks in a generic retrieval index creates confusion that a more fluent model cannot reliably repair.

The infrastructure around an agent should respect those distinctions. It should know the difference between recalling a prior decision, retrieving a reference document, and granting an action. Those are not interchangeable operations.

State is what makes work portable

When the relevant work state is outside the model, a team gains options. It can change model providers. It can run a smaller model for routine analysis and a stronger model for a difficult review. It can move execution into a different environment. It can invite another engineer to take over. It can inspect what happened without treating one vendor's transcript as the canonical record.

Portability is not only an exit strategy. It is a day-to-day property of a system that can survive interruption and change. A task does not become valuable because one model remembers it. It becomes valuable when the work remains legible after the model has moved on.

The context window will continue to grow, and models will become better at maintaining an internal picture of a task. That is welcome. The underlying principle remains: use context for intelligence, and use the system for memory.

状态应该属于系统

上下文窗口是推理的地方,不是团队工作应该存放的地方。持久系统需要把任务状态、决定和产物放在模型之外。

Agent 看起来能够记住很多事。它可以提到早先的决定,解释为什么选择某个文件,并在多条消息之后继续任务。这种体验很有用,却可能隐藏一个脆弱假设:模型当前上下文就是系统记录。

它不是。

上下文是当前推理的工具。它可能被裁剪、摘要、替换成另一个模型,或在 session 结束时丢失。它不可能成为任务状态、组织政策或产品运行历史存在的唯一位置。

交接时,这个区别会变得明显。如果新工程师不能在不要求 Agent 重述历史的情况下,确定当前分支、已确认事实、未决问题和已经收集的证据,那么工作就没有存储在可用系统中,而是存储在一段对话里。

什么应该持久保存

不是所有内容都值得持久化。保存每一个模型 Token 的完整 Trace 既昂贵又难以阅读。好的系统应该保存会影响未来行动的产物。

对于软件任务,通常包括:

  • 形成目标的请求及其约束;
  • 工作区、revision 和实际改动的文件;
  • 被采纳的计划或决定,以及背后的假设;
  • 仍然能够描述当前状态的检查输出;
  • 未完成的失败、风险和审批;
  • 提案与已接受变更之间清晰的边界。

这些对象可以放在熟悉的地方。代码属于仓库;持久决定可以放在它所治理的工作旁边;测试结果属于对应的 revision 和命令;生产动作需要带有身份和政策决定的审计记录。重要的是,即使产生它们的模型消失,这些记录仍然可用。

为什么不能保存无限 Transcript

面对上下文丢失,最直接的反应是保存一切。但这会把一个问题换成另一个问题。任务如果保存每次工具结果、每行噪声日志和每个被拒绝的想法,恢复时就会因为重要事实被埋在大量内容里而变得困难。

选择性记忆并不意味着缺少严谨性,而是一项设计决定。系统应该保留会改变下一次决定的状态,概括或丢弃其他内容。失败命令在揭示环境约束时有价值;如果只是一个很快纠正的拼写错误,价值就较低。Review 意见在改变已接受设计时有价值;如果只是重复一个已经解决的问题,价值就低。

所以持久状态需要来源。保存的事实应该有来源、时间,以及与它描述的系统之间的关系。昨天分支上的测试结果,在依赖升级后可能不再相关;给一个任务的权限不应静默流向另一个任务;用户偏好不应被误认为生产政策。

模型提出,系统持久化

Agent 可以写任务说明、更新计划、创建分支,或提出修改配置文件。它不应该成为唯一决定这些输出是否变成组织状态的权威。

这种分工是健康的。模型擅长综合信息、生成替代方案和理解局部上下文;可信子系统更适合持久记录、执行 Schema、绑定身份、验证权限和保存历史。模型提出,系统持久化。

这种分离也改善了修正。如果模型做出错误推断,团队可以修改决定记录或拒绝变更,而不必试图抹去模型曾经有过不同想法的事实。如果采用新的模型,它可以读取持久产物并继续任务,而不必继承旧上下文里未写明的假设。

记忆不是一件事

“记忆”常常被当成一个功能,但真实工作中至少有几种不同的记忆:

  • 工作上下文: 完成当前任务所需的临时细节;
  • 项目知识: 代码库、产品或研究项目的稳定信息;
  • 运行历史: 某次运行发生了什么,包括审批和外部动作;
  • 政策: 谁可以做什么的规则,应该明确且可审查;
  • 人的偏好: 关于风格或工作流的选择,不应与系统事实混淆。

这些类别拥有不同生命周期和风险。工作笔记可能在任务结束后过期;安全政策应该保持明确,直到被有意修改;生产审计记录即使相关工作被删除,也可能需要保留。把它们都当成通用检索索引中的文本块,只会让问题变得更混乱,流畅的模型也不能稳定地修复这种混淆。

Agent 周围的基础设施应该尊重这些区别。它需要知道是在回忆过去的决定、检索参考文档,还是授予一个动作。这些不是可以相互替换的操作。

状态让工作具有可移植性

当相关工作状态位于模型之外,团队就拥有更多选择。它可以更换模型供应商,让较小模型承担日常分析,把更强模型用于困难 review,把执行迁移到另一个环境,邀请另一位工程师接手,也可以不把某个供应商的 Transcript 当成事实记录。

可移植性不只是离开的策略,也是能够承受中断和变化的日常系统属性。任务并不是因为一个模型记得它才有价值,而是因为模型离开后,工作仍然可理解。

上下文窗口会继续增长,模型也会更擅长维护任务的内部图景。这值得欢迎。但基本原则不会改变:用上下文提供智能,用系统保存记忆。