Skip to content
All posts

Introducing Strands harness: frontier performance with 28% lower token cost隆重介绍 Strands harness:前沿性能,且 Token 成本降低 28%

Strands harness is a fully assembled, customizable, state-of-the-art agent you run locally or deploy anywhere.Strands harness 是一个功能完备、可定制且处于行业领先水平的智能体,既可在本地运行,也能部署到任何地方。

We noticed builders often wished their Claude Code or Codex setup could run in the cloud because locally their agent idea just “worked” with those harnesses.我们注意到,开发者们常希望自己的 Claude Code 或 Codex 设置能在云端运行,因为在本地环境下,他们的智能体构想配合这些工具框架往往能“直接跑通”。

But the moment you build your own agent, you’re on your own. It’s tricky wiring up the right primitives just well enough to match that “it just worked” feeling.但一旦你自己构建智能体,就只能孤军奋战了。要将各种基础组件恰到好处地整合在一起,以还原那种“直接跑通”的顺滑体验,其实并不容易。

Today we’re releasing Strands harness: a fully assembled state-of-the-art agent harness you can easily run locally or deploy to your favorite provider. It’s built to be a general-purpose agent rather than a coding agent. All you need is one line of Python or TypeScript to get it working with your choice of model. Strands harness beats other agent harnesses on cost efficiency while maintaining equal or better accuracy. It’s available under an Apache 2.0 license.今天,我们发布了 Strands harness:这是一个功能完备、处于行业领先水平的智能体框架,你可以轻松地在本地运行它,或将其部署到你偏好的服务商平台上。它被定位为通用智能体,而非单纯的代码智能体。只需一行 Python 或 TypeScript 代码,即可让你所选的模型开始工作。Strands harness 在保持同等或更优准确率的同时,在成本效率方面优于其他智能体框架。它基于 Apache 2.0 许可证开源。

Strands harness costs 28% less when using the same Claude or GPT models across six benchmarks. We found Strands harness showed better token-efficiency and nearly equal benchmark scores compared to Claude Code, Codex, and other popular harnesses. That’s important because we never want to sacrifice accuracy for lower cost. Deepseek Harness proved to be the most token-efficient overall, however, it typically reported the lowest accuracy scores. Our testing setup was distributed benchmarking on EC2 with Harbor.在六项基准测试中,使用相同的 Claude 或 GPT 模型时,Strands harness 的成本降低了 28%。我们发现,与 Claude Code、Codex 及其他主流框架相比,Strands harness 展现出了更高的 Token 效率,且基准测试得分几乎持平。这一点至关重要,因为我们绝不希望为了降低成本而牺牲准确率。Deepseek Harness 在 Token 效率上表现最出色,但其准确率得分通常最低。我们的测试环境是基于 EC2 和 Harbor 的分布式基准测试。

With Fable 5, Strands harness cost 77% less than Claude Code and scored higher on Terminal Bench 2.1. We’re also pleased to see two other open source harnesses perform similarly well on cost/accuracy against Claude Code.在 Fable 5 测试中,Strands harness 的成本比 Claude Code 低 77%,且在 Terminal Bench 2.1 上得分更高。我们也很高兴看到另外两个开源框架在成本与准确率方面表现出与 Claude Code 相近的水平。

Strands harness, built on the Strands Harness SDK, contains defaults for prompt caching and context management. Our default context management largely drove the token-efficiency and accuracy: tool results over ~1500 tokens get truncated, summarization (compaction) triggers when the context window hits above 85%, and context recovery runs within the loop if there’s an overflow.Strands harness 基于 Strands Harness SDK 构建,内置了提示词缓存(prompt caching)和上下文管理的默认设置。我们的默认上下文管理机制在很大程度上提升了 Token 效率和准确率:超过约 1500 个 Token 的工具执行结果会被截断;当上下文窗口占用超过 85% 时,会触发摘要(压缩)机制;如果发生溢出,循环内会运行上下文恢复流程。

Keep an eye out for a follow-up paper from our researchers regarding these benchmarks. In the meantime, we’re excited everyone gets to use these defaults in Strands harness.请关注我们研究人员后续发布的关于这些基准测试的论文。与此同时,我们很高兴大家能够使用 Strands harness 中的这些默认设置。

Easy to get started轻松上手

Strands harness runs on the latest models across Amazon Bedrock, Anthropic, OpenAI, and Google. Pick one by name, or point it at a local Ollama model:Strands harness 支持 Amazon Bedrock、Anthropic、OpenAI 和 Google 平台上的最新模型。你可以按名称选择模型,或将其指向本地的 Ollama 模型:

import { createHarness } from "@strands-agents/harness";
const agent = await createHarness({ model: "bedrock/global.anthropic.claude-opus-5" });
await agent("Research the top three vector databases, compare pricing and limits, and write it up in comparison.md");

Out of the box, create_harness() returns an agent that:开箱即用,create_harness() 返回的智能体具备以下特性:

  • Runs on a current reasoning model across Amazon Bedrock, Anthropic, OpenAI, Google, Ollama, or LiteLLM.可在 Amazon Bedrock、Anthropic、OpenAI、Google、Ollama 或 LiteLLM 上的主流推理模型上运行。
  • Ships with shell, file (read / write / edit), and web tools: the primitives a model already knows how to use, rather than a bespoke tool per task.内置 shell、文件(读/写/编辑)和网络工具:这些是模型已经掌握使用方法的基础工具,无需为每个任务定制工具。
  • Manages its own context window. It offloads bulky tool results to files and caches the reused parts of each request to save time and cost.自主管理上下文窗口。它会将庞大的工具执行结果卸载到文件中,并缓存每个请求中可复用的部分,从而节省时间和成本。
  • Keeps long-term memory across runs, and resumes an earlier conversation when you give it a session ID.跨运行保持长期记忆,并在提供会话 ID 时恢复之前的对话。
  • Delegates open-ended subtasks to a built-in helper agent, and tracks multi-step work with a checklist.将开放式子任务委托给内置的辅助智能体,并通过清单追踪多步骤工作。
  • Loads skills if they exist.加载现有技能。

Strands harness can be deployed on any provider with a linux container, such as Modal, Cloudflare Containers, Azure Container Apps, Google Cloud Run, Amazon ECS, and Amazon Bedrock AgentCore.Strands harness 可以部署在任何支持 Linux 容器的服务商平台上,例如 Modal、Cloudflare Containers、Azure Container Apps、Google Cloud Run、Amazon ECS 和 Amazon Bedrock AgentCore。

We also have the Strands CLI that allows you to prototype your agent in plain English. Wire up your model provider of choice, then add prompts and tools to watch your agent come to life. Afterwards, you can run /export in the Strands CLI to get a copy of the code in either TypeScript or Python, a very convenient way to keep iterating on Strands harness with your preferred coding agent.我们还提供了 Strands CLI,允许你用简单的英语进行智能体原型设计。连接你选择的模型提供商,然后添加提示词和工具,即可观察智能体如何运作。完成后,你可以在 Strands CLI 中运行 /export 命令,获取 TypeScript 或 Python 版本的代码,这是一种使用你偏好的代码智能体持续迭代 Strands harness 的便捷方式。

Here we ask the Strands harness agent to “add the Playwright MCP” and then measure latency when loading a video on a blog post. After seeing the MCP tools accurately work, we simply run /export to get the Strands harness code. You can see the Playwright MCP got added to the boilerplate, making it easy to iterate with a coding agent or adding config to deploy.在这里,我们要求 Strands harness 智能体“添加 Playwright MCP”,然后测量加载博客文章视频时的延迟。在确认 MCP 工具准确运行后,我们只需运行 /export 即可获得 Strands harness 代码。你可以看到 Playwright MCP 已被添加到样板代码中,这使得使用代码智能体进行迭代或添加部署配置变得非常简单。

What you can build from Strands harness你可以用 Strands harness 构建什么

The Strands CLI is actually built on top of Strands harness. We unlocked a bunch of ambitious ideas because of how easy it is to prototype any agent. Recently our engineer, Gautam Sirdeshmukh, inspired by agent platforms like Grokbot and Muse, built a desktop app that kicks off Strands harness remotely.Strands CLI 本身就是基于 Strands harness 构建的。由于原型设计任何智能体都非常容易,我们得以实现了一系列雄心勃勃的构想。最近,我们的工程师 Gautam Sirdeshmukh 受 Grokbot 和 Muse 等智能体平台的启发,构建了一个可以远程启动 Strands harness 的桌面应用程序。

When you’re ready to go deeper, Strands harness is fully customizable. You can easily override any default, swap models, add tools, or gradually replace components all the way down to the Strands Harness SDK. The code is yours.当你准备深入研究时,Strands harness 是完全可定制的。你可以轻松覆盖任何默认设置、更换模型、添加工具,或者逐步替换组件,直至深入到 Strands Harness SDK 层面。代码完全属于你。

We’re excited for all kinds of agents that’ll come to life with Strands harness.我们非常期待看到大家利用 Strands harness 创造出各种各样的智能体。

Try it out today立即尝试

You can easily install Strands harness with pip install strands-harness for Python or npm install @strands-agents/harness for TypeScript. For an interactive experience, download the Strands CLI: npm install -g @strands-agents/cli.你可以轻松安装 Strands harness:Python 用户使用 pip install strands-harness,TypeScript 用户使用 npm install @strands-agents/harness。如需交互式体验,请下载 Strands CLI:npm install -g @strands-agents/cli。

We believe quickly prototyping with a batteries included harness will create more useful agents. Our team is also in Discord, so come say hi or ask us any question about agents!我们相信,利用功能完备的框架进行快速原型设计,将创造出更多有价值的智能体。我们的团队也在 Discord 上,欢迎来打个招呼,或向我们咨询有关智能体的任何问题!