Prime Intellect 用 Rust 重写 Prime Agent,2000 多个智能体自主完成端到端迁移

来源:Prime Intellect(网页) 2026年10月8日 00:00 AIHOT 评分:74 精选
摘要:Prime Intellect 发布用 Rust 从零重写的 Prime Agent,上线以来下载超 30 万次、处理超 8 万亿 token。
推荐理由:原文给出完整的自动化重写流程和与 Claude Code 等工具的对比数据,读者可以评估多智能体重写代码的实际方法和收益。
# Prime Intellect 用 Rust 重写 Prime Agent,2000 多个智能体自主完成端到端迁移 > 原标题:Rewriting Prime Agent in Rust - 来源:Prime Intellect - 发布时间:2026-10-08T16:00:00.000Z - AIHOT:https://aihot.news/items/ylhh1z4mnttxgqthrynrkym84 - 原文:https://www.primeintellect.ai/blog/prime-agent-rust ## 摘要 Prime Intellect 发布用 Rust 从零重写的 Prime Agent,上线以来下载超 30 万次、处理超 8 万亿 token。 ## 推荐理由 原文给出完整的自动化重写流程和与 Claude Code 等工具的对比数据,读者可以评估多智能体重写代码的实际方法和收益。 ## 正文 · 中文译文 ## 用 Rust 重写 Prime Agent 自 8 月推出 Prime Agent [\[1\]](https://www.primeintellect.ai/blog/prime-agent-rust#reference-1) 以来,它已被下载超过 30 万次,处理了超过 8 万亿个 token。今天,我们很高兴推出更快、更简洁、更可靠的 Prime Agent,它用 Rust 从头重写。 在两周内,Prime Agent 编排了一个由 2,000 多个 agent 组成的集群,端到端地重写自身,在 10,000 多个 Prime Sandbox 中运行,使用了来自 Prime Inference 的 GLM-5.3 端点的超过 2000 亿个 token。这次 Rust 重写对 Prime Agent 的多 agent 能力进行了压力测试,包括我们一直在构建的、用于支持大规模 agent 集群、自主研究和强化学习的沙箱与推理基础设施。 为确保与 TypeScript 版本的功能对等,Prime Agent 编排子 agent 对依赖进行拓扑排序,并用有限状态机来组织循环计算和正确性检查。同时,我们重写了代码架构,以便于维护和开发。随后,我们使用运行时基准测试和真实的 Prime Agent 轨迹来爬山优化性能指标并排查 bug。现在,Prime Agent 比大多数编码 agent 框架运行得更快、使用的资源更少。 子 agent 深度 父级深度 1深度 2深度 3 Rust 实现 192.99B token 1,981 个 agent 性能爬山优化 35.70B token 228 个 agent ## 为什么选择 Rust TypeScript 帮助我们快速推出了 Prime Agent,但它的类型是可选的,并在运行时消失,错误以未检查的异常形式传播,渲染和解析大型会话等 CPU 密集型工作与键盘输入在单个事件循环上竞争,而且每个进程都要为 JavaScript 运行时和垃圾回收器付出代价。我们希望保持同样快的交付速度,同时随着代码增长对其提出更高标准,而 Rust 非常适合这一点: - **性能:**Prime Agent 是一个长期运行的守护进程,每个会话有一个工作进程,而无垃圾回收器的原生代码带来了我们所取得的大部分内存和启动速度提升。 - **并发:**一个守护进程同时流式传输模型输出、运行工具调用、在 agent 之间中继消息,并服务所有已连接的客户端。Rust 的 `Send` 和 `Sync` trait 让编译器检查哪些数据可以在线程之间移动、哪些可以共享。 - **编译期保证:**穷尽式枚举、所有权和生命周期在代码运行前就排除了一整类 bug,而 Clippy 的 pedantic lint 又增加了数百项检查,这在 agent 编写大部分代码时尤为重要。 除了这些明显的性能提升之外,这次重写还让我们有机会重新思考设计选择。我们对代码库进行了大幅模块化,并正在收获这次重写的回报,包括 Windows 支持、会话崩溃隔离,以及更一致的守护进程协议。 ## Prime Agent 如何重写自身 我们的目标是让 agent 尽可能少地人工干预、自主完成重写。因此,所需的人工工作是设置适当的验证,以实现大规模自主部署。我们遵循了此前自动 Rust 翻译工作 [\[2\]](https://www.primeintellect.ai/blog/prime-agent-rust#reference-2) 的类似设置。每份规范都覆盖了不同类型的功能对等: - **TUI 一致性:**一套差分测试套件将 TypeScript 和 Rust 二进制文件并排对比,针对同一脚本化模型运行,并对比各自渲染出的终端帧。它覆盖了用户流程,包括启动、斜杠菜单、工具调用、压缩、智能体视图、会话恢复、子智能体和崩溃恢复。 - **测试框架一致性:**同一次运行会对比会话记录以及每个二进制文件向模型提供商发送的请求,因此两者从相同输入产生相同的会话。 - **协议一致性:**守护进程协议中的所有消息类型都会与 TypeScript 实现进行核对,确保我们的 ACP 和守护进程协议 API 保持一致。 - **功能一致性:**由于脚本化流程无法覆盖整个界面,智能体逐组件审计了 TypeScript 产品,将每个组件归类为匹配、部分匹配或缺失。 有了对每种一致性的客观检查,智能体就能衡量自身进展,并在变更合并前发现回归,这让我们得以减少人工审查。剩余的缺陷和行为差异主要通过内部使用发现,这指导了我们后续在缺失功能、可靠性和界面打磨方面的工作。 我们在两个 8 核按需 CPU 节点上运行了所有编排器及其智能体,每个节点支持 100 多个并发子智能体及其各自的 CPython 内核。此外,由于在数十个智能体同时运行时,编译、类型检查和差分会使任何单台机器饱和,我们为智能体构建了将繁重工作外包给 Prime Sandboxes 的工具,使我们能够高度并行化移植工作。 ![TypeScript and Rust slash-command menus side by side, with differing terminal cells highlighted in amber in the Diff panel.](https://www.primeintellect.ai/blog/porting-prime-agent-to-rust/parity-frame-diff.png) 一个客观的 TUI 一致性验证器会对比 TypeScript 和 Rust 版本的终端帧并突出显示差异。 ### 有限状态机的编排 一个根智能体编排了这次重写,并将工作划分为拓扑排序的任务。根智能体不编写任何产品代码,从而可以自由地监控每项任务、合并已完成的工作、维护对重写的整体把握,同时与我们共同确定优先级和决策。我们还将生成和验证放在不同的智能体中,因为编写代码的智能体在评估代码时会带有偏见。因此,编排器分配的每项任务都要经过四个智能体: - **规划者:**创建整体机器规范,包括功能设计、基准 TypeScript 行为和验证器(一致性检查) - **实现者:**在专用的工作树中编写 Rust 代码,以便功能可以并行开发。 - **审查者:**以对抗性方式检查拉取请求,使用与实现者不同的模型和独立的上下文,寻找该变更错误的理由。 - **验证者:**在全新的 Prime Sandbox 中编译并运行该功能的一致性检查和测试。 审查或验证失败会将功能连同发现的问题退回给实现者,两者都通过后 PR 才会合并。我们正在将这种模式构建到 Prime Agent 中,以编排一个有限状态机工厂,这样像这样的工作流就可以一次定义、重复使用并更新。 ![Prime Agent orchestration workflow](https://www.primeintellect.ai/blog/porting-prime-agent-to-rust/01-orchestration.svg) ### 架构重新设计 移植到 Rust 也给了我们重构代码库的机会。长期收益的很大一部分正源于此: - **模块化:**代码被拆分为九个 crate,依赖关系图是单向的,由 Cargo 强制保证,而 TUI 唯一的内部依赖是共享类型 crate。最大的源文件现在约 2,500 行,相比 TypeScript 的约 15,000 行大幅减少,且没有文件超过 5,000 行,而 TypeScript 中有四个。 - **隔离性:**每个会话都在一个小型 supervisor 下的独立 worker 进程中运行,因此一个会话的故障不会影响其他会话继续运行,并且会话会持久化到磁盘,客户端可以在重启后重新连接。 - **平台抽象:**传输、进程控制和文件锁定都位于平台特定接口之后,因此像 Windows 支持这样的工作只需实现这些 trait,而无需重新调整守护进程。 - **单一协议定义:**客户端、守护进程和每个 worker 都针对共享类型 crate 中的相同消息类型进行编译,因此协议的任何更改都会在使用它的所有地方得到检查。 - **目录驱动的模型:**将我们的模型和 MCP 列表移植到运行时获取的独立目录中,使我们无需发布 Prime Agent 即可推出新模型和插件。 ### 精炼工作 虽然自主工作流比我们预期的走得更远,但一致性检查只验证了它们所执行的行为。一旦主 RLM 循环达到一致,我们便将所有重写代理迁移到 Rust,使我们能够大规模地试用 Rust 版本(现在 Prime Agent Rust 正在递归地改进自身!)。后来,我们将内部团队迁移到 Rust 构建版本用于日常工作,这暴露了差分测试覆盖范围之外的错误和缺失行为。在整个试用周期中,我们让代理审查所有 beta 用户的日志和跟踪,使我们能够自动诊断和解决用户发现的运行时和代理问题。我们还利用这次重写的机会重新设计了一些 UX/TUI 流程和面向模型的 API。 将重写提升到发布质量需要随后几周的后续工作,从完成功能移植和修复错误到改进性能和打磨界面。Prime Agent 仍然编写并测试这些更改,而我们则有人工参与其中,负责发现问题、指导更改并审查所有结果。 ### 爬山优化性能 在实现功能一致后,我们希望优化 Prime Agent 在所有用户流程中的运行时性能。我们采用了与重写相同的方法:为代理提供一种客观的方式来衡量自身的进展。我们构建了一个基准测试工具,用于衡量 Prime Agent 在各种运行时指标上的性能,并让 Prime Agent 通过深思熟虑的改进来爬山优化其速度和资源使用。 已合并开放已关闭 9月26日 27 28 29 30 10月1日 2 3 4 [#2856 限制会话目录缓存](https://github.com/PrimeIntellect-ai/prime-agent/pull/2856) 性能基准测试在全新的 4 核、8 GB Prime Sandbox 上评估 Rust 和 TypeScript 版本的 Prime Agent,以及其他代理框架,每个基准测试都进行噪声检查,任何过于不稳定而无法比较的结果都会被保留。代理在真实终端中运行,通过屏幕模拟器驱动,针对脚本化模型,因此计时反映用户所见并排除推理时间。 有了测试工具后,第二个编排器运行了一个为期三天的爬山循环,目标只有一个:在不破坏一致性的情况下改进基准测试结果。每个实验都遵循相同的流程: 1. Agent 会对基准测试进行剖析,找出时间和内存消耗在哪里,将最大的开销转化为一系列假设,然后由编排器分配给 worker。 2. Worker 在同一个沙箱中构建当前代码和候选变更,并以交替顺序运行它们,同时运行相邻基准测试以捕捉其他地方的回归。 3. 两个 reviewer agent 分别运行在不同的前沿模型上,检查行为是否仍与 TypeScript 一致、在变更声称保持字节一致的地方输出是否仍字节一致,以及面向模型的接口上没有任何回归。 4. 变更合并,下一次实验从新的基线开始测量。 我们有意不给这个循环设定数值目标,因为固定阈值往往会变成停止点。Agent 的唯一目标是在仍有可测量收益的情况下,持续改进基准测试而不破坏一致性。在整个 hillclimb 周期中,该循环记录了超过 144 条实验和审计记录,合并了超过 69 个提升性能的有效变更。以下是我们看到的一些重要领域中的显著改进: TS 版本Hillclimb 前的 RustHillclimb 后的 Rust ### 冷启动 输入就绪延迟 快 14.18× ### 热启动 输入就绪延迟 快 13.34× ### 大会话内存 进程树 RSS · 10 MiB 会话 小 4.76× ### 安装大小 完整安装 小 2.89× ### Agent 视图 视图切换延迟 快 6.09× 大部分收益来自三类变更:将工作移出启动和渲染路径、用事件驱动等待替代轮询循环,以及在大会话加载完成后立即释放内存。 ## 结果 总体而言,我们的 Rust 重写以及随后的性能 hillclimbing 使 Prime Agent 显著更快、资源效率更高。输入时间比 TypeScript 快约 14 倍,启动后内存使用减少超过 80%,Prime Agent 是现有最快的编码 agent harness 之一。 | | Prime Agent(Rust) | Prime Agent(TypeScript) | Claude Code v2.1.289 | Codex CLI v0.160.0 | Pi v1.0.3 | Hermes Agent v0.21.5 | | --- | --- | --- | --- | --- | --- | --- | | 首次绘制从启动到首次可见输出 | 23.6 ms±0.6快 30.63× | 722.8 ms±15.1 | 264.6 ms±5.8 | 296.8 ms±2.7 | 306.3 ms±6.7 | 1,715.3 ms±10.3 | | 输入时间(冷)全新启动到可输入 | 55.8 ms±4.9快 13.22× | 737.8 ms±13.9 | 348.4 ms±8.2 | 324.6 ms±4.9 | 317.7 ms±8.0 | 2,094.5 ms±23.5 | | 输入时间(热)重复启动到可输入 | 42.4 ms±4.3快 12.96× | 549.6 ms±10.0 | 345.1 ms±6.2 | 321.3 ms±9.2 | 240.4 ms±5.9 | 2,097.1 ms±40.8 | | 安装大小安装占用的磁盘空间 | 59.6 MB±0.0小 2.89× | 172.1 MB±0.0 | 492.4 MB±0.0 | 446.8 MB±0.0 | 456.0 MB±0.0 | 960.1 MB±0.0 | | 内存(RSS)启动后的整个进程树 | 106.0 MB±1.3小 5.73× | 607.4 MB±0.9 | 226.9 MB±0.4 | 344.4 MB±3.1 | 138.1 MB±0.7 | 194.6 MB±0.3 | 外部测试框架的结果是用我们自定义的运行时套件测得的。由于没有通用的基准标准,比较时应谨慎解读。 这种更模块化的代码库和更强的编译期检查也将帮助我们更快地交付新能力,并在错误到达用户之前捕获更多问题。 ## 下一步 随着 Rust 移植的完成,我们将同样的细致关注带到 Prime Agent 的每一个部分,从日常的系统交互到跨多个智能体的复杂工作。既然基础设施的改进已经完成,我们正在加速推进能力和评估,并让这次重写背后的多智能体工作流为你所用。 Prime Agent 也将更紧密地融入 Prime Intellect 生态系统,让你能够跨整个技术栈工作,包括云端智能体集群、推理、追踪、沙箱、评估、托管训练等。 通过这次重写,我们还发布了原生支持 Windows(测试版)并可通过 homebrew 安装的 Prime Agent。Prime Agent 仍然是[开源](https://github.com/PrimeIntellect-ai/prime-agent)的,只需一条命令即可安装: ``` curl -fsSL https://app.primeintellect.ai/prime-agent/install.sh | sh ``` 或在 Windows 上: ``` irm https://app.primeintellect.ai/prime-agent/install.ps1 | iex ``` 如果你想参与 Prime Agent 的开发,[我们正在招聘](https://www.primeintellect.ai/careers/8597d151-46db-4c67-a809-5d40daae7185)。 ### 参考文献 \[1\] Karten, S., Zhang, A. L., Thomas, K., Müller, S., Bakouch, E., Auras, D., Senghaas, M., Obeid, F., Dunas, K., Hagemann, J., & Jaghouar, S. (2026). Prime agent: A self-improving RLM harness \[Preprint\]. arXiv. [https://arxiv.org/abs/2608.23552](https://arxiv.org/abs/2608.23552) \[2\] Karten, S., Appapogu, R. D., & Jin, C. (2026). Automatic generation of high-performance RL environments. In Proceedings of the Third Conference on Language Modeling (COLM 2026). [https://openreview.net/forum?id=UmpTwqxiY0](https://openreview.net/forum?id=UmpTwqxiY0) ## 正文 · 原文 ## Rewriting Prime Agent in Rust Since we launched Prime Agent [\[1\]](https://www.primeintellect.ai/blog/prime-agent-rust#reference-1) in August, it has been downloaded more than 300,000 times and has processed over 8 trillion tokens. Today, we're excited to ship a faster, cleaner and more reliable Prime Agent, rewritten from the ground up in Rust. Over two weeks, Prime Agent orchestrated a swarm of over 2,000 agents to rewrite itself end to end, operating across 10,000+ Prime Sandboxes with over 200 billion tokens from Prime Inference’s GLM-5.3 endpoint. The Rust rewrite stress-tested Prime Agent’s multi-agent capabilities, including the sandbox and inference infrastructure we’ve been building to power large-scale agent swarms, autonomous research, and reinforcement learning. To ensure feature parity with the TypeScript version, Prime Agent orchestrated subagents to topologically sort dependencies, with finite state machines structuring looped computations and correctness checks. In parallel, we rewrote the code architecture for easier maintenance and development. We then used runtime benchmarks and real Prime Agent traces to hillclimb performance metrics and triage bugs. Now, Prime Agent runs faster and uses fewer resources than most coding agent harnesses. Subagent depth ParentDepth 1Depth 2Depth 3 Rust Implementation 192.99B tokens 1,981 agents Performance Hillclimb 35.70B tokens 228 agents ## Why Rust TypeScript helped us ship Prime Agent quickly, but its types are optional and disappear at runtime, errors travel as unchecked exceptions, CPU-heavy work like rendering and parsing large sessions competes with keyboard input on a single event loop, and every process pays for a JavaScript runtime and garbage collector. We want to keep shipping as fast as we do, while holding the code to a higher standard as it grows, and Rust suits that well: - **Performance:** Prime Agent is a long-running daemon with a worker process per session, and native code without a garbage collector accounts for most of the memory and startup gains we’ve made. - **Concurrency:** one daemon streams model output, runs tool calls, relays messages between agents and serves every attached client at once. Rust's `Send` and `Sync` traits let the compiler check which data can move between threads and which can be shared. - **Compile-time guarantees:** exhaustive enums, ownership and lifetimes rule out whole classes of bugs before the code runs, and Clippy's pedantic lints add hundreds more checks, which matters when agents write most of the code. In addition to these clear performance gains, the rewrite gives us the opportunity to rethink our design choices. We have significantly modularized our codebase, and are reaping the rewards of this rewrite, including Windows support, session crash isolation, and a more consistent daemon protocol. ## How Prime Agent rewrote itself Our goal was for agents to perform the rewrite autonomously with as little human intervention as possible. Thus, the human work required was to setup proper verification to enable autonomous deployment at scale. We followed similar setup to previous work on automatic Rust translation [\[2\]](https://www.primeintellect.ai/blog/prime-agent-rust#reference-2). Each specification covered a different kind of parity: - **TUI parity:** a differential test suite compares the TypeScript and Rust binaries side by side against the same scripted model and diffs the terminal frames each one renders. It covers user flows, including launch, slash menus, tool calls, compaction, agents view, session resume, subagents and crash recovery. - **Harness parity:** the same run diffd session transcripts and the requests each binary sends to the model provider, so both produce the same sessions from the same inputs. - **Protocol parity:** all message types in the daemon protocol are checked against the TypeScript implementation, ensuring our ACP and daemon protocol APIs are consistent. - **Feature parity:** since scripted flows cannot cover an entire interface, agents audited the TypeScript product component by component, classifying each as matching, partial or missing. With an objective check for every kind of parity, the agents could measure their own progress and catch regressions before changes merged, which let us cut back on human review. Remaining bugs and behavior differences were largely found through internal use, which guided our follow-up work on missing features, reliability and interface polish. We ran all orchestrators and their agents on two 8-core on-demand CPU nodes, each supporting over 100 concurrent subagents and their respective CPython kernels. Additionally, since compilation, type-checking and diffing would saturate any single machine when dozens of agents are running at once, we built out utilities for our agents to outsource heavy work to Prime Sandboxes, allowing us to heavily parallelize our port. ![TypeScript and Rust slash-command menus side by side, with differing terminal cells highlighted in amber in the Diff panel.](https://www.primeintellect.ai/blog/porting-prime-agent-to-rust/parity-frame-diff.png) An objective TUI parity verifier compares terminal frames from the TypeScript and Rust versions and highlights differences. ### Orchestration of Finite State Machines A single root agent orchestrated the rewrite and divided the work into a topological ordering of tasks. The root agent wrote no product code, keeping it free to monitor every task, merge finished work, and maintain an overview of the rewrite while working with us on priorities and decisions. We also kept generation and verification in separate agents, since an agent that writes code is biased when evaluating it. Therefore, each task assigned by the orchestrator moved through four agents: - **Planner:** creates overall machine specification, including the feature design, ground-truth TypeScript behavior, and verifier (parity check) - **Implementer:** writes the Rust code in a dedicated worktree so features can develop in parallel. - **Reviewer:** inspects the pull request adversarially, using a different model and in a separate context from the implementer, looking for reasons the change is wrong. - **Verifier:** compiles and runs the feature's parity checks and tests in a fresh Prime Sandbox. A failed review or verification sends the feature back to the implementer with the findings, and the PR merges once both pass. We are building this pattern into Prime Agent to orchestrate a factory of finite state machines, so workflows like this one can be defined once, reused, and updated. ![Prime Agent orchestration workflow](https://www.primeintellect.ai/blog/porting-prime-agent-to-rust/01-orchestration.svg) ### Architecture re-design Porting to Rust also gave us a chance to restructure the codebase. This is where much of the long-term benefit comes from: - **Modularity:** the code is split into nine crates with a one-way dependency graph that Cargo enforces, and the TUI’s only internal dependency is the shared types crate. The largest source file is now ~2,500 lines, down from ~15,000 in TypeScript, with no files over 5,000 lines compared with four in TypeScript. - **Isolation:** each session runs in its own worker process under a small supervisor, so a failure in one session leaves the others running, and sessions persist on disk so clients can reattach after a restart. - **Platform abstraction:** transport, process control and file locking sit behind platform-specific interfaces, so something like Windows support came down to implementing those traits rather than rewiring the daemon. - **One protocol definition:** the client, the daemon and every worker compile against the same message types in the shared types crate, so a change to the protocol is checked everywhere it is used. - **Catalog-driven models:** ported our model and MCP lists to a separate catalog fetched at runtime, allowing us to ship new models and plugins without a Prime Agent release. ### Refining the work While the autonomous workflow went further than we expected, the parity checks only verified the behavior they exercised. Once parity on the main RLM loop was achieved, we moved all our rewrite agents onto Rust, allowing us to dogfood the Rust version at scale (and now Prime Agent Rust was recursively improving itself!). Later, we moved our internal team onto the Rust build for daily use, which exposed bugs and missing behavior outside the coverage of the differential tests. Throughout our dogfood cycles, we had agents review logs and traces from all beta users, allowing us to automatically diagnose and resolve runtime and agent issues identified by users. We also took the rewrite as an opportunity to redesign some of the UX/TUI flows and model-facing API. Bringing the rewrite to release quality took follow-up work over the following weeks, from finishing feature ports and fixing bugs to improving performance and polishing the interface. Prime Agent still wrote and tested these changes, while we had humans in the loop involved in finding problems, directing the changes, and reviewing all results. ### Hillclimbing performance With feature parity achieved, we wanted to optimize Prime Agent runtime performance across all user flows. We approached it the same way as the rewrite: by giving the agents an objective way to measure their own progress. We built a benchmark harness that measures Prime Agent performance across a variety of runtime metrics, and let Prime Agent hillclimb its speed and resource usage with well-deliberated improvements. MergedOpenClosed Sep 26 27 28 29 30 Oct 1 2 3 4 [#2856 Bound the session catalog cache](https://github.com/PrimeIntellect-ai/prime-agent/pull/2856) The performance benchmark evaluates Prime Agent in Rust and TypeScript, as well as other agent harnesses, on a fresh 4-core, 8 GB Prime Sandbox per benchmark, with noise checks that withhold any result too unstable to compare. Agents run in a real terminal driven through a screen emulator against a scripted model, so timings reflect what a user sees and exclude inference. With the harness in place, a second orchestrator ran a hillclimbing loop for three days with a single objective: improve the benchmark results without breaking parity. Each experiment followed the same procedure: 1. Agents profile the benchmarks to find where time and memory go, turning the largest costs into a backlog of hypotheses that the orchestrator then assigns to workers. 2. Workers build the current code and the candidate change on the same sandbox and run them in alternating order, along with neighboring benchmarks to catch regressions elsewhere. 3. Two reviewer agents, each on a different frontier model, check that behavior still matches TypeScript, that output stays byte-identical wherever the change claims it, and that nothing regresses on the model-facing surface. 4. The change merges, and the next experiment measures from the new baseline. We deliberately gave the loop no numeric targets, since a fixed threshold tends to become a stopping point. The agents' only objective was to keep improving the benchmarks without breaking parity for as long as measurable gains remained. Over the hillclimb cycle, the loop logged over 144 experiment and audit records, merging over 69 valid changes that boosted performance. Below are some significant improvements we’ve seen in important areas: TS VersionRust before HillclimbRust after Hillclimb ### Cold start Input-ready latency 14.18× faster ### Warm start Input-ready latency 13.34× faster ### Large-session memory Process-tree RSS · 10 MiB session 4.76× smaller ### Installed size Complete installation 2.89× smaller ### Agents view View-switch latency 6.09× faster Most of the gains came from three kinds of change: moving work off the startup and render paths, replacing polling loops with event-driven waits, and releasing memory as soon as large sessions finished loading. ## Results Overall, our Rust rewrite and following performance hillclimbing has made Prime Agent significantly faster and more resource efficient. With time to input roughly 14x faster than TypeScript and using over 80% less memory after startup, Prime Agent is amongst the fastest coding agent harnesses available. | | Prime Agent (Rust) | Prime Agent (TypeScript) | Claude Code v2.1.289 | Codex CLI v0.160.0 | Pi v1.0.3 | Hermes Agent v0.21.5 | | --- | --- | --- | --- | --- | --- | --- | | First paintLaunch until first visible output | 23.6 ms±0.630.63× faster | 722.8 ms±15.1 | 264.6 ms±5.8 | 296.8 ms±2.7 | 306.3 ms±6.7 | 1,715.3 ms±10.3 | | Time to type (cold)Fresh launch until typing works | 55.8 ms±4.913.22× faster | 737.8 ms±13.9 | 348.4 ms±8.2 | 324.6 ms±4.9 | 317.7 ms±8.0 | 2,094.5 ms±23.5 | | Time to type (warm)Repeat launch until typing works | 42.4 ms±4.312.96× faster | 549.6 ms±10.0 | 345.1 ms±6.2 | 321.3 ms±9.2 | 240.4 ms±5.9 | 2,097.1 ms±40.8 | | Installed sizeDisk space used by installation | 59.6 MB±0.02.89× smaller | 172.1 MB±0.0 | 492.4 MB±0.0 | 446.8 MB±0.0 | 456.0 MB±0.0 | 960.1 MB±0.0 | | Memory (RSS)Whole process tree after startup | 106.0 MB±1.35.73× smaller | 607.4 MB±0.9 | 226.9 MB±0.4 | 344.4 MB±3.1 | 138.1 MB±0.7 | 194.6 MB±0.3 | External harness results were measured with our custom runtime suite. Without a common benchmark standard, comparisons should be interpreted with caution. This more modular codebase and stronger compile-time checks will also help us ship new capabilities faster and catch more mistakes before they reach users. ## What's next With our Rust port in, we’re bringing the same attention to detail to every part of Prime Agent, from everyday systems interactions to complex work cross many agents. Now that infrastructural improvements are out of the way, we are accelerating on capabilities and evals, and making the multi-agent workflows behind this rewrite available to you. Prime Agent will also be more tightly knit into the Prime Intellect ecosystem, allowing you to work across the stack with cloud agent swarms, inference, traces, sandboxes, evals, hosted training, and more. With this rewrite, we are also releasing Prime Agent with native Windows support (beta) and installation through homebrew. Prime Agent remains [open source](https://github.com/PrimeIntellect-ai/prime-agent) and installs with one command: ``` curl -fsSL https://app.primeintellect.ai/prime-agent/install.sh | sh ``` or on Windows: ``` irm https://app.primeintellect.ai/prime-agent/install.ps1 | iex ``` If you'd like to work on Prime Agent, [we are hiring](https://www.primeintellect.ai/careers/8597d151-46db-4c67-a809-5d40daae7185). ### References \[1\] Karten, S., Zhang, A. L., Thomas, K., Müller, S., Bakouch, E., Auras, D., Senghaas, M., Obeid, F., Dunas, K., Hagemann, J., & Jaghouar, S. (2026). Prime agent: A self-improving RLM harness \[Preprint\]. arXiv. [https://arxiv.org/abs/2608.23552](https://arxiv.org/abs/2608.23552) \[2\] Karten, S., Appapogu, R. D., & Jin, C. (2026). Automatic generation of high-performance RL environments. In Proceedings of the Third Conference on Language Modeling (COLM 2026). [https://openreview.net/forum?id=UmpTwqxiY0](https://openreview.net/forum?id=UmpTwqxiY0)