S7-14 · 基础S7-14 · Foundation

Agent 记忆 · 先决定写什么,再决定何时召回与遗忘Agent Memory · Decide What to Write Before What to Recall and Forget

select events → write entries → retrieve next task → inspect hit, expiry, conflict, privacy

Agent 记忆(Agent Memory)是为跨步骤或跨会话保留、检索和更新有用信息的机制集合。它不是把聊天记录全塞回去,还涉及写入、召回和遗忘。Agent memory is a set of mechanisms for retaining, retrieving, and updating useful information across steps or sessions. It is not the entire chat replayed; it requires write, recall, and forgetting policies.

01 · 好助理该记住会议偏好,还是连密码也记下01 · Should a good assistant remember a meeting preference—or a password?

四件事都在聊天里出现:稳定偏好、过期地址、冲突期限与密码。下一次任务开始前,哪些值得写入,哪些必须挡住?Four events appear in chat: a stable preference, an expired address, a conflicting deadline, and a password. What should be stored for the next task—and what must be blocked?

02选择哪些事件写入,再启动下次任务逐条查看命中、过期、冲突与隐私风险Choose Events to Store, Then Start the Next Task and Inspect Hit, Expiry, Conflict, and Privacy Risk

记忆账本 · 条目级状态memory ledger · entry-level state
状态 AMetric A
状态 BMetric B
状态 CMetric C

所有概率、成本、成功率与输出均为固定种子的教学模拟,不代表真实模型输出。把主变量拖回即可复核结论。All probabilities, costs, success rates, and outputs are fixed-seed teaching simulations, not real model output. Move the main variable back to verify the conclusion.

03把刚才的变化拆成 4 个零件Break the Change into Four Parts

Agent Memory
WRITE

写入策略Write policy

只保存未来有价值且获授权的信息。Store only authorized information with future value.

RETRIEVE

检索条件Retrieval criteria

按任务、主体、时间与相关度召回候选条目。Recall candidate entries by task, subject, time, and relevance.

VALIDATE

条目校验Entry validation

召回后逐条检查过期、冲突与敏感性。After recall, check each entry for expiry, conflict, and sensitivity.

FORGET

遗忘责任Forgetting duty

删除不再必要、无授权或高风险的条目。Delete entries that are unnecessary, unauthorized, or high risk.

04最小机制:主交互能逐项验证Minimal Mechanism: Verify Each Link in the Interaction

MECHANISM
usable_memory = selected ∧ relevant ∧ fresh ∧ nonconflicting ∧ authorized
主交互不把“检索命中”直接当可用;每个条目还要经过新鲜度、冲突和隐私检查。The interaction does not treat retrieval as automatic usability. Every entry still passes freshness, conflict, and privacy checks.
筛选事件Select价值 + 授权value + permission
条目化写入Write来源、时间、到期source, time, expiry
检索后验证Recall命中 / 过期 / 冲突 / 风险hit / expired / conflict / risk

05把四类事件全部写入再检索Store All Four Event Types, Then Retrieve

主动制造失败Create a failure

边界实验Boundary experiment

写得越多不代表记得越好。密码被隐私闸拦截,旧地址过期,期限冲突必须显式呈现。Writing more does not mean remembering better. The privacy gate blocks the password, the old address expires, and the deadline conflict must remain explicit.

尚未执行。先在主交互中观察正常机制。Not run yet. Observe the normal mechanism in the main interaction first.
把聊天全文保存就是记忆。Saving the full chat is memory.→ ✓ 记忆需要选择、结构、来源、到期与删除策略。Memory needs selection, structure, provenance, expiry, and deletion.
检索命中就一定可信。A retrieval hit is trustworthy.→ ✓ 命中后仍检查过期、冲突与授权。After a hit, still check expiry, conflict, and authorization.
多记一点没有成本。Remembering more is free.→ ✓ 冗余、隐私与错误召回都会增加风险。Redundancy, privacy, and bad recall all add risk.
06 · 一句话带走06 · One line to keep

Agent 记忆是选择性写入、任务相关检索与条目级验证的组合;命中、过期、冲突和隐私风险必须分开显示。Agent memory combines selective writes, task-relevant retrieval, and entry-level validation. Hits, expiry, conflicts, and privacy risks must remain distinct.