Notion 把 agent 重写了 5 次,从 2022 年末 GPT-4 时代试图后台跑 assistant 一直撞到今天的
Notion 把 agent 重写了 5 次,从 2022 年末 GPT-4 时代试图后台跑 assistant 一直撞到今天的 100+ tools custom agent. Sarah (engineering manager) 和 Simon (co-founder) 用 84 分钟 把"为什么这么慢"和"现在为什么终于行了"都摊开讲: progre…
Sarah 半路打断 Simon 抱怨预算超支、Simon 一晚要把 agents 排好队再睡觉——这种工作日常贯穿全场.
听完会发现: Notion 把"不是 wrapper"挂在嘴边,是因为 wrapper 早就不是利润来源了.
第一条 — 别逆流
是模型能力不够,还是你没把信息喂对、infra 没搭好? 先快速判别.
第二条 — 看河流方向
就算现在还不行,也开始建 — 等能力到了你已经在那儿等着.
反例: tool-calling 出现前就 fine-tune tool-calling
"硬要 fine-tune 一个 tool calling model — 那时根本还没有这种东西". 关键是别这么做太久.
Sarah 把这两条挂在嘴边给候选人看,因为它们解释了为什么 Notion 在 2022 末就开始撞 agent,
而不是等"reasoning models 出了再说".
让它在后台帮我们干活."
"试了好多次,it just was too early."
• tool calling 的概念都不存在
• 他们和 Anthropic / OpenAI 合作 fine-tune 函数调用模型
• 上下文太短
• 模型"too dumb"
Simon 自述拐点: "the big unlock was probably like Sonnet 3.6 or 7, early last year.
And that's when we started working on our agent."
v1 — 把所有事情都让 agent 写 JavaScript 调用
"模型那时根本不会写代码,it sucked at writing code"
v2 — 自创 XML tool format,few-shot 喂给模型
"the model didn't know the XML format"
v3 — notion-flavored markdown + SQL-light 查 database
"models are super good at that"
v4 — 抛掉 few-shot,改 goal-driven tool definitions
从 DAG 变成 true system with feedback
v5 — 100+ tools + progressive disclosure
现在还在做,即将上 custom agents
设计了 lossless 映射 Notion blocks 的 XML 格式. 转换很方便、对工程师友好——
"but it sucked because the model didn't know the XML format".
"It has to be just simple markdown at the core, and then we can add some enhancements.
And it doesn't have to be a full lossless conversion."
"We scrapped all that and we're like, okay, let's just make it SQL Light. Everything is a SQL Light database.
You can query it just like a SQL Light query. And the models are super good at that."
原本 Notion 的 database query API 是个挺复杂的 JSON 格式,贴近内部表示但模型不熟. 改成 SQL-light 后立刻顺.
"You want to be AGI pilled and thinking ahead and building for where things are going.
But also you wanna be like shipping useful things. So we always try to keep a balance there."
当下最 AGI-pilled 的方向:
"Coding agents are the kernel of AGI, sort of, everything is a coding agent." — Simon
他们正在搭"software factory" — 一组 agent 协同 dev / debug / merge / review / 维护代码库.
so that everybody understood the objective."
不要让所有 idea 都过 leader 的"sniff test".
and is driven by what's best for the company."
"And doesn't write design docs because they think it's their promotion packet."
Simon Vortex — 内部对原型阶段团队的称呼: 高速、方向天天变,
senior engineer 进出自如,management boundaries are loose. "you report to him, but you work for her right now."
设计师不画 mock
他们有个独立 GitHub repo 叫 design playground,直接做完整 prototype,
"they give you a URL".
工程师的 prototype = 可以打开的 feature flag
Simon: "for engineers, a prototype looks like just making it a feature flag that actually works."
员工就是用户
Notion 全公司在同一个 instance 上工作,做票务的、采购的、招聘的全都用. 同一个 instance,一堆 flag 开着.
反作用力
Sarah: "if anything can be demoed, you really need a strong filter" — 否则会做出"flat hill"而不是"tower".
另一个内部说法:
"everything we build is a little bit like a hackathon until it graduates and puts on big boy pants."
"You should be able to have an agent end-to-end download a dataset, run an eval, iterate on a failure,
debug, and implement a fix... drive the full time process with a human sort of observing the outer system."
"Claude Code... it should be totally general. I think it would be a mistake to fix it on any particular
coding agent. At the end of the day, it's just like CLI tools."
Sarah 补一句: "It's like the same way that you would have a coding agent write the unit test.
You should have a coding agent write the eval."
但监督还是要的——只是监督不必来自工程师. 来自 model behavior engineers.
① CI regression
跑在 commit hook 里,得过 — 像 unit test
② Launch quality report card
按 user journey 评分,80–90% 才上线
③ Frontier / headroom evals
"we actively wanna be at 30% pass rate"
为什么主动要难
"我们的 evals 饱和了,无法给出有洞察力的反馈" — 对 frontier labs 没价值,对自己也没价值
3 名全职员工只盯着第三层: 1 名 data scientist + 1 名 model behavior engineer + 1 名 evals engineer.
Notion 把这套和 humanity's last exam 类比着叫 "Notion's last exam".
"just needed someone to look through Google Sheets and say, yes/no, this looks good/bad".
最早招了一个 linguistics PhD dropout 和一个 Stanford 应届生.
"data scientist + PM + prompt engineer 的混合体"
他们不再人工读代码——而是用 coding agents 写 evals 和 LLM judges.
他们也是 triage failures、决定下一步投资点的人.
Sarah 的核心立场:
"We have always welcomed the misfits, so to speak. We really firmly believe that you don't need an
engineering background to be the best at this job."
这是一条独立的 career path.
所有人改同一个 system prompt 字符串.
"there were all these papers about, oh, you know, not all context is created equal. The higher up it is in
your examples, like the more the model listens, and we're trying really hard to fight against the order."
只有 5–6 个人能动那个文件.
"We could distribute tool ownership to the teams. Much better."
每个产品团队 owns 自己的 tool 和 tool definition. 他们一边修自己产品的 bug,一边维护 agent 该怎么用它.
The same team that built the underlying SQL engine owns how the agent calls it.
意外的小事故: "we have crazy things where like we write two tools that have the same title
and the agent crashes." Sonnet 处理不了同名工具,GPT-5.2 可以. 通过 sev 学到的.
agent 工作得很好 → 工程师不停加新工具 → 模型被 nerf,过度调用某些工具.
Sarah 当场吐槽: "saying hello was like thousands and thousands and thousands of tokens."
做 tool search: harness 实现 progressive disclosure,模型先看精简列表,需要时再展开.
"We're fighting to keep the prompt as short as possible."
Simon 透露: "in the latest version of the agent... there's now like over a hundred tools.
Just for all the crazy notion stuff."
要列出来吗? "It's totally public. You can ask the agent and we'll tell you. We don't think our system prompt
is our secret sauce."
CLI 的优势
天然 progressive disclosure (help / read files);
bootstrapped — agent 出 bug 能自修;
有 terminal 提供的额外能力 (paginate / cursor)
MCP 的优势
"the dumb simple thing that works";
强 permission model — "all you can do is call the tools";
适合窄、轻、严限权场景
CLI 的代价
更"murky"——能否安全 re-encrypt token 不被 exfiltrate? 引入新的 hard-to-solve 安全问题
MCP 的代价
传输坏了模型修不了; 写得糙就什么 tool 都暴露给模型
Simon: "I don't think there's an inherent strong conflict between these things." 不同抽象层、不同任务、不同代价.
• Linear
• GitHub
长尾的第三方接入靠 MCP server——所以他们也做了 Notion 自己的 MCP.
• Slack 工具
• Notion Mail 工具
• Search — 包括 Slack / Linear / Jira / Notion 全都自己做
理由: search 是 agent trajectory 的关键入口,要"高触感、高质量".
Sarah 的另一个理由 — 经济:
"requiring a language model to interface with third party providers seems wasteful for tasks that don't require it."
"if we can have our agents properly execute code that calls on CLI deterministically, it's a one-time cost,
versus constantly having a language model integrate with an MCP."
设置页是主页,然后"test the agent".
用户要在两个页面之间反复跳.
聊天是主页,设置变成侧栏 preview.
"the AGI pill way to think about it is like, oh it's just the agent.
It can set itself up, it can test itself and it can run the workflow."
代价: 这个改动让发布拖了大约一个月. 三名来自不同团队的工程师临时合体把它做出来,
"the manager doesn't complain, we were able to unblock and just ship it."
有趣的权衡: 默认情况下 custom agent 没有任何权限——你必须显式授权它. 让它自己 fix 自己?
那就破坏了这一层 trust. 现在的折中: fix 时进入 admin 模式,同步 chat,可见、需确认.
一个 agent 写 database,另一个 agent 读 database.
"that's a little bit more decoupled and works really well."
他们没造新的"消息总线"——直接用 Notion database.
即将上线: "in the settings for an agent, you can give access to invoke any other agent."
swyx 立刻问: "limit on number of recursions?"
Simon: 应该有,但你可以试试看.
同样的思路应用到 memory:
"we have no built-in memory concept. Memory is just pages and databases. And so if you wanna give a memory,
just give it a page and give it edit access to that page."
人和 agent 都能编辑同一页. 这个 pattern works extremely well.
起点
内部某 go-to-market 同事建了 30+ custom agents:
研究客户、triage 反馈、enrich CRM 等等
问题
"now I'm getting 70+ notifications per day with just the agents are blocked on various things."
Simon 给的解
做一个 manager agent — 给它 invoke 所有 30 个 agent 的权限,负责观察、调度、debug
结果
"instead of 70 notifications per day, it's like five." 多了一层抽象,manager agent 还能修下面 sub-agent 的问题.
"Nothing falls through the crack. We don't know what we don't know.
But it's not replacing people, it's replacing processes."
"Every software engineer in Notion this summer went through... the identity crisis that every manager goes through,
where all of a sudden they realize their ability to write code is less important than their ability to
delegate and context switch."
"Yeah, there's a critical difference to being a manager — it is actually very deeply technical."
人是 fuzzy 的,你没法 treat 一个团队像 rigorous system.
agent 可以——所以这是 technical design problem.
"Almost all of our best ideas come from prototypes, from people that have a cool idea because they saw a
user problem."
所以她拒绝把 idea 都过 leader 的 sniff test —— it's a huge disservice.
• fine-tuned 和开源模型按 GPU 收
• Web search 单独定价
• Sandbox 又另算
• 同一个模型在 priority tier vs async tier 价格不同
所以需要"高于 token"的抽象 — credits.
"if we wanted to ship this functionality, we couldn't afford it, it would bankrupt the company.
If we let database autofill be agentic on Opus on every single cell, it would be billions of dollars."
要给愿意花钱的客户一个出口,但不能强加给所有人.
Sarah 的原则: "we wanted to commit to making sure that customers were getting the fair deal.
Not necessarily that we were making a ton of money off of it, but that customers were paying for what was reasonable."
"Auto is not just our cheapest, dumbest model, but actually the model that's best for the task that you wanna do...
A majority of the tasks people are doing aren't Opus level intelligence."
Sarah 担心的市场缺口:
"the nano haikus, etc, haven't caught up to where reasoning models were six months ago. Now we're paying more
for extra capability that we didn't necessarily need."
解法之一: 让开源模型(MiniMax 等)填中段空隙,合作做 Notion's last exam.
"I personally burned a lot of time trying to train models. And it's tempting, right?"
Sarah 插一句: "I was the budget person that came and found out and showed up and heard that was happening — time out."
retrieval / ranking — 因为大部分 search 流量已经来自 agent 而不是人.
"for notion retrieval, vector embeddings are less and less" 重要. 重点变成 query diversity 和 top-K.
Simon 的核心建议:
"don't focus too much on training. The outer loop is — you have a model and some harness/system where it's
interacting with the system that needs to work. If there's a problem, the way to solve it isn't necessarily
to train a model. 99% of the time it's a bug in one of the tools. Just fix the bug."
当年训模型时 24/7 围着实验转,睡前要把所有 run 都启好.
"now every night before I go to bed, I'm like, okay, did I start enough agents... that they won't be done by the time I wake up."
"I had a single coding agent thread going for I think it was like 17 days. Pretty much continuously."
"it had done compaction like a hundred times probably." — Simon 说后来发现是 harness 的 bug.
Sarah: "There was a point where he had outlived the thread length and context length that that coding agent
provided. And our account rep DMed me directly and they're like, 'is Simon trying to prove string theory?'"
"in terms of virality of adoption and retention, quite strong."
内部用法: Sarah 写 self-review 直接让 agent 看她和 manager 的所有一对一 meeting notes —
"if I didn't talk about it in my one-on-one, it probably wasn't relevant for my performance review."
"thinking about it as data capture — that's what meeting notes is."
新接入的 manager Zach 把 vertical team 重组围绕这个定位 — 数据沉淀进 system of record,
agent 可以一直用、ranking team 可以一直 index.
Simon 提到的最近改动: Meeting notes 在 summary 里 @-mention 涉及到的人,
"I now get notifications whenever someone talks about me." 用 agent 配合 people-to-people similarity cache
来判断 "哪个 Simon".
"Our job is to not make the best harness for agentic work.
Our job is to be the best place where people collaborate."
Datadog ↔ AWS 的类比
"Datadog could not exist without cloud storage. AWS has a CloudWatch product, but Datadog is an expert on
observability." Notion 之于 frontier labs 也是这层关系.
所以: wearable / 硬件? "we would partner with whoever's building one of those." 不亲自下场.
"Our job is to build the best place where meeting notes live." 让别人 pipe 给我们.
"Coding agents are the kernel of AGI, sort of, everything is a coding agent."
"You need to build a team that's comfortable deleting their own code and is very low ego... and doesn't
write design docs because they think it's their promotion packet."
"It's not replacing people, it's replacing processes."
"Let's just make it SQL Light. Everything is a SQL Light database... and the models are super good at that."
"If we let database autofill be agentic on Opus on every single cell, it would be billions of dollars."
"99% of the time it's a bug in one of the tools, right? And so just fix the bug."
"We have no built-in memory concept. Memory is just pages and databases."
"Our job is to be the best place where people collaborate."
Notion 用三年五次重写换来的不是某个具体 agent 架构,
而是一支"comfortable deleting their own code"的团队 —— 和一个让模型"想要什么就给什么"的肌肉记忆.
Latent Space · Sarah Sachs × Simon Last × swyx & Alessio · 2026 · ≈ 84 min