跳到主内容
@wquguru
精选88MarkTechPost(RSS)产品发布/更新

AWS发布Strands Harness开源Agent框架,成本降低28%

AWS Strands Agents Team Releases Strands Harness: An Open-Source Agent Harness With 28% Lower Token Cost at Comparable Accuracy

原文
发到 X
推荐理由

Agent框架是近期热点,这个开源方案给出了具体的上下文优化参数(如1500截断、85%压缩)和实测数据,对做Agent工程落地的同学有直接参考价值。

Many developers find that an agent idea works inside Claude Code or Codex, then struggles once they rebuild it with their own loop. The Strands Agents team at AWS is targeting that gap with Strands harness, a fully assembled, general-purpose agent harness. It runs locally or deploys to a cloud provider, ships for Python and TypeScript under Apache 2.0, and starts with one line of code. The team reports 28% lower cost than other harnesses running the same Claude or GPT models across 6 benchmarks, with near-equal accuracy.

许多开发者发现,某个 Agent 创意在 Claude Code 或 Codex 内部运行良好,但一旦用自定义循环重新构建,就会遇到困境。AWS 的 Strands Agents 团队通过 Strands harness 瞄准了这一空白,这是一个完全组装好的通用型 Agent 框架。它可以在本地运行或部署到云提供商,以 Apache 2.0 许可证提供 Python 和 TypeScript 版本,只需一行代码即可启动。该团队报告称,在 6 个基准测试中,运行相同的 Claude 或 GPT 模型时,其成本比其他框架低 28%,且准确率几乎相当。

Is it deployable? Yes. It runs locally, and a bundled skills file helps your coding agent generate deployment config for AWS, GCP, Azure, Cloudflare, and Modal.

它可以部署吗?可以。它可以在本地运行,并且捆绑的技能文件有助于你的编码 Agent 为 AWS、GCP、Azure、Cloudflare 和 Modal 生成部署配置。

What is Strands Harness

什么是 Strands Harness

A harness is the system around the model: the loop, tools, context handling, memory, and recovery. Strands already exposed those building blocks through the Strands Harness SDK. Strands harness packages them into working defaults. It is built as a general-purpose agent, not a coding agent.

Harness 是围绕模型的系统:包括循环、工具、上下文处理、记忆和恢复机制。Strands 已经通过 Strands Harness SDK 暴露了这些构建块。Strands harness 将它们打包为可用的默认值。它是作为通用型 Agent 构建的,而非编码专用 Agent。

Out of the box, create_harness returns an agent that:

开箱即用,create_harness 返回一个具备以下功能的 Agent:

  • Runs on a current reasoning model through Amazon Bedrock, Anthropic, OpenAI, Google, Ollama, or LiteLLM.
  • Ships shell, file (read, write, edit), and web tools, instead of a bespoke tool per task.
  • Offloads bulky tool results to files and caches reused parts of each request.
  • Keeps long-term memory across runs and resumes a conversation from a session ID.
  • Delegates open-ended subtasks to a built-in helper agent and tracks multi-step work with a checklist.
  • Loads Agent Skills when it finds them.
  • 通过 Amazon Bedrock、Anthropic、OpenAI、Google、Ollama 或 LiteLLM 在当前推理模型上运行。
  • 提供 shell、文件(读、写、编辑)和 web 工具,而不是为每个任务定制专用工具。
  • 将庞大的工具结果卸载到文件中,并缓存每个请求中重复使用的部分。
  • 跨运行保持长期记忆,并通过会话 ID 恢复对话。
  • 将开放式子任务委托给内置辅助 Agent,并使用清单跟踪多步骤工作。
  • 发现时加载 Agent Skills。

Benchmark Setup and the 28% Figure

基准测试设置与 28% 的数据

The Strands Agents team ran distributed benchmarking on Amazon EC2 with Harbor, the evaluation framework from the Terminal-Bench creators. The score is the average across 6 benchmarks: ALFWorld, ContextBench, GAIA, WebShop, τ²-bench, and Terminal-Bench 2.1. Cost is the average dollars per task. Rivals on the chart are Claude Code, Codex, oh-my-pi, OpenCode, and DeepSeek Harness.

Strands Agents 团队使用 Harbor(Terminal-Bench 创建者的评估框架)在 Amazon EC2 上运行分布式基准测试。得分是 6 个基准测试的平均值:ALFWorld、ContextBench、GAIA、WebShop、τ²-bench 和 Terminal-Bench 2.1。成本是每个任务的平均美元数。图表中的竞争对手包括 Claude Code、Codex、oh-my-pi、OpenCode 和 DeepSeek Harness。

One important thing to note. DeepSeek Harness was the most token-efficient harness overall, running about 14% cheaper than Strands harness. It also scored lower on every benchmark. The chart footnote states that including it brought the overall savings figure down to 28%. The highest-scoring point on the chart is Claude Opus 5 on Strands harness, near 85%.

需要注意的一个重要事项。DeepSeek Harness 是整体最节省 Token 的框架,比 Strands harness 便宜约 14%。但它在所有基准测试中的得分都较低。图表注释指出,将其纳入计算后,整体节省比例降至 28%。图表中得分最高的点是 Strands harness 上的 Claude Opus 5,接近 85%。

Terminal-Bench 2.1: Same Model, 5 Harnesses

Terminal-Bench 2.1:同一模型,5 种 Harness

The clearest head-to-head uses Claude Fable 5 on Terminal-Bench 2.1, with 89 trials per harness.

最清晰的直接对比是在 Terminal-Bench 2.1 上使用 Claude Fable 5,每种 Harness 进行 89 次试验。

HarnessRun costAccuracy
Strands harness$56.2969.7
Oh-my-pi$86.8369.7
OpenCode$73.4266.3
Claude Code$248.0561.8
DeepSeek Harness$40.3059.5
Harness运行成本准确率
Strands harness$56.2969.7
Oh-my-pi$86.8369.7
OpenCode$73.4266.3
Claude Code$248.0561.8
DeepSeek Harness$40.3059.5

Against Claude Code, Strands harness cost 77% less and scored 7.9 points higher. Oh-my-pi matched its 69.7 accuracy at 54% higher cost. DeepSeek Harness was cheaper still, but trailed by 10.2 points. The team also noted that 2 other open-source harnesses performed well on cost and accuracy against Claude Code.

与 Claude Code 相比,Strands harness 的成本低 77%,且准确率高出 7.9 分。Oh-my-pi 以高出 54% 的成本达到了相同的 69.7 准确率。DeepSeek Harness 更便宜,但准确率落后 10.2 分。团队还指出,另外两个开源 harness 在成本和准确率方面与 Claude Code 相比表现良好。

What Drives the Efficiency

效率的驱动因素

Strands harness ships defaults for prompt caching and context management. The team says context management largely drove both token efficiency and accuracy. 3 rules do the work:

Strands harness 默认启用提示词缓存和上下文管理。团队表示,上下文管理在很大程度上推动了令牌效率和准确率。这由以下 3 条规则实现:

  • Tool results over about 1,500 tokens get truncated.
  • Summarization (compaction) triggers when context usage passes 85%.
  • Context recovery runs inside the loop if the window overflows.
  • 超过约 1,500 个令牌的工具结果会被截断。
  • 当上下文使用量超过 85% 时触发摘要(压缩)。
  • 如果窗口溢出,则在循环内执行上下文恢复。

This matches recent independent research. The HarnessTax study compared Claude Code, Codex CLI, and Pi across 7 models. It found harness choice barely moved success rates, while the same model reached similar success at up to 5x the cost. The Strands researchers say a follow-up paper on their benchmarks is coming.

这与最近的独立研究相符。HarnessTax 研究比较了 Claude Code、Codex CLI 和 Pi 在 7 个模型上的表现。研究发现,harness 的选择对成功率影响微乎其微,而同一模型在高达 5 倍的成本下能达到相似的成功率。Strands 的研究人员表示,关于他们基准测试的后续论文即将发布。

Getting Started

入门指南

Install with pip install strands-harness or npm install @strands-agents/harness. Pick a model by name, or point the harness at a local Ollama model:

通过 pip install strands-harness 或 npm install @strands-agents/harness 进行安装。按名称选择模型,或将 harness 指向本地 Ollama 模型:

代码 · 3
from strands_harness import create_harness
agent = create_harness(model="litellm/openai/gpt-5.6-sol")
agent("Research the top three vector databases and compare their pricing")
代码 · 3
from strands_harness import create_harness
agent = create_harness(model="litellm/openai/gpt-5.6-sol")
agent("Research the top three vector databases and compare their pricing")

The Strands CLI (npm install @strands-agents/strands-cli) lets you prototype an agent in plain English. In the team’s demo, the agent was asked to add the Playwright MCP server and measure video load latency on a blog post. Running /export then produced the harness code, with the Playwright MCP included, as a Python or TypeScript zip.

Strands CLI (npm install @strands-agents/strands-cli) 允许你用纯英语原型化一个智能体。在团队的演示中,该智能体被要求添加 Playwright MCP 服务器并测量博客文章的视频加载延迟。运行 /export 后,生成了包含 Playwright MCP 的 Python 或 TypeScript zip 格式的 harness 代码。

The CLI itself is built on Strands harness. Strands engineer Gautam Sirdeshmukh also used it to build a desktop app that starts Strands harness runs remotely.

CLI 本身基于 Strands harness 构建。Strands 工程师 Gautam Sirdeshmukh 也使用它构建了一个桌面应用程序,用于远程启动 Strands harness 运行。

Customization goes deep. You can override any default, swap models, add tools, or replace components down to the Strands Harness SDK. Because the harness is a library dependency, the agent prototyped on a laptop is the same one embedded in production.

自定义功能深入底层。你可以覆盖任何默认设置、更换模型、添加工具,或者将组件替换为低至 Strands Harness SDK 级别。由于 harness 是一个库依赖项,在笔记本电脑上原型化的智能体与嵌入生产环境的是同一个。

Key Takeaways

关键要点

  • Strands harness packages AWS’s Strands primitives into a general-purpose, Apache 2.0 agent.
  • It reports 28% lower cost than rival harnesses across 6 benchmarks at comparable accuracy.
  • With Fable 5 on Terminal-Bench 2.1, it cost 77% less than Claude Code and scored higher.
  • Context defaults drive the gains: 1,500-token truncation, 85% compaction, in-loop recovery.
  • One create_harness call targets Bedrock, Anthropic, OpenAI, Google, Ollama, or LiteLLM.
  • Strands harness 将 AWS 的 Strands 原语打包为一个通用的 Apache 2.0 许可的智能体。
  • 在 6 个基准测试中,其成本比竞争对手的 harness 低 28%,同时保持相当的准确率。
  • 在 Terminal-Bench 2.1 上使用 Fable 5 时,其成本比 Claude Code 低 77%,且得分更高。
  • 上下文默认设置带来了收益:1,500 令牌截断、85% 压缩、循环内恢复。
  • 一次 create_harness 调用可针对 Bedrock、Anthropic、OpenAI、Google、Ollama 或 LiteLLM。

Check out the Technical details, GitHub repo, PyPI package, and Strands Agents docs.

查看技术细节、GitHub 仓库、PyPI 包和 Strands Agents 文档。

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

相似阅读

关联信息,但可能不是同一事件