Exploring Super-agent Design: Towards a More Autonomous Agent System
打开互动全文版(逐段中英对照 + 针对本篇提问)→本文提出了一种“Super-agent”的系统架构,这是一种自主智能体,旨在克服当今单会话智能体设计的局限。文章认为,将单个会话视为基本工作单元的主流智能体受制于人类注意力:用户通常只能同时跟踪三到五个并行会话,不同任务的上下文会相互混杂,而长时间操作会阻塞执行。核心论点是,智能体必须与任何人工驱动的会话解耦,转而成为一个连续实体,能够跨会话保留上下文,并同时运行多个复杂任务而不相互干扰。作者定义了 Super-agent 的四个特征——连续性、高效性、主动性和持久性,并提出了一个五模块框架:用于实现连续性与并发的两级 Router/Worker 架构、用于实现主动性的事件驱动设计、全双工多通道交互、计算、状态与环境的分离,以及用于持久运行的 Watchdog。结论是,会话应成为一种实现细节,而非用户的负担;类似的设计约束将推动个人智能体和商业智能体走向相似的架构。
This article proposes a system architecture for a "Super-agent," an autonomous agent designed to overcome the limitations of today's single-session agent designs. It argues that mainstream agents, which treat one session as the basic unit of work, are constrained by human attention: users can typically track only three to five parallel sessions, and contexts from different tasks become mixed while long operations block execution. The core argument is that the agent must be decoupled from any manually driven session and instead become one continuous entity that preserves context across sessions and runs multiple complex tasks concurrently without interference. The authors define four characteristics of a Super-agent—continuous, productive, proactive, and persistent—and propose a five-module framework: a two-level Router/Worker architecture for continuity and concurrency, an event-driven design for proactivity, full-duplex multi-channel interaction, separation of compute, state, and environments, and a Watchdog for persistent operation. The conclusion is that sessions should be an implementation detail rather than a user burden, and that similar design constraints will lead personal and commercial agents toward similar architectures.
原文为中文。本文为机器翻译。
The original article is in Chinese. This is a machine translation.
本文讨论的是架构层面的构想,并非对 DeepSeek Harness 现有功能的介绍。
This article discusses architectural ideas. It is not an introduction to existing features of DeepSeek Harness.
在过去一年中,编码智能体和其他单任务智能体已经表明,模型可以使用工具来解决复杂问题,同时越来越不需要人类持续监控和逐步干预。模型在协调多个智能体方面也变得更好了,这使得跨会话组织和安排工作变得可行。随着人们在低层执行中参与减少,他们的角色逐渐上升到更高层的决策和签核。
Over the past year, coding agents and other single-task agents have shown that models can use tools to solve complex problems while needing less and less continuous monitoring and step-by-step intervention from humans. Models have also become better at coordinating multiple agents, which makes it practical to organize and schedule work across sessions. As people take less part in low-level execution, their role is gradually moving up to higher-level decisions and sign-off.
更好的模型也催生了新的应用。最近,出现了许多个人智能体。它们直接连接到日常的消息、日历、电子邮件和工作平台,监控信息流,并帮助完成任务。个人智能体只是这种始终在线、事件驱动的工作方式的一种应用。这种工作方式并不特定于个人使用,在商业工作(如软件开发)中也很有价值。
Better models have also enabled new applications. Recently, many personal agents have appeared. They connect directly to everyday messaging, calendar, email, and work platforms, monitor the feeds, and help with tasks. Personal agents are only one application of this always-online, event-driven way of working. This way of working is not specific to personal use and is also valuable in commercial work such as software development.
然而,当今主流的智能体设计难以支持跨多个任务或整个团队的这种工作方式。智能体仍然以单个会话作为基本工作单元,并且会话之间相互隔离。用户并行运行多个任务时,必须手动切换会话并记住每个会话的内容。根据我们的经验,一个人通常一次只能跟踪 3 到 5 个活跃会话。在这些设计下,单个任务受模型能力限制,但多任务处理受人类注意力限制。
However, today's mainstream agent designs struggle to support this way of working across many tasks or a whole team. Agents still use a single session as the basic unit of work, and sessions are isolated from one another. A user running several tasks in parallel has to switch between sessions by hand and remember what each one contains. In our experience, a person can usually follow only 3 to 5 active sessions at once. With these designs, a single task is limited by model capability, but multi-tasking is limited by human attention.
向现有的本地单会话智能体添加 CLI、MCP 或外部连接器,可以让它接收外部消息,但其基本限制仍然存在。它仍然在一个同步会话中运行,在长时间操作上阻塞,不同任务的上下文混在一起,并且每当本地设备离线时一切都会停止。保持这样的设置运行需要大量手动工作。
Adding CLIs, MCP, or external connectors to an existing local single-session agent lets it receive external messages, but its basic limitations remain. It still runs in one synchronous session that blocks on long operations, contexts from different tasks get mixed together, and everything stops whenever the local device goes offline. Keeping such a setup running takes a lot of manual effort.
要突破这些限制,意味着将智能体与任何单一的、手动驱动的会话解耦。相反,智能体应该是一个连续的实体,跨会话保持其上下文,并同时处理多个复杂任务,而任务之间不会相互干扰。我们称这种智能体及其系统架构为 Super-agent。
Getting past these limits means decoupling the agent from any single, manually driven session. Instead, the agent should be one continuous entity that keeps its context across sessions and works on several complex tasks at once, without the tasks interfering with each other. We call this kind of agent and its system architecture a Super-agent.
例如,我们内部的 Super-agent 实例运行在 DeepSeek Harness 上,能够在 IM 和 GitHub 之间延续同一项开发任务。它还会监控公开群聊中的反馈,即使没有人 @ 它,它也能自行定位根本原因并提交 Pull Request 来修复:
For example, our internal Super-agent instance, which runs on DeepSeek Harness, can continue the same development task across IM and GitHub. It also monitors feedback in public group chats and, even when no one @-mentions it, finds root causes on its own and opens Pull Requests to fix them:
我们认为 Super-agent 具备四个基本特征:
We believe a Super-agent has four basic characteristics:
* **连续性:**用户可以直接在他们原本工作的地方(如 IM 聊天和 GitHub 评论)与它交互,并且它始终感觉像同一个智能体。用户永远不必担心会话 X 的上下文中是否包含信息 Y。例如,如果用户在 IM 中要求方案 A,之后在 GitHub Pull Request 评论中改为方案 B,智能体能理解这一变化并调整它正在做的事情。
* **Continuous:** Users can interact with it directly where they already work, such as IM chats and GitHub comments, and it always feels like one agent. They never have to wonder whether session X has information Y in its context. For example, if a user asks for Plan A in IM and later switches to Plan B in a GitHub Pull Request comment, the agent understands the change and adjusts what it is doing.
* **高效(Productive):**它能快速响应,并行完成多个复杂任务,且每项任务都达到高标准。它可以在上一条命令或任务尚未完成时接收下一条指令。
* **Productive:** It responds quickly and completes several complex tasks in parallel, each to a high standard. It can take the next instruction before the previous command or task has finished.
* **主动(Proactive):**它不等待逐步指令。它监控环境中的事件,对任何值得处理的事情采取行动,否则保持安静。
* **Proactive:** It does not wait for step-by-step instructions. It monitors events in its environment, acts on anything worth handling, and stays quiet otherwise.
* **持久(Persistent):**它始终在线,直接连接到用户真实的工作环境,并在长时间运行过程中自动从异常中恢复。
* **Persistent:** It is always online, connects directly to the user's real working environments, and recovers automatically from anomalies during long-running operation.
单个 ReAct 循环无法同时提供全部四个特性,因此这些特性必须来自其周围的系统架构。相似的设计约束往往会产生相似的架构。当目标是构建一个始终在线、能并发响应环境事件的系统时,我们预计个人智能体与用于商业工作(如软件开发)的智能体最终会采用相似的设计。构建这样的系统还会引发许多与计算机系统领域长期研究过的问题非常相似的问题,因此该领域的许多经典设计思想在这里同样适用。
No single ReAct loop can provide all four characteristics at once, so they have to come from the system architecture around it. Similar design constraints tend to produce similar architectures. When the goal is an always-online system that responds to environmental events concurrently, we expect personal agents and agents for commercial work such as software development to end up with similar designs. Building such a system also raises many problems much like those long studied in computer systems, so many classic design ideas from that field apply here too.
具体实现会有所不同,但我们认为五个模块构成了支撑这些特性的基本框架。两级架构(第 2 节)同时提供*连续*交互与*高效*并发。事件驱动设计(第 3 节)使智能体具有*主动性*。全双工多通道交互(第 4 节)使与用户的每次交流既*连续*又*高效*。将计算、状态与环境分离(第 5 节),再加上 Watchdog(第 6 节),使智能体能够跨设备*持久*在线,并自行从异常中恢复。
Implementations will vary, but we think five modules form the basic framework that supports these characteristics. The two-level architecture (Section 2) provides both *continuous* interaction and *productive* concurrency. The event-driven design (Section 3) makes the agent *proactive*. Full-duplex multi-channel interaction (Section 4) keeps each exchange with users both *continuous* and *productive*. Separating compute, state, and environments (Section 5), together with a Watchdog (Section 6), keeps the agent *persistently* online across devices and lets it recover from anomalies on its own.
下图给出了 Super-agent架构的概览。标记为 [2] 至 [6] 的模块将在第 2 至第 6 节中介绍:
The diagram below gives an overview of the Super-agent architecture. The modules labeled [2] through [6] are covered in Sections 2 through 6:
同时支持跨渠道的*连续*交互与跨任务的*高效*并发,迫使系统在组织会话的方式上,在连续性与吞吐量之间做出根本性的权衡。
Supporting both *continuous* interaction across channels and *productive* concurrency across tasks forces a fundamental trade-off between continuity and throughput in how the system organizes its sessions.
将每个事件都路由到同一个会话能获得最连续的上下文,因为该会话能看到所有内容。但 ReAct 循环一次只运行一步,这限制了单个会话的工作速度:任务耗时长,吞吐量始终很低。不同任务的中间细节最终也会交错在同一个上下文中,从而降低结果质量。
Routing every event to one session gives the most continuous context, because that session sees everything. But a ReAct loop runs one step at a time, which caps how fast a single session can work: tasks take a long time and throughput stays low. The intermediate details of different tasks also end up interleaved in one context, which degrades the results.
为每个事件分配各自的新会话则逆转了这一权衡。它最大化了并发吞吐量,但当任务并非完全独立时,缺乏共享的全局上下文会使其结果彼此割裂。多个会话分别回复用户也会让交互变得混乱。
Giving every event its own new session reverses the trade-off. It maximizes concurrent throughput, but when tasks are not fully independent, the lack of a shared global context leaves their results disconnected. Several sessions replying to the user separately also make the interaction confusing.
为了同时获得连续性与吞吐量,我们可以将工作拆分到两个层。长期存活的 Router 层(第 2.1 节)通过处理所有人类交互与全局协调来维持全局连续性,而上下文隔离的 Worker 层(第 2.2 节)则以高并发执行任务,如下图所示:
To get both continuity and throughput, we can split the work between two layers. A long-lived Router layer (Section 2.1) maintains global continuity by handling all human interaction and global coordination, while a context-isolated Worker layer (Section 2.2) runs tasks with high concurrency, as shown below:
借助双层架构,系统接管了上下文管理与并发执行,因此用户几乎无需考虑会话,始终与同一个 Super-agent 协作。让用户手动管理会话,在很大程度上是一种沿用自底层 LLM API 的设计习惯。会话应当成为系统的实现细节,而非用户的心智负担。
With the two-level architecture, the system takes over context management and concurrent execution, so users seldom have to think about sessions and always work with the same Super-agent. Making users manage sessions by hand, then, is largely a design habit carried over from low-level LLM APIs. Sessions should be an implementation detail of the system, not a mental burden on its users.
在现有设计中,会话承担两项职责:管理模型的上下文,同时充当用户的项目管理单元。一旦产品与底层会话解耦,项目管理便不再需要遵循会话边界。向用户提供何种交互与任务管理,就成为一个独立的产品问题,我们将在后文讨论。
In existing designs, a session does two jobs: it manages the model's context, and it is the user's unit of project management. Once the product is decoupled from the underlying sessions, project management no longer has to follow session boundaries. What interaction and task management to offer users becomes a separate product question, which we return to later.
这两个层级是职责上的逻辑划分。任何一层都不必实现为单个会话,且各自可以拥有内部结构。接下来的两个小节将依次描述这两个层级。
The two levels are a logical division of responsibilities. Neither layer has to be implemented as a single session, and each can have its own internal structure. The next two subsections describe the two layers in turn.
Router 层是一个长期存活的全局路由层,负责接收来自每个入口点的人类交互。所有跨任务的信息与决策都在此汇聚,因此它充当系统的全局序列点、协调点与记忆。为避免这一单一全局节点成为性能瓶颈,Router 层被设计为不自行执行任务。它只与人类交互并分派任务,且完全可以在没有 Bash 工具的情况下运行。
The Router layer is a long-lived global routing layer that receives human interaction from every entry point. All cross-task information and decisions come together there, so it serves as the system's global sequence point, coordination point, and memory. To keep this single global node from becoming a performance bottleneck, the Router layer is designed not to execute tasks itself. It only interacts with humans and dispatches tasks, and it can run without a Bash tool at all.
由一个中心节点向多个执行节点分派任务,这种结构看起来像典型的 Agent Team,但二者关注点不同。Agent Team 通常将一个复杂任务拆解为若干步骤,并协调负责这些步骤的角色。由于这些步骤往往紧密耦合,Team Lead 常常需要深入理解任务、规划子任务并频繁协调成员,这累积成沉重的推理负担。而在 Super-agent 中,Router 层只分派任务,并在高层面上跟踪任务之间的关联,它不拆解单个任务。反过来,Agent Team 也可以采用两级架构。为此,其提示词必须阻止主会话自行执行任务,将其限制在外部交互以及向成员分派独立任务上,由成员独立完成这些任务。根据我们的经验,Router 层的工作往往比预期更简单,一个更轻量的模型通常就能同时提供速度与质量。
With one central node dispatching tasks to several execution nodes, this structure looks like a typical Agent Team, but the two focus on different things. An Agent Team usually breaks one complex task into steps and coordinates the roles that work on them. Because those steps tend to be tightly coupled, the Team Lead often has to understand the task in depth, plan subtasks, and coordinate members frequently, which adds up to a heavy reasoning load. In a Super-agent, the Router layer only dispatches tasks and tracks how they relate to each other at a high level. It does not break down individual tasks. Conversely, an Agent Team can also work as a two-level architecture. For that, its prompts must keep the main session from executing tasks itself and limit it to external interaction and to dispatching separate tasks to members, who work on them independently. In our experience, the Router layer's work is often simpler than expected, and a lighter model can usually provide both speed and quality.
在内部,Router 层也不必是单个会话,其部分逻辑甚至可能完全不需要 LLM。我们选择了最直接的设计——单个长期存活的 LLM 会话——并发现它并不像看起来那样容易成为吞吐瓶颈。原因在于,在一次推理轮次中到达的环境事件(第 3 节中的 Trigger)会排队,并在下一轮次中一起处理。其结果就是批处理,而将这些事件一起处理几乎不增加额外开销:
Internally, the Router layer does not have to be a single session either, and some of its logic may not need an LLM at all. We chose the most direct design, a single long-lived LLM session, and found that it is less likely to become a throughput bottleneck than it might seem. The reason is that environmental events (the Triggers of Section 3) that arrive during one inference turn queue up and are processed together in the next turn. The result is batching, and processing the events together adds little overhead:
* 当外部事件以稳定速率到达时,Trigger 逐个到达路由会话,每个响应都能快速返回。 * 当事件突发到达并在路由会话处开始排队时,上一轮次中累积的 Trigger 会被自动合并,并一起注入下一次 LLM 调用。由于路由会话只做轻量交互与分派,每一步通常输入长、输出短。合并进同一次 LLM API 调用的 Trigger 在 Prefill 阶段并行计算,因此单次请求耗时随批大小的增长要慢得多。于是,在一定程度上,积压越多,每次决策的摊薄推理时间越低。其上限取决于上下文窗口长度,以及模型在单轮次中能准确处理多少个 Trigger。
* When external events arrive at a steady rate, Triggers reach the Router Session one at a time, and each response comes back quickly. * When events arrive in bursts and start to queue at the Router Session, the Triggers that built up during the previous turn are merged automatically and injected together into the next LLM call. Because the Router Session only does lightweight interaction and dispatch, each step usually has a long input and a short output. Triggers merged into one LLM API call are computed in parallel during Prefill, so the time per request grows much more slowly than the batch size. Up to a point, then, the larger the backlog, the lower the amortized inference time per decision. The limit depends on the context length and on how many Triggers the model can handle accurately in one turn.
第 7.2 节通过实验量化了批处理的效果。结合订阅与透传(第 3.2 节)以及回忆链(Chain of Recall,第 3.3 节),单个长期存活的 Router Session 即可保持上下文的连续性,并且已足以支撑我们当前规模的团队。
Section 7.2 quantifies the effect of batching with an experiment. Combined with subscription and pass-through (Section 3.2) and Chain of Recall (Section 3.3), a single long-lived Router Session keeps the context continuous and is already enough for a team of our current size.
如果系统增长到单个会话确实无法承载的程度,Router 层可以在内部采用多级过滤结构,或者通过水平分片拆分为多个会话。此时其内部设计归结为连续性与吞吐量之间同样的权衡。分片越细,Router 层获得的并发吞吐量越高,但各分片共享的记忆与上下文就越少。在全局记忆问题得到解决之前,这一权衡将持续存在。
If the system grows to the point where one session really cannot keep up, the Router layer can use a multi-stage filtering structure internally, or be split into several sessions by horizontal sharding. Its internal design then comes down to the same trade-off between continuity and throughput. The finer the sharding, the more concurrent throughput the Router layer gets, but the less memory and context the shards share. This trade-off will remain until the global memory problem is solved.
Worker 层由执行任务的会话组成。每个 Worker 拥有隔离的上下文和完整的执行工具集,并专用于单一任务。Worker 会话直接决定每个任务的结果及其代码质量,因此它们通常需要能力最强的模型。
The Worker layer consists of the sessions that execute tasks. Each Worker has an isolated context and a full set of execution tools, and is dedicated to a single task. Worker Sessions directly determine the result of each task and the quality of its code, so they usually need the most capable models.
Worker 从不直接与人类交互。其推理过程和工具调用不会进入外部通道。相反,每个 Worker 向 Router 层报告自身状态,由 Router 层负责所有面向用户的回复。这样,系统既能保持并发性,又能保证输出质量,而不会出现多个会话各自回复造成的混乱。
Workers never interact with humans directly. Their reasoning process and tool calls stay out of external channels. Instead, each Worker reports its status to the Router layer, which handles all replies to the user. This way, the system keeps both its concurrency and the quality of its output, without the confusion of several sessions replying separately.
当任务并发运行时,每个 Worker 处理自己的任务,同级 Worker 之间通常无需直接通信。Worker 之间的冲突往往出现在共享的工作环境中,例如同一个 Pull Request。只要相关 Worker 都订阅了该环境的 Thread,它们就会收到相同的事件通知(第 3.2 节),并有机会自行发现并解决冲突。少数需要跨任务协调的情况由 Router 层转达。
When tasks run concurrently, each Worker works on its own task, and peer Workers usually do not need to communicate directly. Conflicts between Workers tend to arise in a shared working environment, such as the same Pull Request. As long as the Workers involved all subscribe to that environment's Thread, they receive the same event notifications (Section 3.2) and have a chance to spot and resolve the conflict on their own. The Router layer relays the few cases that need coordination across tasks.
与 Router 层一样,Worker 在内部不必是单个会话。对于复杂任务,Worker 可以创建子智能体,或者本身就是一个 Agent Team,而这对上层的 Router 层是透明的。同样的结构也适用于代码协作:复现问题、审查 Pull Request、开发功能等独立任务可以同时推进,互不阻塞。它也适用于个人智能体场景,尽管个人智能体通常只提供一个聊天页面。当用户在该聊天中同时讨论多个话题时,页面保持对话的连续性;与此同时,后端可以为每个话题分派一个独立的 Worker,并行处理任务并起草回复。
Like the Router layer, a Worker does not have to be a single session internally. For a complex task, a Worker can create subagents or be an Agent Team itself, and this is transparent to the Router layer above it. The same structure fits code collaboration, where independent tasks such as reproducing issues, reviewing Pull Requests, and developing features can proceed at once without blocking each other. It also fits personal agent scenarios, even though a personal agent usually offers only a single chat page. When a user discusses several topics at once in that chat, the page keeps the conversation continuous. Meanwhile, the backend can dispatch a separate Worker for each topic to work on tasks and draft replies in parallel.
要让 Super-agent 具备*主动性*,我们首先需要改变驱动系统的因素。智能体的主要输入不再是人类在会话中逐条输入的提示词,而是来自环境的半结构化事件。在 Super-agent 中,这些环境事件(例如群聊消息、电子邮件、日历提醒、代码评审评论和 CI 结果)被称为触发器(Trigger)。由于智能体监听并响应触发器,它不再像单会话智能体那样必须在每次运行前等待人类指令。
To make a Super-agent *proactive*, we first need to change what drives the system. The agent's main input is no longer prompts that a human types into a session one at a time, but semi-structured events from the environment. In a Super-agent, these environmental events, such as group chat messages, emails, calendar reminders, code review comments, and CI results, are called Triggers. Because the agent listens for and responds to Triggers, it no longer has to wait for a human command before each run, as a single-session agent must.
以下各小节按环境事件从到达至处理的顺序展开,分为四个层层递进的步骤。首先,结合代码与模型的两阶段策略会过滤掉大量噪声(第 3.1 节)。接着,订阅与透传机制将事件路由至 Worker(第 3.2 节)。随后,Inline & Spill 与 Chain of Recall 向模型注入稠密上下文,并按需召回更多上下文(第 3.3 节)。最后,推测执行使智能体能够基于环境信号在后台提前行动(第 3.4 节)。
The subsections below follow an environmental event from arrival to processing, in four steps that build on each other. First, two-stage policies that combine code and models filter out the large volume of noise (Section 3.1). Next, the subscription and pass-through mechanism routes events to Workers (Section 3.2). Inline & Spill and Chain of Recall then inject dense context into the model and recall more of it on demand (Section 3.3). Finally, speculative execution lets the agent act ahead in the background based on environmental signals (Section 3.4).
一旦接入真实的群聊和代码平台,系统面对的是噪声大、触发率低的事件流:绝大多数日常消息都不需要智能体采取任何动作。若让大模型对每个事件都从头判断,会带来过高的延迟和算力开销。借鉴计算机系统中的快路径/慢路径(Fast Path / Slow Path)思想,我们将大模型推理视为灵活但昂贵的慢路径。而那些频繁出现、定义明确且稳定的判断,则可以固化为确定性代码,作为低延迟、低成本的快路径。
Once connected to real group chats and code platforms, the system sees a noisy event stream with a low trigger rate: the vast majority of everyday messages need no action from the agent. Having a large model judge every event from scratch would add too much latency and use too much compute. Borrowing the Fast Path / Slow Path idea from computer systems, we treat large-model reasoning as a flexible but expensive Slow Path. Frequent, well-defined, stable judgments can instead become deterministic code, which serves as a low-latency, low-cost Fast Path.
因此,系统首先对每个传入事件进行过滤。确定性策略在调用任何大模型之前先去除噪声,只有需要语义理解的候选事件才会送入模型。我们采用两阶段过滤,将程序化策略与大模型相结合:
So the system filters every incoming event first. Deterministic policies remove noise before any large model is called, and only candidate events that need semantic understanding go to the model. We use two-stage filtering that combines programmatic policies with a large model:
* **程序化策略(快路径):**代码对确定性条件执行快速的准入检查,例如事件来源、群组以及用户或机器人白名单。例如,每个来源可被设置为“仅响应显式请求”“视为候选事件”或“忽略”。这些检查在调用任何模型之前就丢弃了大多数无关消息。
* **Programmatic policies (Fast Path):** Code runs fast admission checks on deterministic conditions such as the event source, the group, and user or bot allowlists. For example, each source can be set to "respond only to explicit requests", "treat as candidate events", or "ignore". These checks drop most irrelevant messages before any model is called.
* **语义策略(慢路径):**通过程序化检查的候选事件会送入 LLM,由 LLM 根据上下文和以提示词形式编写的策略来决定是否采取行动。语义阶段同时充当自然语言扩展点,因此人类可以随时通过提示词开启或关闭策略,或添加新策略,如下所示:
* **Semantic policies (Slow Path):** Candidate events that pass the programmatic checks go to the LLM, which decides whether to act based on the context and on policies written as prompts. The semantic stage also serves as a natural-language extension point, so humans can turn policies on or off, or add new ones, through prompts at any time, as shown below:
第 2 节中的全局 Router 层使交互在各通道之间保持连续。但如果已分配任务的每个后续事件仍必须经过 Router 层,那么这个单一的全局节点将承担沉重负载并拖慢响应速度。因此,Fast / Slow Path 的划分同样适用于对已过滤事件的路由。Router 层只负责新任务的冷启动和跨任务协调,而代码则将后续事件直接发送给拥有它们的 Worker Session。
The global Router layer from Section 2 keeps interaction continuous across channels. But if every follow-up event for an assigned task still had to pass through the Router layer, this single global node would carry a heavy load and slow down responses. So the Fast / Slow Path split also applies to routing filtered events. The Router layer handles only cold starts of new tasks and cross-task coordination, while code sends follow-up events directly to the Worker Session that owns them.
在实际工作流中,同一 GitHub Pull Request、IM 话题或邮件链上的连续事件构成一个事件流,我们称之为 Thread:
In a real workflow, consecutive events on the same GitHub Pull Request, IM topic, or email chain form an event stream, which we call a Thread:
当 Router 层为 Thread 中的第一个事件创建 Worker Session 时,该 Worker 会直接订阅该 Thread。此后,事件路由遵循下图所示的两条路径之一:
When the Router layer creates a Worker Session for the first event in a Thread, that Worker subscribes to the Thread directly. From then on, event routing follows one of the two paths shown below:
* **已订阅(Fast Path):**代码将 Thread 中的后续事件直接传递给已订阅的 Worker,因此 Router 层无需再进行一次工具调用即可转发这些事件。如果新事件落在当前任务范围之外,Worker 可以取消订阅,或将事件交还给 Router 层以重新分派。
* **Subscribed (Fast Path):** Code passes follow-up events in the Thread straight through to the subscribed Worker, so the Router layer does not need another tool call to forward them. If a new event falls outside the current task, the Worker can unsubscribe or hand the event back to the Router layer to be dispatched again.
* **未订阅(慢路径):**Router 层仍能看到每一个事件,从而可以跟踪全局状态,但它只对尚无订阅者的新事件进行评估和分发。
* **Unsubscribed (Slow Path):** The Router layer can still see every event, which lets it track global state, but it only evaluates and dispatches new events that have no subscriber yet.
Thread 与 Worker 之间的订阅关系是多对多的。一个 Worker 可以订阅多个相关的 Thread,一个 Thread 也可以有多个已订阅的 Worker。当多个 Worker 在同一工作环境或讨论中发生重叠时,共享 Thread 中的每个新事件都会一次性直通给它的所有订阅者。随后,这些 Worker 便有机会了解其他 Worker 正在做什么,并在没有点对点通信的情况下自行解决冲突。在输出侧,Worker 仍会向 Router 层报告关键结论,由 Router 层负责处理对用户的所有回复,并保持全局记忆同步。
Subscriptions between Threads and Workers are many-to-many. A Worker can subscribe to several related Threads, and a Thread can have several subscribed Workers. When Workers overlap in the same working environment or discussion, each new event in the shared Thread passes straight through to all of its subscribers at once. The Workers then have a chance to learn what the others are doing and resolve conflicts themselves, without point-to-point communication. On the output side, Workers still report key conclusions to the Router layer, which handles all replies to the user and keeps global memory in sync.
在事件被过滤并路由到目标会话后,下一个问题是向模型的上下文窗口中放入多少信息。输入不再是有限数量的人类提示,而是环境持续产生的半结构化事件,因此工具调用和事件注入的设计更为重要。注入过多,窗口会被填满,稀释模型的注意力。注入过少,模型不得不反复调用工具来读取上下文,这增加了执行步骤。浪费上下文窗口就是浪费模型的智能。
After an event has been filtered and routed to its target session, the next question is how much information to put into the model's context window. The input is no longer a limited number of human prompts but semi-structured events that the environment produces continuously, so the design of tool calls and event injection matters more. Inject too much, and the window fills up, diluting the model's attention. Inject too little, and the model has to call tools again and again to read context, which adds execution steps. Wasting the context window is wasting the model's intelligence.
因此,我们可以将有限的上下文窗口视为缓存。借用编译器优化和计算机系统的术语,上下文注入归结为两个基本操作。Inline 将可能很快需要的信息直接放入当前上下文窗口,节省额外的工具调用往返。Spill 在信息超出预算或很少使用时,将完整信息保留在窗口外,只在窗口中留下引用或摘要,模型可以通过它按需读取完整信息。
We can therefore treat the limited context window as a cache. In terms borrowed from compiler optimization and computer systems, context injection comes down to two basic operations. Inline puts information likely to be needed soon directly into the current context window, saving extra tool-call round trips. Spill keeps full information outside the window when it exceeds the budget or is rarely used, and leaves only a reference or summary in the window, through which the model can read the full information on demand.
结合计算机系统设计中的经典思想——局部性,Inline & Spill 可以逐步改进事件注入和工具调用:
Combined with locality, a classic idea in computer systems design, Inline & Spill can improve event injection and tool calls step by step:
1. **从最少信息开始:**起初,只给模型当前对象的 ID 及其内容摘要。
1. **Start with minimal information:** At first, give the model only the current object's ID and a summary of its content.
2. **通过局部性逐步 Inline 相关信息:**将模型可能很快需要的信息 Inline。从紧密相关对象的 ID 开始,然后添加在空间或时间上相邻的内容。例如内容的前 50 个字符、一条消息及其回复前后的 IM 消息,以及同一代码审查讨论中的相邻评论。
2. **Progressively Inline related information via locality:** Inline what the model is likely to need soon. Start with the IDs of closely related objects, then add content that is adjacent in space or time. Examples are the first 50 characters of the content, the IM messages around a message and the one it replies to, and neighboring comments in the same code review discussion.
3. **溢出超出限制的内容:**对于无法完整内联的长内容,设置一个较小的长度上限,并将超出部分溢出到窗口之外。一种简单的做法是截断内容,并留下一个指向后续内容的指针,这样模型在需要时可以调用工具来读取剩余部分。
3. **Spill content over the limit:** Set a small length cap for long content that cannot be inlined in full, and spill the excess outside the window. A simple way to do this is to truncate the content and leave a pointer to where it continues, so the model can call a tool to read the rest when it needs to.
Router 层自身也面临上下文问题。许多后续事件直接传递给 Worker,而过去的任务在长时间运行中不断累积,因此 Router 层无法在其上下文窗口中保留每个任务的完整历史。然而,当用户在另一个渠道中提及一个旧任务时,Router 层仍然必须恢复该任务的上下文。对系统中的每种对象一致地应用内联与溢出(Inline & Spill),提供了一种按需的多跳检索机制:回忆链(Chain of Recall)。它减少了 Router 层在长时间运行中丢失的早期信息量,如下所示:
The Router layer has a context problem of its own. Many follow-up events pass straight through to Workers, and past tasks build up over long-running operation, so the Router layer cannot keep every task's full history in its context window. Yet when a user brings up an old task in another channel, the Router layer still has to recover that task's context. Applying Inline & Spill consistently to every kind of object in the system gives an on-demand, multi-hop retrieval mechanism: Chain of Recall. It reduces how much earlier information the Router layer loses over long runs, as shown below:
系统为 Trigger、Thread 和 Worker Session 等对象分配唯一 ID,并在注入某个对象时内联其紧密相关对象的 ID。这些 ID 将对象链接成一个引用图。通过工具调用回忆的每个对象也遵循内联与溢出,因此返回结果会内联下一跳对象的摘要和 ID。从当前事件开始,模型可以沿着这些引用逐跳回忆上下文,按需深入。
The system gives objects such as Triggers, Threads, and Worker Sessions unique IDs, and inlines the IDs of closely related objects when it injects one. These IDs link the objects into a reference graph. Each object recalled through a tool call also follows Inline & Spill, so the returned result inlines the summaries and IDs of the next-hop objects. Starting from the current event, the model can then follow these references and recall context hop by hop, as far as it needs.
例如,模型可以从当前消息的 Thread 开始,沿着内联的 ID 找到相关的 Worker Session,然后找到与该 Worker 链接的另一个代码审查 Thread。
For example, the model can start from the current message's Thread, follow an inlined ID to a related Worker Session, and then find another code review Thread linked to that Worker.
我们还借鉴了计算机系统中的推测执行(speculative execution)。基于环境信号,智能体在尚不确定结果是否会被使用之前,就已在后台开始工作。它利用额外的后台算力,使人们等待更少、需要介入的频率更低。最终被证明有用的结果会被交付,其余结果则被丢弃。
We also borrow speculative execution from computer systems. Based on environmental signals, the agent starts work in the background before it knows whether the result will be used. It uses extra background compute so that people wait less and need to step in less often. Results that turn out to be useful are delivered, and the rest are discarded.
在个人智能体场景中,当收到会议邀请邮件或待办消息时,智能体可以在后台检查日历冲突、收集背景信息并起草回复。用户随后只需审阅草稿并发送即可。同样的方法也适用于研发协作。例如,在我们内部的 DeepSeek Harness 用户群中,我们配置了一项“静默复现并修复”策略。当有人报告问题或讨论某项拟议的变更时,智能体首先在后台尝试复现该问题并寻找修复方案。只有在确认问题并找到简单修复方案之后,它才会交付结果;否则,它全程保持静默。
In personal agent scenarios, when a meeting invitation email or a to-do message arrives, the agent can check for calendar conflicts, gather background information, and draft a reply in the background. The user then only needs to look over the draft and send it. The same approach works for R&D collaboration. In our internal DeepSeek Harness user group, for example, we configured a "silently reproduce and fix" policy. When someone reports an issue or discusses a proposed change, the agent first tries to reproduce the issue and find a fix in the background. It delivers a result only after it has confirmed the issue and found a simple fix. Otherwise, it stays quiet the whole time.
第 2 节中的两级架构在上下文层面保持了跨通道交互的*连续性*。但要使日常交互既*连续*又*高效*,还需要解决两个问题:交互如何工作以及交互发生在何处。第一个问题是避免耗时的后台操作阻塞前台对话。异步 ReAct 循环解决了这个问题,使得会话可以随时接受新指令,而无需等待先前的命令或任务完成(第 4.1 节)。第二个问题是根据每个通信通道以及人们在该通道中的交流方式,定制智能体响应的内容和详细程度(第 4.2 节)。
The two-level architecture in Section 2 keeps interaction *continuous* across channels at the level of context. But to make day-to-day interaction both *continuous* and *productive*, two more problems need solving: how the interaction works and where it happens. The first is to keep time-consuming background operations from blocking the foreground conversation. An asynchronous ReAct loop solves this, so the session can accept new instructions at any time without waiting for a previous command or task to finish (Section 4.1). The second is to tailor the content and level of detail of the agent's responses to each communication channel and how people communicate there (Section 4.2).
在经典的 ReAct 循环中,当模型发起同步的 run() 工具调用时,循环会阻塞,直到该工具执行完毕并返回最终结果。在此之前,会话无法响应用户的任何新输入。为消除这种阻塞,对话必须从基于轮次的半双工模式转变为全双工模式,如下图所示:
In a classic ReAct loop, when the model makes a synchronous run() tool call, the loop blocks until the tool finishes and returns its final result. Until then, the session cannot respond to anything new from the user. To remove this blocking, the conversation has to move from a turn-based, half-duplex mode to a full-duplex one, as shown below:
为此,我们用异步的 *start()* 和 *stop()* 调用替代耗时的命令与工具调用,将循环转变为异步 ReAct 循环。调用 *start()* 会立即返回“Started”,循环不再等待该工具。当工具在后台完成时,系统会将其最终结果作为一条新的事件消息投递到会话中。模型还可以根据上下文调用 *stop()*,以终止运行时间过长的后台命令。
To do this, we replace time-consuming command and tool calls with asynchronous *start()* and *stop()* calls, turning the loop into an asynchronous ReAct loop. A call to *start()* returns "Started" immediately, and the loop does not wait for the tool. When the tool finishes in the background, the system delivers its final result to the session as a new event message. Based on the context, the model can also call *stop()* to end a background command that runs too long.
由于前台对话与后台任务解耦,智能体可以在耗时任务于后台运行的同时响应用户。新输入会在当前推理步骤结束后立即得到处理,而无需等待后台工具完成。
With the foreground conversation decoupled from background tasks, the agent can respond to people while time-consuming tasks run in the background. New input is handled as soon as the current inference step ends, rather than after background tools finish.
DeepSeek Harness 已实现该异步任务机制,但尚未默认启用。
DeepSeek Harness already implements this asynchronous task mechanism, but it is not yet enabled by default.
人们在群聊、邮件和 GitHub 讨论中的沟通方式各不相同。智能体需要调整细节的详略程度以及回应方式,以适应每种通道。详细的推理过程和工具调用日志可能适合单用户终端,但若原样发布到群聊中,则可能让参与者被信息淹没。
People communicate differently in group chats, email, and GitHub discussions. The agent needs to adjust both the level of detail and the way it responds to suit each channel. Detailed reasoning and tool-call logs may suit a single-user terminal, but posting them unchanged in a group chat can overwhelm participants with information.
在 Super-agent 中,两级架构已经解决了这一问题的一部分。每个任务冗长的推理过程和频繁的工具调用都留在其 Worker Session 内部,绝不会直接进入外部通道,而 Router 层负责处理所有外部交互。除此之外,系统还需要连接用户日常依赖的工作环境,并通过提示词为每个通道设定交互规范:
In a Super-agent, the two-level architecture already solves part of this problem. Each task's verbose reasoning process and frequent tool calls stay inside its Worker Session and never go straight to an external channel, while the Router layer handles all external interaction. Beyond that, the system needs to connect to the working environments users rely on every day and use prompts to set interaction norms for each channel:
* **IM 及其他即时通讯通道:**保持沟通轻量,尽可能少地打扰他人。像人类同事一样,仅在需要决策或签核时通知他人,只提出直接的问题,并给出简短的结论。我们已验证的一条简单有效的硬性规则是:每条回复不超过 100 词。
* **IM and other instant messaging channels:** Keep communication light and interrupt people as little as possible. Like a human colleague, notify people only when a decision or sign-off is needed, ask only direct questions, and give short conclusions. One simple, effective hard rule we have verified is a cap of 100 words per reply.
* **GitHub、邮件和文档等异步通道:**提供结构化、信息密集的输出。例如,在创建或更新 Pull Request 时,按照项目惯例写出完整的问题背景、变更说明和验证结果。在个人智能体场景中,直接起草结构化邮件和文档摘要。
* **Asynchronous channels such as GitHub, email, and documents:** Deliver structured, information-dense output. For example, when creating or updating a Pull Request, write out the full problem background, the change description, and the verification results according to the project's conventions. In personal agent scenarios, draft structured emails and document summaries directly.
默认情况下,本地智能体将三样东西绑定到同一台设备上:运行 Agent Loop 的算力、必须持久化的会话状态,以及执行环境(例如代码仓库和本地工具链)。一旦设备休眠或离线,智能体就会停止运行,并且无法访问其他设备上的环境。为了让 Super-agent *持久*在线,并与其任务所需的真实工作环境保持连接,我们借鉴计算机系统中的算力—存储分离思想,分两步将这三者解耦。第一步,我们将算力与会话状态分离,从而使智能体摆脱任何单台机器的生命周期,并在云端持久在线(第 5.1 节)。第二步,我们将云端托管的 Agent Loop 与状态密集的执行环境解耦,这样执行环境可以留在原处,而智能体能够跨设备访问它们(第 5.2 节)。
By default, local agents tie three things to one device: the compute that runs the Agent Loop, the session state that must persist, and the execution environment, such as code repositories and local toolchains. The agent stops whenever the device sleeps or goes offline, and it cannot reach environments on other devices. To keep a Super-agent *persistently* online and connected to the real working environments its tasks need, we borrow compute-storage separation from computer systems and decouple the three in two steps. First, we separate compute from session state, which frees the agent from the lifecycle of any single machine and keeps it persistently online in the cloud (Section 5.1). Second, we decouple the cloud-hosted Agent Loop from state-heavy execution environments, which can then stay where they are while the agent reaches them across devices (Section 5.2).
运行 Agent Loop 的算力可以是无状态的,只有会话状态需要持久化。因此,第一层解耦将这部分算力运行在无状态、弹性的云容器中,并把会话及其他持久化状态保存在数据库里。容器可以横向扩展、重启或被替换,而持久化存储则保持会话与任务的连续性。本地设备休眠或离线不再会中断智能体,智能体在云端保持持续在线。
The compute that runs the Agent Loop can be stateless, and only the session state has to persist. So the first level of decoupling runs this compute in stateless, elastic cloud containers and keeps sessions and other persistent state in a database. The containers can scale out, restart, or be replaced, while persistent storage preserves the continuity of sessions and tasks. A local device that sleeps or goes offline no longer stops the agent, which stays persistently online in the cloud.
一旦 Agent Loop 和会话状态位于云端,下一个问题便是智能体如何触达其任务所需的执行环境。模型所处理的上下文很大一部分来自针对代码仓库、本地文件、依赖服务及其他执行环境的工具调用。因此,从广义上讲,上下文也包括执行环境本身。
Once the Agent Loop and session state are in the cloud, the next question is how the agent reaches the execution environments its tasks need. Much of the context a model works with comes from tool calls against code repositories, local files, dependent services, and other execution environments. Broadly defined, then, context includes the execution environment itself.
有两种常见做法。第一种是在云端启动沙箱,拉取代码,并尝试重建和同步环境。但真实的工作环境往往包含未提交的本地改动、私有凭证、对内网服务的依赖,以及特定的硬件或工具链。同步所有这些内容代价高昂,而且很容易遗漏。第二种做法要求用户放弃本地环境并将工作迁移到云端,而对许多用户而言这种迁移成本过高。
There are two common approaches. The first starts a sandbox in the cloud, pulls the code, and tries to rebuild and sync the environment. But real working environments often include uncommitted local changes, private credentials, dependencies on intranet services, and specific hardware or toolchains. Syncing all of that is expensive, and it is easy to miss something. The second asks users to give up their local environments and move their work to the cloud, a migration that is too costly for many users.
既然难以复制和同步的正是环境本身,就没有必要把它连同 Agent Loop 一起搬到云端。第二层解耦让 Agent Loop 在云端运行,而把状态繁重的执行环境留在原处。每个端点只需一个轻量级守护进程,它不保存任何会话状态,只负责执行命令并返回结果。执行环境留在云端之外,智能体按需从中读取上下文。
Since the hard part to copy and sync is the environment itself, there is no need to move it to the cloud along with the Agent Loop. The second level of decoupling runs the Agent Loop in the cloud and leaves state-heavy execution environments where they are. Each endpoint needs only a lightweight daemon, which keeps no session state and does nothing but execute commands and return results. The execution environment stays outside the cloud, and the agent reads context from it on demand.
Anthropic 的“将大脑与双手解耦”采用了同样的思路:harness 保持无状态,会话日志存储在其外部,执行环境通过统一接口按需连接。区别在于目标场景。Anthropic 的文章描述的是一种托管服务,主要讨论按需创建的沙箱以及客户 VPC 内的资源。我们首先需要连接人们日常使用的个人机器,这些机器上存有未提交的改动和本地凭证,且可能只是间歇性在线。因此,我们的设计支持 BYOM(Bring Your Own Machine,自带机器),即将用户自己的开发机或个人计算机连接到云端智能体。它还支持云托管机器以及按需创建的计算环境。
Anthropic's "Decoupling the brain from the hands" takes the same approach: the harness stays stateless, session logs are stored outside it, and execution environments are connected on demand through a unified interface. The difference is the target scenario. Anthropic's article describes a managed service and mainly discusses sandboxes created on demand and resources inside customer VPCs. We first need to connect the personal machines people use every day, which hold uncommitted changes and local credentials and may be online only intermittently. Our design therefore supports BYOM (Bring Your Own Machine), which connects a user's own development machine or personal computer to the cloud agent. It also supports cloud-hosted machines and compute environments created on demand.
因此,智能体不再绑定于单台机器。它可以在不同执行设备之间切换,在任务所需的任意环境中执行命令并读取上下文。它甚至可以与仅间歇性在线的设备协作:当用户的个人设备重新连接时,云端智能体便会自动启动并完成需要在该设备上运行的任务。下图展示了由此形成的结构,其中算力、持久状态与执行环境在两个层面上实现了解耦:
As a result, an agent is no longer tied to one machine. It can switch between execution devices, running commands and reading context in whichever environment a task needs. It can even work with devices that are only intermittently online: when a user's personal device reconnects, the cloud agent automatically starts and completes the tasks that need to run on that device. The diagram below shows the resulting structure, with compute, persistent state, and execution environments decoupled at two levels:
要*持久*在线,仅靠第 5 节中的计算-存储分离是不够的:系统还必须在长时间运行过程中自动从异常中恢复。一个持久在线的分布式系统如果只依赖其内部逻辑,很少能长期保持可靠。它需要在主系统之外有一个独立的控制回路(Control Loop)。
Staying *persistently* online takes more than the compute-storage separation in Section 5: the system must also recover from anomalies automatically during long-running operation. A persistently online distributed system rarely stays reliable for long if it relies only on its internal logic. It needs an independent Control Loop outside the main system.
智能体系统需要的也不只是传统的进程存活探针或监控脚本。许多异常并非崩溃:进程仍在运行,但模型卡在无产出的循环中,或已偏离其目标。因此,长时间运行的智能体系统不仅要监控基础设施的存活状态,还要监控任务进展。
Agent systems also need more than traditional process liveness probes or monitoring scripts. Many anomalies are not crashes: the process is still running, but the model is stuck in an unproductive loop or has drifted from its goal. A long-running agent system therefore has to monitor task progress as well as infrastructure liveness.
我们的外部控制回路是一个独立的 Watchdog 会话(Watchdog Session),运行在主系统之外,由定时消息驱动。Watchdog 负责处理基础设施故障,例如 API 错误和状态恢复失败。它还利用模型判断每个 Worker 是否在取得实质性进展,或是否偏离总体目标。它及时修复异常,并持续复查暂时性的外部故障,直至其得到解决。
Our external Control Loop is an independent Watchdog Session that runs outside the main system and is driven by scheduled messages. The Watchdog handles infrastructure failures such as API errors and failed state recovery. It also uses the model to judge whether each Worker is making substantive progress or drifting from the overall goal. It fixes anomalies promptly and keeps rechecking transient external failures until they are resolved.
由于 Watchdog 本身就是一个拥有全套工具的智能体会话,维护人员可以用自然语言询问它某次失败的原因。他们还可以让它在系统运行期间纠正主系统的行为,例如增加或删除提示词,或调整触发规则。
Because the Watchdog is itself an agent session with a full set of tools, maintainers can ask it in natural language why something failed. They can also have it correct the main system's behavior while the system runs, for example by adding or removing prompts or adjusting trigger rules.
我们在两个层面对核心调度与路由设计进行了初步实验:整个系统层面,以及单独的 Router 层。端到端实验将两级架构与单会话设计进行比较,并衡量订阅与透传机制的效果(第 7.1 节)。第二个实验测试 Router 层中的批处理(第 7.2 节)。实验使用合成工作负载和简化环境,部分设置可以更加严谨,因此以下结果仅供参考。
We ran preliminary experiments on the core scheduling and routing designs at two levels: the whole system, and the Router layer on its own. The end-to-end experiment compares the two-level architecture with single-session designs and measures the effect of the subscription and pass-through mechanism (Section 7.1). The second experiment tests batching in the Router layer (Section 7.2). The experiments use synthetic workloads and simplified environments, and parts of the setup could be more rigorous, so the results below are indicative only.
四个端到端设计同时运行,由群聊和 GitHub CI 消息流驱动。每次运行约有 300 条消息,其中约 20 条为工作请求。其余为闲聊、追问、取消和 CI 消息。编码工作由一个仅消耗时间的工具模拟,因此该实验衡量的是系统的调度与协调能力,而非其执行单个任务的能力。每个设计各运行 5 次。
Four end-to-end designs ran at the same time, driven by a stream of group chat and GitHub CI messages. Each run had about 300 messages, of which about 20 were work requests. The rest were casual chat, follow-ups, cancellations, and CI messages. Coding work was simulated by a tool that simply consumes time, so the experiment measures the system's scheduling and coordination, not its ability to execute individual tasks. Each design was run 5 times.
这四个设计分别是 Super-agent、不带 Pass-through 的 Super-agent,以及使用不同提示词的两个版本的 Single Session with Subagent 工具。
The four designs are Super-agent, Super-agent without Pass-through, and two versions of Single Session with Subagent tool that use different prompts.
中性提示词为*“在合适的时候使用子智能体来完成一项工作……”*。
The neutral prompt reads *"Use a subagent for a piece of work when appropriate..."*.
委派优先提示词为*“聊天中的每条消息都会到达你这里,因此你自己运行的工作会不断因新消息而中断。优先把每项工作交给各自的子智能体,自己只做小事……”*。
The delegation-first prompt reads *"Every message of the chat reaches you, so work you run yourself keeps stopping for new messages. Prefer handing each piece of work to a subagent of its own, and do only small things yourself..."*.
**方案** · **任务完成时间 p50 / p95(分钟)** · **每轮缓存读取 token(全部会话)** **Super-agent** · 12.4/15.7 · 23.2M Super-agent(无 Pass-through) · 12.6/15.5 · 31.8M 单会话 + Subagent 工具,中性提示词 · 20.4/29.5 · 6.1M 单会话 + Subagent 工具,委派优先提示词 · 13.8/29.0 · 10.8M
**Design** · **Task completion time p50 / p95 (min)** · **Cache-read tokens per run (all sessions)** **Super-agent** · 12.4/15.7 · 23.2M Super-agent without Pass-through · 12.6/15.5 · 31.8M Single Session with Subagent tool, neutral prompt · 20.4/29.5 · 6.1M Single Session with Subagent tool, delegation prompt · 13.8/29.0 · 10.8M
*注:每种设计均运行 5 次。任务完成时间从发出工作请求时起算,至收到结果消息为止。*
*Note: each design was run 5 times. Task completion time is measured from a work request to its result message.*
Super-agent 的任务完成时间在 p50 处为 12.4 分钟、在 p95 处为 15.7 分钟,明显快于使用 Subagent 工具的单会话(Single Session)设计。单会话设计较慢,是因为在本实验中它高度依赖其提示词:主会话常常决定自己完成工作,导致完成时间长且不稳定。在使用中性提示词时,模型在 5 次运行中均未调用 subagent。所有工作都在主会话中运行,新消息不断打断它,p95 达到 29.5 分钟。在使用委派优先(delegation-first)提示词时,模型在 5 次运行中有 4 次进行了委派。完成时间有所下降,但总体上仍长于 Super-agent。在剩余的那次运行中,模型判断该工作“很小”并自行完成,这就在图中产生了紫色的长尾。单会话必须依赖提示词工程和模型的临场判断来决定是否委派。两级架构则在系统层面缓解了这一问题:Router 本身不执行工作,每个 Worker 只接收其订阅的 Thread 发来的消息。
Super-agent completes tasks in 12.4 minutes at p50 and 15.7 minutes at p95, markedly faster than Single Session with Subagent tool. The single-session design is slower because, in this experiment, it depends heavily on its prompt: the main session often decides to do the work itself, which makes completion times long and unstable. With the neutral prompt, the model did not call a subagent in any of the 5 runs. All work ran in the main session, new messages kept interrupting it, and p95 reached 29.5 minutes. With the delegation-first prompt, the model delegated in 4 of the 5 runs. Completion times dropped somewhat, but overall they were still longer than Super-agent's. In the remaining run, the model judged the work "small" and did it itself, which produced the purple long tail in the figure. A single session has to rely on prompt engineering and the model's on-the-spot judgment to decide whether to delegate. The two-level architecture mitigates this problem at the system level instead: the Router does not execute work itself, and each Worker receives only messages from the Threads it subscribes to.
由于 Super-agent 维护多个独立会话,它每次运行使用的缓存读取 token 多于单会话设计,以 token 换取更短、更稳定的完成时间。不带 Pass-through 的 Super-agent 完成任务的时间与 Super-agent 大致相同,但其 Router 每次运行做出的决策多约 30%,缓存读取 token 总量从 23.2M 升至 31.8M,增加约 37%。因此在该工作负载下,pass-through 并不会让任务完成得更快或更好,但它大幅削减了 Router Session 的 token 用量与推理开销。
Because Super-agent maintains several independent sessions, it uses more cache-read tokens per run than the single-session designs, trading tokens for shorter and more stable completion times. Super-agent without Pass-through finishes tasks in about the same time as Super-agent, but its Router makes about 30% more decisions per run, and total cache-read tokens rise from 23.2M to 31.8M, about 37% more. So under this workload, pass-through does not make tasks finish faster or better, but it substantially cuts the Router Session's token use and inference overhead.
为了解单个长期存活的 Router Session 在 2.1 节所述的批处理下能处理多少负载,我们单独对 Router 层进行了压力测试。Router 调用真实模型,而 Worker 使用模拟模型。我们逐步将需要决策的 Trigger 到达率从约 1 次/分钟提高到约 40 次/分钟。在每个速率下,我们测量了平均批大小、每个请求的时间以及每个决策的摊销推理时间。一个决策可能跨越多个 LLM 请求,因为 Router 在派发前可能进行多步推理或通过工具调用回忆上下文,因此每个决策的时间可能超过每个请求的时间。
To find out how much load a single long-lived Router Session can handle with the batching described in Section 2.1, we stress-tested the Router layer on its own. The Router called a real model, while the Workers used mock models. Step by step, we raised the arrival rate of Triggers that need a decision from about 1 to about 40 per minute. At each rate we measured the average batch size, the time per request, and the amortized inference time per decision. A decision can span several LLM requests, because the Router may reason over several steps or recall context through tool calls before it dispatches, so the time per decision can exceed the time per request.
如上图所示,当需要决策的 Trigger 到达率从约 1 次/分钟上升到约 40 次/分钟时,平均批大小从 1.0 增加到 2.8。每个请求的时间仅从 2.5 秒增长到 3.9 秒,增长慢于批大小,因此每个决策的摊销推理时间从 6.4 秒下降到 1.6 秒。换句话说,当外部事件突发到达时,Router 层通过自动合并已堆积的事件来提高有效吞吐量。批处理也解释了 7.1 节的结果:移除直通提高了 Router 的峰值负载,但单个 Router 仍未达到其吞吐量极限。因此,在我们当前的团队规模下,没有必要以牺牲全局上下文连续性为代价过早地对 Router 层进行分片。
As the figure above shows, when the arrival rate of Triggers that need a decision rises from about 1 to about 40 per minute, the average batch size increases from 1.0 to 2.8. The time per request grows only from 2.5 s to 3.9 s, more slowly than the batch size, so the amortized inference time per decision falls from 6.4 s to 1.6 s. In other words, when external events arrive in bursts, the Router layer raises its effective throughput by automatically merging the events that have piled up. Batching also explains the result in Section 7.1: removing pass-through raised the Router's peak load, yet a single Router still did not reach its throughput limit. So at our current team size, there is no need to shard the Router layer prematurely at the cost of global context continuity.
第 2 至第 6 节描述了构成 Super-agent 基本架构的五个模块。第 7 节的实验表明,其核心调度与路由机制在大量任务并发运行时能够正常工作。该系统之所以能够保持相对简单,很大程度上是因为在当前阶段我们同时简化了工程设计与所支持的应用场景。在这些简化之外,仍有四个领域的问题尚未解决:两级架构的 Scaling(规模扩张)(第 8.1 节)、在无会话(session)情况下与智能体协作(第 8.2 节)、上下文边界与智能体间(agent-to-agent,A2A)通信(第 8.3 节),以及安全与隐私(第 8.4 节)。
Sections 2 through 6 describe the five modules that form the basic architecture of a Super-agent. The experiments in Section 7 show that its core scheduling and routing mechanisms work when many tasks run concurrently. The system can stay relatively simple largely because, at this stage, we have simplified both the engineering design and the scenarios we support. Beyond those simplifications, problems remain open in four areas: scaling the two-level architecture (Section 8.1), working with an agent without sessions (Section 8.2), context boundaries and agent-to-agent (A2A) communication (Section 8.3), and security and privacy (Section 8.4).
到目前为止,一种简单的组合以较低的工程成本覆盖了我们大多数的日常任务:单个长期存活的 Router Session、订阅与透传,以及 Worker 之间不直接通信。一旦任务变得比单个 Router Session 所能处理的更大、耦合更紧,每一层应采用何种正确结构尚无定论。我们仍需测试更多场景,以确定 Router 层应在何时分片、分片粒度多细,以及对等 Worker 应在何时直接通信、采用何种协作拓扑。系统与模型的协同设计是另一个值得探索的方向。专门针对 Router 层工作(如事件判定、批量调度和上下文召回)训练模型,可能进一步提升 Router 层的吞吐量和决策质量。
So far, a simple combination has covered most of our daily tasks at low engineering cost: a single long-lived Router Session, subscription and pass-through, and no direct communication between Workers. Once tasks grow larger and more tightly coupled than one Router Session can handle, the right structure for each layer is not yet settled. We still need to test more scenarios to find out when the Router layer should be sharded and how finely, and when peer Workers should communicate directly and in what collaboration topology. Co-designing the system and the model is another direction worth exploring. Training the model specifically for Router-layer work, such as judging events, dispatching in batches, and recalling context, may further improve the Router layer's throughput and decision quality.
内存同样限制了系统的扩展程度。长期存活的 Router 层,连同基于引用图的 Chain of Recall,主要处理近期任务和会话历史按需检索。一旦系统运行数月或更久,长期记忆便成为主要瓶颈。
Memory also limits how far the system can scale. The long-lived Router layer, together with Chain of Recall over the reference graph, mainly handles on-demand retrieval of recent tasks and session history. Once the system has run for months or longer, long-term memory becomes the main bottleneck.
由于两级架构对用户隐藏了多会话管理,会话不再是产品设计的核心关注点。但一旦底层的执行会话不再直接对应界面中的对话,一个新问题就出现了:如何向用户呈现任务,以及何种交互和项目管理形式才显得自然。我们认为,聊天窗口之所以成为交互中心,部分原因是路径依赖。更多交互可能会转移到特定领域的界面中,正如我们的 Super-agent 实例那样,它直接在 GitHub Issues 和 Pull Requests 中工作。会话也可以因为用户已经习惯而保留在界面中,但用户看到的一个对话不必对应一个底层会话。
Because the two-level architecture hides multi-session management from users, sessions stop being the main concern of product design. But once the execution sessions underneath no longer map directly to conversations in the interface, a new question arises: how to present tasks to users, and what forms of interaction and project management feel natural. We think the chat window became the center of interaction partly through path dependence. More interaction may move into domain-specific interfaces, as with our Super-agent instance, which works directly in GitHub Issues and Pull Requests. Sessions can also remain in the interface because users are used to them, but one conversation the user sees need not correspond to one underlying session.
前面几节主要讨论了任务开始时和签收时的人机交互。但在这一过渡时期,模型能力快速提升,许多任务在过程中仍然需要人工介入。同样值得探索的是,产品设计如何让用户在不损失自主后台工作效率的前提下,逐步介入关键细节。例如,用户可以在后台执行的任意时刻介入、接管,或与智能体实时协作。
The earlier sections mostly cover human interaction at the start of a task and at sign-off. But during this transition, while models are improving quickly, many tasks still need a person partway through. It is also worth exploring how product design can let users intervene step by step on key details without losing the efficiency of autonomous background work. For example, users could step in, take over, or work with the agent in real time at any point during background execution.
总体而言,用户所需的项目管理和交互方式在很大程度上取决于其工作领域和个人风格,因此最终设计很可能高度定制化。DeepSeek Harness 具有开放架构,这使得此类定制更容易得到支持。
Overall, the project management and interaction that users need depend heavily on their work domain and personal style, so the final design is likely to be highly customized. DeepSeek Harness has an open architecture, which makes such customization easier to support.
到目前为止,我们讨论的是单个 Super-agent 实例的设计,并假设其范围内的所有信息都汇聚在一个全局上下文中。随着使用范围从个人和小团队扩展到更大的组织,如何配置 Super-agent 实际上就变成了决定哪些上下文共享、哪些上下文隔离。组织中需要共享上下文的部分共享同一个实例,而需要隔离的部分则各自拥有独立实例。
So far we have discussed the design of a single Super-agent instance and assumed that all information within its scope is gathered in one global context. As use grows from individuals and small teams to larger organizations, deciding how to provision Super-agents becomes, in effect, deciding which context is shared and which is isolated. Parts of an organization that need shared context share one instance, and parts that need isolation each get their own.
一旦组织内部或跨组织之间出现了相互隔离的实例,跨越这些边界的协作就属于 A2A 通信,例如每位成员的个人智能体与团队共享的 Super-agent 之间的通信。这里的 A2A 泛指智能体到智能体的通信,而非某个特定协议。我们仍需解决这样一个问题:那些不共享任何底层上下文、且各自代表不同权限边界的智能体,如何能够安全、可靠地进行通信与协作。
Once isolated instances exist within or across organizations, collaboration across their boundaries is A2A communication, for example between each member's personal agent and the team's shared Super-agent. Here A2A means agent-to-agent communication in general, not a specific protocol. We still need to work out how agents that share no underlying context and each represent a different permission boundary can communicate and collaborate securely and reliably.
第 3 节中的事件驱动设计让更广泛的环境能够驱动智能体,但同时也使智能体暴露于更多不可信输入之中。除非安全与隐私得到妥善处理,否则 Super-agent 只能在非常小的可信范围内工作。
The event-driven design in Section 3 lets a wider range of environments drive the agent, but it also exposes the agent to more untrusted input. Unless security and privacy are handled well, a Super-agent can only work within a very small, trusted scope.
例如,第 5 节中的设计在云端运行 Agent Loop,并在执行设备上安装轻量级守护进程。它隐含地假设云端与端点彼此信任。但云端托管的 Agent Loop 会持续接收外部事件,而端点设备则持有私有代码、敏感数据和本地凭证。将两者连接起来会带来重大的安全与隐私风险。如果服务端入侵或提示注入攻陷了 Agent Loop,那么与之相连的每个端点设备都可能被接管。
For example, the design in Section 5 runs the Agent Loop in the cloud and installs lightweight daemons on execution devices. It implicitly assumes that the cloud and the endpoints trust each other. But the cloud-hosted Agent Loop keeps taking in external events, while endpoint devices hold private code, sensitive data, and local credentials. Connecting the two creates significant security and privacy risks. If a server-side intrusion or a prompt injection compromises the Agent Loop, every endpoint device connected to it could be taken over.
即使云端从未被攻陷,凭证也可能泄露。只要端点上的凭证能够进入模型的上下文窗口,正常执行就可能将其暴露。因此,智能体需要一种无需看到凭证即可使用凭证的方式。要使该架构得到更广泛的应用,就必须在解决这些安全与隐私问题的同时,保留其从多种不同环境中召回上下文的能力。
Credentials can leak even if the cloud is never compromised. As long as credentials on an endpoint can enter the model's context, normal execution can expose them. The agent therefore needs a way to use credentials without ever seeing them. For this architecture to be used more widely, it has to solve these security and privacy problems while keeping its ability to recall context from many different environments.
本设计并非提出新理论,而是将计算机系统中的经典工程思想应用于智能体系统的构建。具体实现会随技术发展而变化,但我们相信其背后的系统设计思想在更长时间内仍将有效。我们内部的 Super-agent 实例正是基于这些思想、并构建于 DeepSeek Harness 之上,目前已在持续运行。它每天协助复现和修复问题、响应代码评审,并参与开发 DeepSeek Harness 本身。
Rather than proposing new theory, this design applies classic engineering ideas from computer systems to building agent systems. Specific implementations will change as the technology develops, but we believe the system design ideas behind them will remain useful for longer. Our internal Super-agent instance, built on these ideas and on DeepSeek Harness, is already running continuously. It helps every day with reproducing and fixing issues, responding to code reviews, and developing DeepSeek Harness itself.
正如我们在开头所指出的,大模型在单个任务上所需的人工干预越来越少,因此进一步提升生产力的瓶颈正转向人类的注意力。两级架构、事件驱动设计、异步多通道交互、算存分离以及外部 Watchdog 共同作用,使系统能够接管管理会话和同步上下文这类繁琐工作。人们由此可以进一步上移,从执行细节转向更高层的决策与签核。
As we noted at the start, large models need less and less human intervention on individual tasks, so the bottleneck to further productivity gains is shifting to human attention. Together, the two-level architecture, event-driven design, asynchronous multi-channel interaction, compute-storage separation, and an external Watchdog let the system take over the tedious work of managing sessions and syncing context. People can then move further up, from execution details to higher-level decisions and sign-off.
以这种方式构建后,智能体不再只是一个等待指令的聊天窗口。它成为一个自主协作者,持续在线于人们使用的数字环境中。对个人而言,它可以是一个跨设备协助日常任务的个人智能体。对团队而言,它成为研发工作流的一部分,承接任务并推动其前进。我们相信,随着模型与系统架构协同演进,这种更自主的工作方式可能成为人机协作的常态。
Built this way, an agent is no longer only a chat window that waits for instructions. It becomes an autonomous collaborator that stays online in the digital environments people use. For individuals, it can be a personal agent that helps with daily tasks across devices. For teams, it becomes part of the R&D workflow, taking on tasks and moving them forward. We believe that as models and system architectures evolve together, this more autonomous way of working could become the norm in human-agent collaboration.
本文中的部分设计已在 dsh-superagent-prototype 中实现。该插件仅用于验证技术路线的原型,并非 DeepSeek 的官方产品。
Parts of the design in this article are implemented in dsh-superagent-prototype. This plugin is only a prototype for validating the technical approach, not an official DeepSeek product.
作者与致谢
Author & Acknowledgements
本文基于 DeepSeek Harness 团队的共同工作。Yujia Qiao 实现了该系统并撰写了本文。Huanqi Cao、Zui Chen、Xieting Chu、Tianyi Cui、Shiyuan Feng、Yudong Han、Kexin Liu、Shichun Liu、Gesi Luo、Yifan Shi、Tongrui Xiong、Hanxiang Xu、C.C. Yu、Ziya Zhang、F. Zhou 等人参与了评审与讨论并提供了反馈。系统与本文均得益于团队的日常交流及其积累的经验。
This article is based on shared work by the DeepSeek Harness team. Yujia Qiao implemented the system and wrote the article. Huanqi Cao, Zui Chen, Xieting Chu, Tianyi Cui, Shiyuan Feng, Yudong Han, Kexin Liu, Shichun Liu, Gesi Luo, Yifan Shi, Tongrui Xiong, Hanxiang Xu, C.C. Yu, Ziya Zhang, F. Zhou, and others took part in reviews and discussions and gave feedback. Both the system and this article owe much to the team's daily exchanges and the experience it has built up.