Unreal Agent:以异步工具调用降低 AI Agent 成本
英文标题:🔶 Unreal Agent
Unreal Labs 发布 Unreal Agent,其核心是异步工具调用运行时(harness),让模型无需处理工具等待、轮询与心跳等管理工作。该公司称,在真实工作负载和 Agent 基准测试中,Unreal Agent 相较 Codex 最多节省 40% 成本、相较 Pi 最多节省 20%,同时保持接近或更高的通过率。测试显示,Unreal Agent 通常以更少的模型轮次和输入 token 完成任务,尤其适合需要并行执行开发环境配置、代码库探索和网页搜索等工作的场景。SDK 当前提供可直接集成的 Go 库、类似 `claude -p` 和 `codex exec` 的 Runner,以及兼容 Harbor 的基准测试运行器。
2.7 MB
536.0 KB
中文

如果你关注 AI Agent 在前沿性能下的成本效率,我们很愿意与你合作!欢迎联系:contact@unreallabs.ai。
在真实环境中部署 Agent 时,我们希望它们能够快速响应用户,并具备较低的运行成本。我们注意到,Agent 会花费大量时间和 token 来管理工具调用,这促使我们构建了 Unreal Agent 及其运行时 harness,以降低模型在工具管理方面的开销。
Unreal Agent harness 以完全异步的方式管理工具调用,使底层模型不再需要处理工具的等待、轮询和心跳。
这种方法带来两项主要优势。第一,用户始终可以引导 Agent,无需等待工具调用完成。第二,Agent 可以在模型调用之间调度更多有价值的工具调用工作,从而实现前沿的成本效率。当前版本在真实工作负载和 Agent 基准测试中,相比 Codex 最多可节省 40% 成本,相比 Pi 最多可节省 20%,相关结果将在下文分享。
我们认为,harness 设计本身就是一个研究领域,仍有许多很有前景的想法等待研究和实现。1
如果尝试构建一款以 Agent 为核心的产品,你很快会发现,实现它并不存在一条黄金路径。大型厂商提供了不同的 Agent SDK,每一种都有不同的权衡,而这些权衡未必一开始就显而易见。
在 Unreal Labs,我们已经构建过多款 Agent 产品,并在此过程中积累了对主流 SDK 的一些经验。
例如,面向 CLI 的 SDK,如 Claude 的 Agent SDK,带有关于本地会话、子进程和资源限制的假设,而这些假设并不能顺畅地迁移到生产环境。要可靠地处理完成、取消和后台任务,通常意味着需要围绕这些 SDK 自行构建生命周期管理机制。
支持其他提供商还会增加兼容性工作:切换 API 模式可能导致工具或上下文压缩(compaction)失效,而 SDK 升级可能改变消息格式,迫使集成方案重写。沉重的依赖树会为我们本就需要理解并自行修补的运行时增加维护成本和供应链风险。
根据我们的经验,依赖 harness 钩子和专用工具的安全与审批机制,通常比 harness 外部的确定性环境或沙箱约束需要更多维护,且稳健性较差。后者包括:允许或禁止的主机、细粒度访问 token,以及带审批闸门的代理。
除这些技术动机外,我们还希望构建一个 harness:它能够始终无延迟地接收用户引导消息,并且无需为模型增加额外认知负担,就能同时调度异构工具调用。例如,我们希望 Agent 能够启动可能耗时数分钟的开发环境配置,同时并行探索代码库和搜索网页,而且不会产生额外的 token 税。
每当 Unreal Agent 发起一次工具调用,我们会立即追加一条事件日志记录,表明该工具已在“进行中”状态下返回,同时让其在后台继续执行。一旦工具真正完成,我们便将结果追加到会话日志中,并调用 LLM。在不破坏缓存的前提下实现这一机制,本身就是一项颇有意思的工程挑战。2
从表面上看,Unreal Agent 能以更少的模型轮次和更少的输入 token 达成相同结果。
我们将成本节省归因于两个因素:
-
最小化的 harness 占用,以及对工具输出使用方式的审慎工程设计。Unreal Agent 使用简单的提示词、经过 token 优化的工具结果,并且不使用子 Agent 或工作流。3
-
每个模型轮次完成更多工具工作。Unreal Agent 采用直接、且能向 LLM 清晰说明的异步工具调用模型。这使它能够在每个模型轮次中发起更多高负载工具调用,而不会将 token 浪费在轮询或等待上。
我们构建 Unreal Agent 是为了交付真实的生产工作流,但它在基准测试中的表现也不错。我们使用 GPT-6 Astra xhigh 对其进行了测试,并与 Codex 和 Pi 进行了比较。以下是部分结果。
通过率存在边际差异,我们认为这源于基准测试方差。
GPT-6 Astra · xhigh。Codex(lb)为排行榜基线;Unreal Agent 和 Pi 的运行记录链接见下方。
| Agent | 通过率 | 总成本($) | 每次试验输入 | 每次试验输出 | 轮次 | 工具数 | Harbor |
|---|---|---|---|---|---|---|---|
| unreal-agent | 57.9% | 1428 | 1.73M | 32k | 28 | 37 | 27133053 |
| Codex(排行榜) | 57.9% | 2350 | — | — | — | — | — |
| Pi | 55.0% | 1827 | 2.83M | 35k | 44 | 57 | 6ccd097a |
| Agent | 通过率 | 总成本($) | 每次试验输入 | 每次试验输出 | 轮次 | 工具数 | Harbor |
| --- | --- | --- | --- | --- | --- | --- | --- |
| unreal-agent | 65.8% | 936 | 898k | 15k | 16 | 27 | 3d2fa057 |
| Codex | 63.3% | 1303 | 1.69M | 17k | 22 | 21 | 11a440fb |
| Pi | 64.0% | 1033 | 1.29M | 16k | 24 | 60 | da4ac972 |
| Agent | 通过率 | 总成本($) | 每次试验输入 | 每次试验输出 | 轮次 | 工具数 | Harbor |
| --- | --- | --- | --- | --- | --- | --- | --- |
| unreal-agent | 72.4% | 1367 | 1.60M | 28k | 26 | 38 | 2311ca63 |
| Codex | 69.0% | 1633 | 2.19M | 30k | 30 | 29 | e20ecafd |
| Pi | 69.6% | 1584 | 2.21M | 30k | 40 | 75 | cd7d8de6 |
完整通过率和平均得分如下所示。这些运行记录不在 Harbor 上。
| Agent | 完整通过率 | 平均得分 | 总成本($) | 每任务输入 | 每任务输出 | 轮次 | 工具数 |
|---|---|---|---|---|---|---|---|
| unreal-agent | 30.0% | 59.7 | 217 | 0.76M | 18k | 18 | 23 |
| Codex | 29.0% | 58.1 | 292 | 1.59M | 15k | — | 21 |
| Pi | 29.0% | 59.2 | 262 | 1.19M | 19k | 27 | 37 |
我们主要运行编程基准测试,因为它们可在 Harbor 上获得,从而更便于复现和验证;但该 harness 与领域无关。
Unreal Agent SDK 当前提供:
- 可直接集成到代码库中的 Go 库
- 类似
claude -p/codex exec的 Runner 可执行文件 - 兼容 Harbor 的基准测试运行器
如果你想亲自试用,欢迎查看我们的 github repo。
English / 原文

If youâre interested in frontier cost-efficiency for your AI agents, weâd love to work together! Get in touch: contact@unreallabs.ai.
While deploying agents in the wild, we wanted them to respond to users quickly and be cost-effective to run. Weâve noticed that agents spend a lot of time and tokens managing tool calls, which motivated us to build Unreal Agent with a harness that would reduce the modelâs tool-management overhead.
The Unreal Agent harness manages tool calls in a completely asynchronous way, relieving the underlying model of the need to manage waits, polls, and heartbeats for tools.
This approach drives two major benefits. First, it always allows users to steer the agent without the need to wait for tool calls to finish. Second, it allows the agent to schedule more useful tool call work between model calls, driving frontier cost efficiency. The current version achieves up to 40% cost savings compared to Codex and up to 20% compared to Pi in real workloads and on agentic benchmarks, which we share here.
We believe harness design is a research area in its own right, with many promising ideas still to be researched and implemented.1
If you try to build an agent-first product, youâll quickly realize that thereâs no golden path for implementing one. Big-brand vendors offer different SDKs to build agents, each with a different set of trade-offs that might not be immediately apparent.
At Unreal Labs, we have built a number of agentic products and learned a few things about popular SDKs along the way.
For example, CLI-oriented SDKs such as Claudeâs Agent SDK carry assumptions about local sessions, subprocesses, and resource limits that donât translate neatly into production use. Handling completion, cancellation, and background tasks reliably often means building your own lifecycle management around them.
Supporting other providers adds compatibility work: switching API modes can break tools or compaction, while SDK upgrades can change message formats and force integration rewrites. Heavy dependency trees add maintenance and supply-chain risk to a runtime we already need to understand and patch ourselves.
Security and approvals that rely on harness hooks and specialized tools, in our experience, tend to require more maintenance and be less robust than deterministic environment or sandbox constraints, outside the harness: allowed/disallowed hosts, granular access tokens, proxies with approval gates.
Along with these technical motivations, we also wanted to build a harness that could always accept user steering messages without delay and juggle heterogeneous tool calls without extra cognitive load for the model. For example, we wanted the agent to be able to kick off a dev environment setup that might take minutes, while exploring the codebase and searching the web in parallel, all without extra token tax.
Every time Unreal Agent issues a tool call, we immediately append an event-log record that the tool has returned in the âin-progressâ state, while continuing its execution in the background. Once a tool actually finishes, we append the result into the session log and call an LLM. Making this work without breaking cache was an interesting engineering challenge in itself.2
On the surface, Unreal Agent achieves the same outcomes with fewer model turns and fewer input tokens.
We attribute cost savings to two factors:
-
Minimal harness footprint and careful engineering of tool output usage. Unreal Agent has simple prompts, token-optimized tool results, and no sub-agents or workflows.3
-
More tool work per model turn. Unreal Agent has a straightforward asynchronous tool-calling model that is clearly explained to an LLM. This allows it to issue more heavy tool calls per model turn without wasting tokens on polling or waiting for them.
Weâve built Unreal Agent to deliver real production workflows for us, but it looks good in the benchmarks too. We tested it with GPT-6 Astra xhigh and compared it with Codex and Pi. Here are some of the results.
There are marginal differences in pass rate, which we attribute to benchmark variance.
GPT-6 Astra · xhigh. Codex (lb) is the leaderboard baseline; Unreal Agent and Pi runs are linked below.
| Agent | Rate | Total $ | In/trial | Out/trial | Turns | Tools | Harbor |
|---|---|---|---|---|---|---|---|
| unreal-agent | 57.9% | 1428 | 1.73M | 32k | 28 | 37 | 27133053 |
| Codex (leaderboard) | 57.9% | 2350 | â | â | â | â | â |
| Pi | 55.0% | 1827 | 2.83M | 35k | 44 | 57 | 6ccd097a |
| Agent | Rate | Total $ | In/trial | Out/trial | Turns | Tools | Harbor |
| --- | --- | --- | --- | --- | --- | --- | --- |
| unreal-agent | 65.8% | 936 | 898k | 15k | 16 | 27 | 3d2fa057 |
| Codex | 63.3% | 1303 | 1.69M | 17k | 22 | 21 | 11a440fb |
| Pi | 64.0% | 1033 | 1.29M | 16k | 24 | 60 | da4ac972 |
| Agent | Rate | Total $ | In/trial | Out/trial | Turns | Tools | Harbor |
| --- | --- | --- | --- | --- | --- | --- | --- |
| unreal-agent | 72.4% | 1367 | 1.60M | 28k | 26 | 38 | 2311ca63 |
| Codex | 69.0% | 1633 | 2.19M | 30k | 30 | 29 | e20ecafd |
| Pi | 69.6% | 1584 | 2.21M | 30k | 40 | 75 | cd7d8de6 |
Full pass rates and mean scores are listed below. These runs are not on Harbor.
| Agent | Full pass | Mean score | Total $ | In/task | Out/task | Turns | Tools |
|---|---|---|---|---|---|---|---|
| unreal-agent | 30.0% | 59.7 | 217 | 0.76M | 18k | 18 | 23 |
| Codex | 29.0% | 58.1 | 292 | 1.59M | 15k | â | 21 |
| Pi | 29.0% | 59.2 | 262 | 1.19M | 19k | 27 | 37 |
We run mostly coding benchmarks because they are available on Harbor, which makes reproduction and verification easier, but the harness is domain-agnostic.
The Unreal Agent SDK currently offers:
- Go library that you can integrate directly into your codebase
- Runner executable similar to
claude -p/codex exec - Benchmark runner compatible with Harbor
Check out our github repo if you want to try it for yourself