Agent 的 未来吗?String: An Agentic OS Where Every App Is a Markdown File

背景

最近 Agent 调试卡在上下文的问题上了, 中间产物全落盘,效果也不是很好

突然看到这篇文档,明年的 Agent 应该是这个样子,将通病问题全部收敛到 Agent OS System 上才是趋势

网页给人看(人选择性看信息)/ 程序给机器看(机器选择性加载用到的函数),agent 没有此殊荣(上下文越积越多)

skim skɪm

v. (从液体表面)撇去(浮物);掠过,擦过(表面);<英>用(扁石)打水漂;略读,浏览;略微讨论(或处理)(skim over);<非正式>(尤指一段时间内)挪用(小数额钱);盗用(信用卡电子信息)

n. 液面上的表层物;浏览;脱脂品(尤指脱脂奶)

adj. 脱脂的;撇去浮沫的

luxury ˈlʌkʃəri

n. 奢华,华贵;奢侈品;不常有的乐趣,难得的享受

adj. 奢侈的,豪华的

render ˈrendə(r)

v. 使成为,使处于某种状态;给予,提供;(以某种方式)表达,表现;粉刷,往(墙上)抹灰;将(脂肪)熬成油,使熔化;正式宣布(判决或决定);(供审查,考虑)提交,呈报;<文>放弃,献出;演奏,演唱;翻译;绘制(指用色彩和明暗使轮廓图像具立体感);秘密引渡(外国罪犯、恐怖嫌疑犯);从(动物身体)提取(蛋白质、脂肪及其他可用部分)

n. 底灰,底泥

  • render back:(运行时)渲染、输出返回数据给 Agent
  • one view at a time一次只提供一个视图,不把全部工具信息一股脑丢进上下文;每一轮交互,仅返回当前 Agent 此刻需要的那一部分信息,对应文中 partial views(局部视图)、staging(信息分层披露)设计

LLM agents have become a new class of software user, but every surface they work through was designed for someone else. Pages are built for human eyes, which can skim and ignore; tool schemas for programs, which pay nothing to carry definitions they never call.

大语言模型智能体(LLM agents)已经成为一类新型软件用户(software user),但它们所交互的各类界面(surface),原本都是为其他对象设计的。网页页面面向人类用户,人类可以快速浏览、选择性忽略信息(skim and ignore);工具模式定义面向传统程序,程序即便携带大量从未调用过的定义,也不会产生额外开销(pay nothing)。

An agent has neither luxury: it re-reads, and pays again for, everything it is shown on every turn. We present String, an opensource runtime that gives this user an interface of its own and treats the job as an operating-systems problem. Tool knowledge moves out of the agent's context and into a common layer that renders it back one view at a time---as Markdown.

智能体没有这两项便利:每一轮交互,它都要重新读取全部输入内容,并为此消耗 token。本文提出 String,一套开源运行时,为这类新型用户打造专属接口(gives this user an interface of its own),并把智能体交互问题当作操作系统层面的问题来处理。工具相关知识不再占用智能体上下文窗口(moves out of the agent's context),而是下沉到公共层,以 Markdown 形式按需、分视图返回给智能体。

LLM 智能体算是一种新型软件使用者,但它用的所有界面本来都不是为它造的:

网页、工具接口,本来是给 或者普通电脑程序做的:

  1. 人:网页信息再多,我可以瞟一眼,没用的直接无视,不用把每一个字都过脑子
  2. 普通代码程序:加载一大堆工具定义,不用的放着就放着,不会产生开销

❗但是大模型 Agent 不一样:

传给它的所有文字,没有 "跳过忽略" 这个功能 。每一轮交互,所有内容全部喂进上下文,全部要读取,全部消耗 token

工具再多、页面信息再杂,Agent 都得全盘接收,token 开销暴涨,这就是这一段想吐槽的核心痛点,也是 String 项目要解决的问题

举例

工具库一共 50 个工具

  • 普通程序:加载全部 50 个工具定义,本次只用 1 个,剩下 49 个放内存,没有额外开销
  • LLM Agent:把 50 个工具全部写进 prompt,每一轮都要把 50 份工具描述全部 token 计费,越堆越贵

SFMD - String-Flavored Markdown

flavored ˈfleɪvəd

adj. 调味的,有......味的

v. 给......调味;给......增添风趣(flavor 的过去式和过去分词)

staging ˈsteɪdʒɪŋ

n. 上演,演出;分段运输;集结待命,中转集结;脚手架,临时工作平台;(医学)分期,肿瘤分期;(计算机)暂存,预发布环境;(旧用)乘驿马车旅行

v. 表演,展现,演出;举办,组织,筹划;分阶段进行(stage 的现在分词或动名词)

provenance ˈprɒvənəns /

n.(正式,常与物主限定词或 of 结构连用)出处,起源,来源;(艺术品、古物等的)流传来历(即所有权记录);(数据管理)数据溯源,来源记录

operationalize ɒpəˈreɪʃənlaɪz

vt. 使开始运转,实施;将(抽象概念、目标等)操作化,转化为可操作、可测量的形式

curated

v. curate 的过去式和过去分词:筹办(收藏品或展品的)展出;挑选并陈列(作品、藏品等);组织(音乐节等的)演出

adj. 精心挑选并展出的,精选的

resident ˈrezɪdənt

n. 居民,住户;(旅馆的)住宿者;<美>住院医生;<美> 寄宿制学校学生;<史>(英国政府派驻半独立国家的) 特派代表;驻外特工;留鸟,无迁徙习性的蝴蝶(或其他动物)

adj. (在某地)居住的,居留的;常驻的;属于(某个群体)的;(鸟、蝴蝶等)非迁徙性的

catalog ˈkætəlɒɡ

n. 目录,目录册,一览表(如图书馆、商品等的目录);(计算机)系统目录,数据字典;(音乐、影视、出版等)某艺术家或公司的全部作品,作品全集

vt. 为......编目录,把......编入目录,把......登记入目录

vi. 编目录;按确定价格收入目录(等于 catalogue)

episodes

n. episode 的复数形式:事件,经历,插曲;(电视、广播连续剧等的)集;(连载故事的)节;(医学)发作,阵发

aggregate ˈæɡrɪɡət

n. 总数,合计;骨料,混凝料

adj. 总计的,合计的;(种群)聚生的

v. 集合,聚集;总计达到;合计

String 的思路:不要一次性把全部工具塞上下文,一次只给 Agent 当前需要的那一个视图 / 那一份工具描述,降低 token 消耗

A single SFMD (String-Flavored Markdown) document declares an application's views, typed actions, navigation, and credentials, and the runtime handles discovery, validation, execution, state, and secrets behind two core verbs: /open to see and /act to do.

Web and app turn out to be two renderings of one architecture: an SFMD site serves styled HTML to browsers and the raw document to agents, so one grammar reaches apps, files, shells, and the web---even legacy HTML---with no per-site integration.

一份 SFMD(String 定制 Markdown)文档即可定义(declare)应用的视图、带类型的动作、导航逻辑以及凭证信息(credentials)。

运行时封装实现能力发现、参数校验、动作执行、状态管理、密钥安全

对外只暴露两个核心指令:/open(查看)、/act(执行操作)

网页与应用本质上是同一套架构的两种渲染形态(renderings):SFMD 站点向浏览器输出带样式的 HTML,向智能体输出原始文档。因此同一套语法可以对接应用、本地文件、命令行、网页(包括老旧 HTML),不需要逐个站点(per-site)做适配集成(integration)

Views stay partial by design, and the staging is causal: disclosing one tier of detail a single turn too early costs up to 23 accuracy points, while proper staging drops wrong-action selection from 28% to 2%. Privilege follows provenance: a remote page may call HTTP but never the shell, and caller-supplied text never expands a stored secret.

视图设计为局部(partial)视图,信息分层披露(staging)具备因果约束:

  • 如果提前一轮泄露一层细节,模型准确率最多下降 23 个点
  • 合理做信息分层之后,错误动作选择率从 28% 降至 2%

权限遵循来源溯源原则(Privilege follows provenance):

  • 远程页面只能发起 HTTP 请求,禁止调用本地 shell
  • 外部传入的文本(caller-supplied text)绝对不能解锁、调取存储的密钥

On an 87-task benchmark that pairs each task with curated skills, operationalizing those procedures as on-demand String apps yields comparable aggregate success across six models from frontier to small (+1.3pp) while using 33.5% fewer tokens among completed episodes, and the resident interface stays a constant 53 tokens at any catalog size.

在包含 87 项任务、搭配精选技能集的基准测试上:

  • 把任务流程(procedure)封装为按需加载的(on-demand) String 应用,测试覆盖从前沿大模型到小模型共 6 款模型,整体任务成功率基本持平(comparable aggregate success)(仅 + 1.3 个百分点)
  • 已完成任务的 token 消耗量降低 33.5%
  • 无论技能目录(catalog)规模多大,常驻接口(resident interface)开销固定仅 53 token

一份SFMD(String 定制 Markdown)就能写清楚:页面视图、带类型的动作、跳转导航、账号凭证。

运行时包办工具发现、参数校验、执行、状态保存、密钥管理。对外只暴露两条指令:

/open:查看内容

/act:执行动作

同一个站点,一套架构两种输出

给浏览器返回漂亮 HTML 网页;给 Agent 返回原始 SFMD 文档

一套语法,就能对接应用、本地文件、shell 命令、网页,甚至老旧网页,不用针对每一个网站单独开发适配

信息分层(staging)关键点

视图故意设计成局部视图,不能一次性把全部信息扔出去。

  • 如果提前一轮就把底层细节暴露给模型,模型准确率最多暴跌 23 个百分点
  • 如果做好分层逐步放信息:模型选错动作的比例从 28% 直接降到 2%

String 整套系统完整工作流

链路

String 总览(one view):Agent 循环(命令 → 局部 Markdown 视图 → next 提示 → 结果);这套运行时给各种各样的资源(应用、文件、网页、shell、其他 Agent)提供统一一套语法。视图刻意设计为局部视图;shell 命令执行权限只留给本地内容

上方:Agent 循环(The Agent Loop)

下方:String Runtime 运行时内核 + 各类接入资源

🟦上方:The Agent Loop(Agent 工作循环,4 步)

核心思想:tiny grammar・partial view・next hint,极简指令语法 + 返回局部视图 + 附带下一步行动提示

① SEND COMMAND(发送命令)

任意大模型 Agent,只发极简指令,示例:/open budget.md,主题 topic=budget

/open就是论文里的核心动词:打开、查看某个资源

② RECEIVE VIEW(接收局部视图)

String 不会把完整大文档全部返回,返回Partial View 局部 Markdown 片段

例子:只返回预算摘要:总预算、已花费、大类

末尾附带 next: /act.drilldown ...,即 next hint(下一步提示),告诉 Agent 接下来可以调用什么动作

⚠️关键点:不是全量文档,只给当前这一轮需要的信息,用来降 token、防止信息过载

③ ACT(执行动作)

Agent 读取视图 + next 提示,发出执行动作指令:/act.drilldown --category Ads

/act是第二个核心动词,做操作、执行工具

④ RESULT(拿到结果)

运行时执行完成,返回动作结果(各广告渠道开销),再次附带新的next:下一步提示。

然后回到第 1 步,循环往复,完成任务。

循环链路:发送命令 → 获取局部Markdown视图 → 读取next提示 → 执行动作 → 获取结果

🟪下方:String Runtime 运行时内核(中间大框)

  1. Partial View :局部视图引擎,只返回当前需要的内容,拒绝全量输出,对应论文 staging 信息分层
  2. Markdown Renderer:统一渲染为 Markdown,附带 next‑hints 下一步提示,所有资源输出格式统一
  3. Trust Boundary 信任边界【安全核心】

local may shell; remote may not 本地来源资源允许调用 shell;远程网页 / 外部资源禁止调用 shell ,论文提到的Privilege follows provenance权限跟随来源溯源

  1. Action Engine:动作引擎,做参数校验、替换、真正执行动作
  2. Scoped Secrets 带作用域的密钥:凭证密钥永远不会送入大模型上下文,模型看不到密钥,防止密钥泄露注入攻击

左右两边:所有可以接入 String 的资源

左侧:Installed Surfaces(本地安装资源)

  • Files+Docs:本地 md/pdf/csv/docx 文件
  • Apps:应用程序 (git、ffmpeg 等)
  • Shell・bash:本机命令行
  • Peer Agents:其他对等 Agent(webhook 消息)

右侧:Remote Surfaces(远端外部资源)

  • Web Pages 普通网页
  • HTTP APIs 接口
  • Remote Services 远程服务
  • Agent‑Native Sites:原生 SFMD 站点(专为 String 设计的服务)

✅重点:文件、shell、网页、第三方 API、其他 Agent,全部用同一套/open /act语法访问,不需要每个数据源单独写适配代码

特点

传统 Agent:把全部工具、全部文档一股脑塞 prompt,token 爆炸,模型容易乱

String 这套机制:

  1. Agent 只发极简两条指令:/open看东西/act做事情
  2. Runtime 永远只返回局部片段 Markdown,不给全部内容,附带下一步能干啥的提示
  3. 本地文件、shell、网页、API 全部一套语法访问
  4. 安全隔离:远程来源不能跑 shell;密钥不给大模型看
  5. 一轮一轮循环完成任务,大幅减少 token,提升准确率

引言

conserve kənˈsɜːv

v. 保护,保存;节省,节约;使(量,如能量、质量)守恒;将......制成蜜饯

n. 蜜饯,果脯

An agent's capability surface is assembled at the wrong layer. Function calling, tool APIs, and skill libraries all deliver capability the same way, by describing it into the model's context as JSON schemas, API manuals, or few-shot transcripts 1, 3--5, 10, 11. Every connected capability then charges rent. Its description sits in context whether or not the current turn uses it, and the total grows with each integration while context budgets do not.

智能体的能力集合,目前是在错误的层级上进行组装的。函数调用、工具 API、技能库,实现能力供给的方式千篇一律:把能力以 JSON Schema、API 文档、少样本示例片段的形式,全部写进模型上下文 。每接入一项能力,就会产生持续开销。无论当前轮次会不会用到这个工具,它的描述信息都会常驻上下文;每新增一项集成,上下文总负载就上涨,但模型上下文窗口的上限并不会随之扩大

The cost is not only tokens. The agent has to hold, compare, and re-derive the operating knowledge of every tool it might reach for 27, 28, a burden we call cognitive load after its human counterpart 19, 20---documented for models as distraction, length, and position effects 16--18---and one that falls hardest on small models.

代价不只是 Token 消耗。智能体必须记忆、比对、反复推导所有潜在可用工具的使用知识 27,28。类比人类认知,本文将这项负担称为认知负载19,20;已有研究证实,对大模型而言,它体现为信息干扰、长上下文效应、位置偏移效应 16‑18,小模型受该问题的影响最为严重

People solved a version of this long ago. Operating systems and browsers absorb the complexity and expose one uniform way to interact 24, 25, so a person runs thousands of applications without ever learning their wire formats. Agent--computer-interface work makes the same point for the new user: performance depends strongly on the interface an agent is given 6. Agents are still living before that layer exists, with raw manuals, one-off integrations, and nothing common between the model and everything it wants to use.

人类很早之前就解决过同类问题。操作系统、浏览器承接了底层复杂逻辑,对外暴露一套统一交互范式 24,25。人类可以运行成千上万款应用,却无需学习它们底层的通信格式。面向智能体的人机接口相关研究也得出相同结论:智能体的表现极大取决于它所使用的接口 6。但如今的 LLM 智能体还没有这一层抽象:只能阅读原始文档、做一次性定制集成,模型和它要调用的各类资源之间不存在统一标准

String is our attempt at that layer, and it rests on two bets. The first is that the interface should be a document format rather than a protocol. SFMD (String-Flavored Markdown) is a strict superset of CommonMark in which a Markdown file declares views, navigation, and typed actions, so a file is an app and installing it is just copying it. The second bet is that conserving the agent's context is the runtime's job, not the agent's.

String 就是我们为打造这一层抽象做出的尝试 ,它建立在两大核心设想之上:

第一,接口应当采用文档格式 ,而不是通信协议。

SFMD(String 定制 Markdown)是 CommonMark 的严格超集。一份 Markdown 文件就可以定义视图、导航、带类型约束的动作;一份文件即是一个应用,"安装" 等价于直接复制该文件。

第二,节约智能体的上下文,是运行时的责任,而不是智能体自身的责任

We distill the system into four design principles 我们把整套系统提炼为 4 条设计原则:

• P1 --- Partial exposure. The runtime, not the agent, conserves context. Views are rendered incomplete on purpose, and everything held back stays addressable.

• P2 --- Uniform surface (location transparency). An SFMD page is the same object whether it is an installed app, a local file, or a web page: the agent drives all of them with the same two verbs, never knowing which kind it is talking to.

• P3 --- Documents as programs. An app is a Markdown file; installation is copying; au-thoring needs no toolchain. Consequently, format errors are program bugs and must be loud.

• P4 --- Recursive rendering. Action output is re-rendered as SFMD, so results carry the same affordances as pages; the interface composes with itself.

  • P1 --- 局部暴露(Partial exposure):由运行时(runtime)而非智能体负责上下文管控(conserve)。视图会刻意渲染(rendered)为不完整形态,被隐藏的全部内容依然可以被寻址访问。
  • P2 --- 统一交互层(位置透明 location transparency):一份 SFMD 页面,不管它代表已安装应用、本地文件或是网页,本质都是同一个对象。智能体只用那两个核心指令就可以操控全部资源,不需要感知底层到底是什么类型的资源
  • P3 --- 文档即程序(Documents as programs):应用就是 Markdown 文件;安装就是复制文件;开发编写无需复杂编译工具链。相应的,格式错误就等同于程序 Bug,必须明确报错提示
  • P4 --- 递归渲染(Recursive rendering):工具动作输出结果会再次渲染为 SFMD 格式。执行结果和普通页面具备完全一致的交互能力;接口可以自我嵌套组合
相关推荐
HugoStudio_SWAN2 小时前
洛谷 B4450 / B3867 / B3923 智慧购物、储蓄与做题——从程序到生活
c++·学习·程序人生·算法·生活
UIU1144 小时前
scanf与cout的误区:探究其内部的机制
c++·学习·c#·scanf
zyf1044168 小时前
暑期实践日志 Day48:复盘大纲与知识点对照表,系统汇总整理成果
学习·计算机网络·剪辑·暑期实践·课题任务
m4Rk_9 小时前
【论文阅读】Agent 记忆机制(61):CFGM——用粗到细的记忆落地贯通经验采集、知识蒸馏与在线纠错
论文阅读·人工智能·学习·开源·github
边境悍匪9 小时前
蜗牛学苑 Java 智能体学习 Day33|AOP 面向切面编程、日志技术思维导图复盘
学习
我是你的开心果77810 小时前
ai全栈软件开发day21(第四阶段喽)
人工智能·学习
网络工程小王10 小时前
【LLM开发实验】FastAPI 学习笔记
数据库·笔记·学习·mysql·fastapi
醉舞经阁半卷书111 小时前
量化交易基础之python库学习
学习
youm200311 小时前
【学习笔记】认识NoSQL——非关系型数据库
笔记·学习·nosql