Event ·Multi-source

Arav Srinivas:把 Agent 循环类比操作系统内核,Code Mode 减少 context 膨胀

Perplexity CEO Arav Srinivas 提出一个理解 Agent 架构的类比:把 LLM 当 CPU,context 当稀缺的 RAM,外部存储当磁盘,工具调用当 I/O。在这个框架下,传统的一次一个 JSON 工具调用相当于同步阻塞式 I/O,每次调用返回的原始字节都会被复制进 RAM,也就是直接挤占 context 窗口。 他提出的改进方案是 Code Mode:在 Agent 循环中嵌入 QuickJS JavaScript 引擎,配合 exec_wait 机制,让确定性的循环和结果过滤在神经网络之外运行,原始状态保存在磁盘上,慢 I/O 以异步方式执行。这样 Agent 循环更接近一个真正的操作系统内核,只有必要结果进入 context。 这个思路与 Anthropic 等公司倡导的“代码即工具”方向一致:用代码执行替代多轮工具调用,核心收益是节省 token 和 context 空间。对构建多工具 Agent 的开发者来说,工具返回数据量越大,这个架构差异越明显。

Current read

Arav Srinivas 用 CPU、RAM、I/O 的类比讲清了为什么传统工具调用会撑爆 context。Code Mode 加 QuickJS 让循环和过滤在模型外跑,只有结果进 context。做 Agent 开发的人照这个思路改架构,token 开销能省不少。

11 sources27° AI heatLast updated 2026/12/3 20:10:05

Evidence

11 sources
Primary sourceAravind Srinivas
View source
Related source 1shao__meng
View source
Related source 3Perplexity
View source
Related source 4TestingCatalog
View source
Related source 5Detik Inet
View source
Related source 6Claude Code: GitHub Releases
View source
Related source 8Artificial Analysis
View source
Related source 9Latent Space (swyx)
View source

Conflict check

Dedup data only shows that these sources discuss the same event, not that they agree. There is no structured supporting or refuting evidence yet, so no conflict is inferred automatically.