Strands Agents Harness SDK — 双语言 Agent 工程框架

来源:GitHub Trending | strands-agents/harness-sdk | ⭐ 7,612 | Python / TypeScript
抓取时间:2026-09-23


是什么

Strands Agents 是面向生产的 AI Agent SDK,提供从原型到线上的一站式 agent 循环能力。分两层:

  • Harness(推荐起点)create_harness() 一行启动完整 agent,Batteries included
  • SDK(深度定制):完全接管 agent 循环,按需组装工具/模型/记忆

Monorepo 结构:

harness-py/     → Python harness(pip install strands-harness)
harness-ts/     → TypeScript harness(npm install @strands-agents/harness)
strands-cli/    → 终端原型调试 CLI
strands-py/     → Python SDK
strands-ts/     → TypeScript SDK
strands-mcp/    → MCP Server
site/           → 文档站(strandsagents.com)

快速启动(Python)

pip install strands-harness
from strands_harness import create_harness

agent = create_harness()
agent("Find the slowest test in this repo and explain why it's slow")

快速启动(TypeScript)

npm install @strands-agents/harness
import { createHarness } from '@strands-agents/harness'

const agent = await createHarness()
await agent.invoke("Find the slowest test in this repo and explain why it's slow")

内置能力矩阵

能力 说明
生命周期控制 turn limits、token 预算、取消、stop reasons
工具 & 结构化输出 原生支持,非自弹自唱
MCP MCP tools 一体化
多 Agent 模式 内置多 agent 协作模式
记忆 & Session 会话持久化
模型可移植性 Bedrock/Anthropic/OpenAI/Gemini 一键切换
Streaming 内置
Guardrails 线上安全拦截
Tracing 每步决策可追溯
Evals 内置评测 SDK

工程价值评价

维度 评分 说明
命令完整性 ⭐⭐⭐⭐ pip/npm 安装 + 单文件示例可完全复现
源码可用性 ⭐⭐⭐⭐ PyPI + npm 双分发,monorepo 全开源
可复现性 ⭐⭐⭐⭐ Quickstart 完整,文档质量高
性能数据 ⭐⭐ 声称 benchmarked defaults,未深入展开
错误案例 ⭐⭐ 官网有 troubleshooting 文档

结论:目前最完整的生产级 Agent Harness,对标 LangChain 的 agent 循环但更轻量。P0 级工程参考。


相关链接

  • 文档:https://strandsagents.com/
  • PyPI:https://pypi.org/project/strands-harness/
  • npm:https://www.npmjs.com/package/@strands-agents/harness
  • Discord:https://discord.gg/strands