AI DevCon by Tessl · 2026-11 · 31:26

记忆不是提示词:
把 agent 的记忆做成文件系统,再让它夜里自己整理

Anthropic 应用 AI 团队的 Lamis 用 27 分钟把"上下文工程"这一年走完的路压成一条链:一个 markdown 文件 → 交给 agent 自己写的记忆工具 → skills 的渐进披露 → 干脆当成文件系统。然后她说:这条链在你只有 3 个 agent 时是对的,到上千个长跑 agent 时会崩,于是补上四件生产化工具(版本 / 内容哈希 / 权限 / 可移植),再加一个带外批处理——dreaming。

31:26全长 · 27′ 演讲 + 4′ Q&A
11张幻灯片
5记忆架构的台阶
4生产化工具
97%少第一遍错误(客户证言)
0口播里念出的效果数字

素材:@HeyShobhan 转发的这场 talk(AI DevCon by Tessl 现场,含现场 Q&A)。讲者自述:"my name is Lamis, I'm a member of technical staff at Anthropic, I work on our applied AI team";主持人口播与 ASR 均作 Lamis / Lamix,屏幕上没出现拼写,本文统一写 Lamis。

一句话

记忆 = 一堆 markdown 文件;agent 用 bash / grep 自己读自己写;要上生产就在 harness 里加乐观锁(内容哈希)、版本、权限分层和 API;再在带外跑一个 dreaming 批处理,让一个 orchestrator 派一堆 subagent 逐个啃 session transcript,找出"所有 agent 都在同一种地方错"的模式,把改动提案写回记忆库——人只需点接受或拒绝。

一句话里她唯一没说、但整套设计默认成立的东西:读是廉价的、写是危险的。所以所有工程都堆在写路径上,读路径只有一句 "agents are just very good at bash and grep"。

01声称 vs 屏幕

左边是她口播说的,右边是幻灯片上真写着的东西。屏幕是第二事实源——它两次给出了口播漏掉的实现细节,也把口播里没有的数字全放了出来。

口播(他说)屏幕(画面上)判定
"file systems are great… agents are just very good at using normal file system tools like bash and grep" memory/ → notes/, deploy.md, team-rules.md;底注 "Files read and written by agents" 一致
"you need to be able to store versions… roll back… which session, which transcript… who did it, which agent, which human" team/deploy.md:v1 v2 v3 [v4 = head]、written by 一个红色打码 id、precondition content_sha256: 9f2c.. 一致,屏幕更细
"it takes a hash, drafts its edit, then before it writes… takes another hash. If those two things do not match, the agent cannot write it" "A content-hash precondition before each write — living in the harness, not the model." 屏幕补了口播漏的一刀:这个检查在 harness,不在模型
"it additionally gives you examples of transcripts… and some stats on how prevalent this issue is… you can decide where you want to accept changes" dreaming pass 图只画到 output memory store:① clone ② orchestrator → subagent "one per session" ③ read/write to reorganise。没有审批界面 口播有、屏幕无
"you get better accuracy… they're spending fewer tokens… second-order effect on speed and cost"(全程没念数字) 97% fewer first-pass errors / 27% lower cost / 34% lower latency / 30% faster verification 数字只在屏幕上,且全是客户证言
"we're not allowed to make product call to actions. But given that you asked…" 紧接着点名 "our memory and dreaming API through Claude Managed Agents" 自我声明与行为相反
推文文案:"in 45 minutes she shows exactly how…" 视频 31:26,其中 4 分钟是现场问答 转发者的说法,非讲者

※ 幻灯片底部那排 "PROUDLY SUPPORTED BY …"(Tessl / Nearform / snyk / paper compute / codurance / Anyshift)与画面底部那些橙色大字幕都是视频自带的,不是本报告加的;橙色字幕偶尔压住幻灯片最下沿一行。

02五级台阶:记忆是怎么一步步变成文件系统的

"do the simple thing that works" 是她的开场原则,也是这条链的形状——每一步都是被上一步的毛病逼出来的,不是设计出来的。

  1. ① CLAUDE.md:一个 markdown 文件,被塞进会话开头 "it was kind of unreasonably effective… this markdown file that just gives the agent a couple of instructions about your way around the code base, the organization, your own user preferences." 毛病:文件越长,上下文越肿(context bloat),没法随时间管理。她保留了结论里最硬的那半句:人可读、agent 可写、你也可写,这一点从头到尾没变过。
  2. ② memory tool:把"什么时候记"交给 agent "we let them decide when they read, when they write, and when they update memories… this is all happening in-band, which means within the context of a session." 结论是她这场演讲里第一个反直觉判断:"autonomy proved to work really well"。给工具(memory_read / write / edit)不如给自由。这也是后面所有麻烦的源头。
  3. ③ skills:渐进披露,先看两句话,要看再打开 "as if I've had a bookshelf in my room, and every time someone talks to me, I can scan my list of books and see if any of the titles might be relevant… and pick that off the shelf." 她顺手给了这条路的边界:skills 适合有端到端主张的流程("you have an opinion about how the process works end-to-end"),而且瓶颈仍在人——是你在判断"什么该有 skill"。
  4. ④ 干脆就当文件系统:让她自己 grep "file systems are great. You can just fill them up with markdown… just let them search over the file system, rather than being opinionated about the specific tools they should use to read and write to memory." 这一步等于把 RAG 换成了文件系统:不做向量库,不定义记忆 schema,索引 + 搜索 + 渐进披露三件事由 grep 和目录结构免费提供。
  5. ⑤ 收口:三条主线(格式 / 读 / 写) "Format: markdown works — everything that stuck relies on human-readable context. Reading: load progressively — frontmatter and search pull in only what's relevant, never everything at once. Writing: autonomy wins." 她在这里给了一个"到这就够用"的完成度判断:"if you were to go out and build this system, it would work really well… you would have the feeling of continual learning"——然后立刻转折:as with everything, this very neat idea runs into some problems when you try to scale it to production。
How agent memory evolved 幻灯片
03:40 · "How agent memory evolved":四格横排 CLAUDE.md → memory tool → skills → memory/,底注分别是 Single file memory / Memory as a tool / Procedural memory / Files read and written by agents。memory/ 那格画成绿色,是当前落点。
The lessons so far 幻灯片
08:05 · "The lessons so far — Three throughlines across every memory approach that stuck":Format(CLAUDE.md · SKILLS · memory/*.md)/ Reading(frontmatter + grep, not the whole store)/ Writing(the agent decides what's worth keeping)。注意 Reading 那格的代码字样:她把实现直接写在幻灯片上了。

03生产化:三个会打人的场景,四件工具

这是全片信息密度最高的五分钟。她先不给答案,先让你自己想到出事:

  • 多个 agent 同时写同一个记忆文件,怎么办?
  • 一个 agent 撞了墙,顺手去改"组织级上下文"——而所有别的 agent 正在读那份东西。她的原话:"if something was incorrect there, that would scale to all of your agents and be pretty disastrous."
  • 记忆会过期,甚至被恶意注入:"maybe it was written incorrectly, or even maliciously injected by someone trying to prompt inject your agents to write bad things to memory."

01版本(versioning)

每次写可归因到 author / session / time,全历史可查、可回滚。屏幕上的样张比口播更具体:v1 v2 v3 v4=head + written by + content_sha256: 9f2c..。

02并发(concurrency)

写前取一次哈希、落笔前再取一次;不一致就重读、重排、重试。屏幕上那句是这场演讲最值钱的一行:这个前置条件 living in the harness, not the model。

03权限(permissioning)

组织级知识只读,agent 自己的 scratch pad 可读写,中间还有团队 / 跨切面层。"you wouldn't want one agent to just decide that it should update the organization-wide context."

04可移植(portability)

"it's just files, with a standard API on top — memory goes where you go." 理由很实在:记忆是你要长期攒的资产,不该锁在一个产品界面里。

Versioning & concurrency 幻灯片
11:00 · "Scaling to production — Versioning & concurrency"。右侧是 team/deploy.md 的样张,逐行:version v1 v2 v3 [v4 = head]/written by 一个红色打码的用户 id/precondition content_sha256: 9f2c../content:"Deploy via make ship, not ./deploy.sh. … corrected this in PR #412, #418, #431."。第二行字被压得很淡,PR 号可读,主语读不出。
Built for multi-agent systems 幻灯片
12:50 · "Scaling to production — Built for multi-agent systems":03 Permissioning(read-only 共享组织知识,read-write 自己的 working memory)、04 Portability(just files + standard API)。右侧拓扑:三个 agent 会话(session_004_*)扇出到 shared org context(org-conventions/owners/style-guide.md/security.md/escalations.md)与 team-memory(deploy.md/incidents.md/repo-layout.md)。
What teams see with memory 幻灯片
13:55 · "In production — What teams see with memory":三张客户证言卡。97% fewer first-pass errors(GP, AI for Business,全球电商平台;同卡里还有 27% lower cost、34% lower latency)/30% faster verification(Head of Machine Learning,文档 AI 平台)/Focus on the product(Founder,早期 AI 创业公司)。这几组数字口播一个都没念。

04dreaming:给记忆加一个"夜里复盘"的进程

她先承认 in-band 记忆有天花板,再给一个跨 session 的解法。这是全片唯一一处真正的架构增量。

天花板有两条,屏幕上写成四条:

  1. 注意力被劈成两半(split focus) "you're asking an agent to complete a task, but at the same time, you're also asking it to invest in memory curation, which would help it perform better in a future run… it's just a very difficult optimization problem."
  2. 可见性只到本 session(patterns obfuscated) "they just won't see patterns that happen across sessions, so when you get frustrated that your agent keeps making the same mistake over sessions, it just doesn't understand how frustrating that is, because it has a new context window in each of those."

她还补了第三、四条:多 fleet 时单个 agent 看不到别人的失败;以及记忆会 stale。屏幕上的措辞更狠——"Duplicates that disagree; notes gone stale — confidently wrong"。

她用来论证的类比是学校

学生交作业 → 老师专门腾出产能帮人学 → 校长看全年级、发现"整个地理班这道题全错"这种模式,然后改课程。翻成 agent 语言:在带外的进程里花 token 去解决"让 agent 学得更好"这个问题。三个真实的例子都是屏幕/口播同一套:

  • 整个话题缺课:地理班全员答错 → 查记忆库发现整个主题不在课程里 → 补上。
  • 工具配置错:数学卷全员把弧度当角度 → 换成 agent 的话就是"某个 tool call 一直失败" → 改配置。她顺手说了句 GCSE 的梗("I don't know if anyone else in GCSE maths had that problem")。
  • 全组织层面的偏好:"everybody's using too many em dashes and you don't like that" → 加一条组织级公告。
Introducing Dreaming 幻灯片
18:00 · "The resolution — A second-order process / Introducing Dreaming":唯一一句定义 —— "A batch process that runs out of band — with a single objective of curating memory."

流程本身五步,她讲得很具体:

  1. 取一个已有记忆库 + 一段时间内的一批 session transcript,一起交给 agent。
  2. Orchestrator 派一队 subagent,一个 session 一个,各自啃自己那份转写。她说这里可以steering:告诉它们"在你的场景里,这些东西重要、那些不重要"。
  3. 看的不止对话:"we're not just looking at the passes of responses between agent and the system or the user. We're also really scrutinizing those tool calls and all the other metadata that is really central to the agent's performance."
  4. orchestrator 汇总,只在模式足够普遍时才提案:proposes individual changes to the memory store。
  5. 每个提案附证据:example transcripts + "how prevalent this issue is" + 为什么值得改。然后人点接受或拒绝。
Inside a dreaming pass 幻灯片
21:30 · "Inside a dreaming pass":① clone —— 输入 memory store 复制成 output memory store(图上变量名小字写作 …SPEN → …SPEN_OUT,字太小,只敢照抄可辨部分);② orchestrator 派 subagent,"one per session";③ subagent read / write to reorganise 输出库。注意:原库不动,改动落在副本上——这是她能"接受或拒绝"的前提,但口播一句都没提这层保护。
A unified memory system 幻灯片
23:30 · "A unified memory system":左半实时("Memory — Real-time updates as agents work"),三个 agent 会话双向箭头连 team-memory;右半批量("Dreaming — Periodic batch updates between sessions"),session transcripts → Dreaming(Verify / Organize / Prune)。两个进程并行,一个抢时效,一个抢全局。

"那不是很贵吗?"她自己先问了:"you might think, okay, that sounds really expensive. Why would I want to chuck extra resources at this?" 她的答案是成本会回头——记忆好了,agent 一次做对的概率高,token 花得少,"you can see a bunch of costs go down"。这个账她没给数字(和 97% 一样,数字只在幻灯片上)。

05暗知识:她没说、但整套设计默认成立的东西

这些不是转述,是从她的取舍里反推出来的前提。任何一条不成立,她的架构就得换。

01读便宜、写昂贵

四件生产化工具(版本/哈希/权限/可移植)全在写路径上;读路径只有一句 "let them grep"。因为读错了可以重搜,写错了会传染整个 fleet。

02文件系统是一次"白拿"

选文件系统不是为了简单,是为了免费继承 diff、mv、权限、备份、git、人机同一套工具。代价是放弃语义检索——她认为 grep 已经够好,且可解释。

03dreaming 的成本要靠未来回收

她敢"多花 token 去做学习",前提是记忆能把后续 N 次 one-shot 的失败率压下去。这个回收周期没有公式,只能靠体感——这是它至今仍是"art"的部分。

04哈希前置条件 = 乐观锁

"take a hash, draft, take another hash" 就是 compare-and-swap。它的隐含代价她一句没提:高并发写同一文件时冲突会反复重试,需要退避甚至合并策略。

05dreaming 的真相源是 transcript

它拿"发生过什么"当证据。如果 transcript 里 agent 已经错了,dreaming 会把错误当模式提取出来、再放大。她自己承认记忆会 "confidently wrong",但没承认这条回路。

06权限是拓扑,不是 ACL 表

三层(组织只读 / 团队共享 / 个人 scratch pad)对应的是谁能污染谁,不是谁能读谁。学校类比的真正含义:校长的价值在于看得见全年级。

07这场演讲本身是漏斗

27 分钟通用原理 + 一句"我们不能做产品推销",然后 Q&A 里把 Claude Managed Agents 的 memory & dreaming API 端出来。真正的产品卖点是:那四件生产化工具你都不用自己写。

06哪里会崩

按"最可能先在真实部署里出事"排序。

97% / 30% 没有方法学

三张卡都是客户证言,没有样本量、任务定义,也没说 "first-pass error" 怎么算。她自己口播时只讲方向("it actually does it better with higher results"),数字全留在幻灯片上——这个差别不是偶然。

"人点接受或拒绝"在规模化后是人肉瓶颈

她只说 "you as the individual can decide"。一千个用户、每天上千条提案时谁审?Q&A 里第二个问题(企业百人不同权限集)她答的是"你在配置 dreaming 时自己选哪批 transcript"——等于把越权风险外包给用户的配置正确性。

记忆被污染会扩散,而校验回路不闭环

她自己说组织级上下文被写错会 "scale to all of your agents and be pretty disastrous",也提到 prompt injection 往记忆里写坏东西。但 dreaming 的校验依赖的正是同一批 agent 的 transcript。谁来做那个"外部真相"?她没答。

乐观锁在高冲突下会活锁

她描述的重试路径(重读 → 重排 → 再提交)没有退避、没有合并、没有优先级。对单个文件、少量 agent 无所谓;对热点文件(比如 team-memory 里的 deploy.md)就是另一回事。

被问到"是不是在重新发明数据库",她基本承认了

原话:"we sort of are merging back into those practices, but that's because we have enough signal now to know that those things should just be done in a very deterministic way, and there's no need to reinvent the wheel." 值得记的是这个转向:先把 agent 交给自由("let them write markdown and commit whatever they wanted"),看到哪些 primitive 稳了,再把它搬进 harness 变成确定性代码。

"不只适用于写代码"这句是自救,也是软肋

她用"我做 presentation 也会用,记忆里有我怎么写、怎么排版"来证明通用。这条是真的,但演示全靠编码场景——非编码场景下"什么算错误"更难判定,dreaming 也就更难验证。

07可迁移:删掉 Anthropic 这三个字还剩什么

  • 多写者共享状态的三个老问题,agent 一个没多。谁有权写(权限)、写完撞了怎么办(乐观锁)、写完谁验(审计/版本)。这三个是四十年前就解决过的,agent 只是把写者从人换成了模型——所以她的答案也回到了老工程。
  • in-band 与 out-of-band 的分野是通用的。前台做任务、后台做学习;在线学习系统的两条硬约束永远是"注意力分裂"与"只能看见自己那条 session"。任何想让系统"越跑越好"的设计都会撞上它们。
  • 把判断权交给模型,把确定性留给 harness。她最锋利的一句是这个分工("living in the harness, not the model"),而且它自带迁移性:什么该写成代码、什么该留给模型,正是"给 agent 自由度"这件事真正的工作量。
  • "先自由、再收编"是可行的演进路径。她们先让 agent 随便写 markdown、随便 commit,看到哪些 primitive 真稳,才把它们编成 harness 里的确定性机制。反过来(先设计 schema 再上 agent)在这条路上没被验证过。
  • 记忆是资产,不是缓存。所以她把它做成文件 + 标准 API,"memory goes where you go"。任何把用户攒下的上下文锁死在自家界面里的产品,长期都在跟用户作对。

08判定

这是一场架构综述,不是方法论揭秘。她给的不是新算法,而是一条被生产事故逼出来的演进链(markdown → memory tool → skills → 文件系统 → dreaming),真正的增量有两处:dreaming 的带外批处理结构(clone 副本 + orchestrator 派 one-per-session subagent + 提案带 transcript 证据 + 人工 accept/reject),以及那句把责任划清的 "living in the harness, not the model"。

软的地方也很清楚:所有效果数字只出现在幻灯片上、口播一个没念;dreaming 的验证回路依赖它自己要验证的东西;权限问题被答成"你自己配置"。最值得抄的是她的工程直觉:先把 agent 放自由,再把它学过的东西编成确定性代码。

Three takeaways 幻灯片
25:00 · "Three takeaways":① Do the simple thing that works(好的 CLAUDE.md、定义清楚的 skills、agent 自己写的记忆,已经能走很远)② Design for many, long running agents(Permissioning, versioning, concurrency, portability)③ Add dreaming to consolidate memory out of band(verify, organise, enrich between sessions)。