Agent 记忆层

wesgine 的 L4 Agent 记忆——角色级认知存储。


定位

Agent 记忆(agent_memory)是按 Agent 隔离的认知存储。

每个 Agent 有自己的命名空间,存储该角色独有的学习成果。


层特征

属性值
层名agent_memory
ScopeScopeAgent
Actor必须有
可见范围该 Actor 在该 Agent 命名空间下
NamespaceAgentNS(agentID)
可写✅
可清空✅

命名空间

Agent 记忆使用 AgentNS(agentID) 寻址。

空 namespace 的 agent_memory 写入会返回 ErrLayerNamespaceRequired:


共享通道

Agent 命名空间内有共享通道(shared / kb: / c:)。

这些是 Agent 内的共享,不是 Cell 级共识:


典型内容

Kind示例
preference用户教给该 Agent 的偏好
correction用户对该 Agent 的纠正
lessonAgent 在执行中学到的教训
factAgent 记录的事实
convention项目惯例

耐久性

Agent 记忆的耐久性由 Kind 决定:


GC 与 Digest

Agent 记忆分区独立做 Digest:


自动注入

L4 记忆通过 Eager 和 Lazy 注入面进入上下文。

Eager 面有两个 arm 读 ScopeAgent,但 kind 集不同。