harness-sdk README

The project's README from github.com/strands-agents/harness-sdk. As one markdown file: README.md.

Strands

Strands Agents

A model-driven approach to building AI agents in just a few lines of code.

GitHub commit activity GitHub open issues GitHub open pull requests License Python harness version TypeScript harness version CLI version Python SDK version TypeScript SDK version

Documentation ◆ Samples ◆ MCP Server ◆ Discord

Strands Agents is an open-source SDK for building and running AI agents in Python and TypeScript. Choose Strands when you would otherwise write your own agent loop: it runs in your process with no hosted control plane, and it covers the jobs a hand-rolled loop grows into. In one SDK you get lifecycle controls (turn limits, token budgets, cancellation, stop reasons), tools and structured output, MCP, multi-agent patterns, memory and sessions, model portability, streaming, guardrails, tracing, and evals.

This monorepo contains Strands harness, the Python and TypeScript SDKs, the documentation site, and supporting packages:

Directory Description
harness-py/ Python Strands harness: fully assembled agent via create_harness() (PyPI · docs)
harness-ts/ TypeScript Strands harness: fully assembled agent via createHarness() (npm · docs)
strands-cli/ strands CLI: prototype and chat with a harness agent from the terminal (npm)
strands-py/ Python SDK: agent loop, model providers, tools (PyPI · releases)
strands-ts/ TypeScript SDK: agent loop, model providers, tools (npm · releases)
site/ Source for the strandsagents.com documentation site (Astro/Starlight)
team/ Governance and cross-SDK process docs (tenets, decisions, PR & compatibility guidelines, and designs/ proposals)

Why Strands

Build an agent harness. Control it end-to-end.

MCP, streaming, multi-agent patterns, and structured output are all built in.

Quick Start

The easiest way to get started is with Strands harness, a fully assembled, state-of-the-art agent. A single create_harness() (Python) or createHarness() (TypeScript) call gives you an optimized agent with benchmarked defaults for the model, tools, memory, sessions, and context management — ready to take from idea to production. Follow the harness quickstart, or see the Python Strands harness and TypeScript Strands harness packages to get started.

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")

Start here to get a batteries-included agent, then drop down to the SDKs below when you want to own the agent loop and wire up tools, model providers, and memory yourself. The harness configuration reference documents every default you can override.

The Quickstart Guide covers configuring providers (Amazon Bedrock, Anthropic, OpenAI, Gemini, Ollama, and more).

Working with the SDK

The Strands Harness SDK lets you go deeper and control every part of the agent: the loop, tools, model providers, memory, sessions, and hooks. You can dive into the SDK after working with Strands harness or if you prefer building your own harness from the ground up when the assembled defaults aren't enough.

Python

Requires Python 3.10+:

pip install strands-agents strands-agents-tools
from strands import Agent
from strands_tools import calculator

agent = Agent(tools=[calculator])
agent("What is the square root of 1764")

The Python SDK README covers tools, model providers, MCP, and bidirectional streaming.

TypeScript

Requires Node.js 22+:

npm install @strands-agents/sdk
import { Agent } from '@strands-agents/sdk'

const agent = new Agent()
const result = await agent.invoke('What is the square root of 1764?')
console.log(result)

More in the TypeScript SDK README, including Zod-typed tools, structured output, and multi-agent patterns.

Documentation

For detailed guidance & examples, explore our documentation:

The docs themselves live in this monorepo under site/, and doc PRs are welcome alongside code changes.

Development

Git operations (commits, branches, PRs) are done from the repo root. Each package has its own toolchain:

Python SDK (strands-py/):

cd strands-py
pip install hatch
hatch test        # run unit tests
hatch fmt         # format & lint

TypeScript SDK (strands-ts/):

npm ci            # install from repo root
npm run build     # build
npm test          # run unit tests

Documentation site (site/):

cd site
npm install
npm run dev       # local dev server at http://localhost:4321/

Contributing ❤️

We welcome contributions! See our Contributing Guide for details on:

Stay in touch with the team

Come meet the Strands team and other users on Discord

License

This project is licensed under the Apache License 2.0 - see the LICENSE.APACHE file for details.

Security

See CONTRIBUTING for more information.

harness-sdk (strands-agents/harness-sdk)

Searching Database…

这是什么?Strands Agents 是一个开源 SDK,用于在 Python 和 TypeScript 中构建和运行 AI 智能体。它采用模型驱动的方式,几行代码就能跑起一个可用的智能体。
这是装在我自己代码里的库,还是托管服务?是安装在你自己代码里运行的库。这个 monorepo 包含 Python 和 TypeScript 的 SDK、两者各自开箱即用的 harness 包,以及文档网站。
怎么让我的第一个智能体跑起来?从 PyPI 或 npm 安装一个 harness 包,然后在 Python 里调用 createharness(),在 TypeScript 里调用 createHarness()。一次调用就能得到一个组装好的智能体,模型、工具、记忆、会话和上下文管理都采用经过基准测试的默认配置。
它能驱动哪些 AI 模型?它不挑模型:对 Amazon Bedrock、Anthropic、OpenAI 和 Gemini 提供一等支持,还支持许多其他提供商以及自定义模型。快速入门指南也介绍了如何配置 Ollama。
在我现在的 Python 或 Node 环境上能跑吗?先看运行环境的最低要求:Python 端需要 Python 3.10+,TypeScript SDK 需要 Node.js 22+。选一个和你技术栈匹配的 SDK 就行。
我的智能体是跑在托管服务器上,还是跑在我自己的进程里?跑在你自己的进程里——没有托管控制平面。离开你电脑的数据,只有你选的模型提供商收到的那些。
可以免费使用吗,包括商用?可以——采用 Apache License 2.0,这是一个允许商业使用的宽松许可证。
harness 和 SDK 有什么区别?harness 是一个开箱即用的智能体——想要一个经过优化、默认配置都经过基准测试的方案,从这里入手。Python 和 TypeScript SDK 则适合你想自己掌控智能体循环、自己接上工具、模型提供商和记忆的场景。
怎么控制智能体在每一步做什么?Hooks 可以拦截循环中的任何一步,用来记录日志、校验或改道;steering 处理器能让智能体自我纠正,而不是悄悄失败。Guardrails 会在错误执行之前拦住它们,而且每个决策默认都有追踪记录。
不写应用,能在终端里试用智能体吗?可以——monorepo 自带一个 strands CLI,通过 npm 安装,直接在终端里就能做原型、和 harness 智能体对话。
相比自己写智能体循环,为什么选这个?自己手写的循环会不断冒出本该由它替你完成的活儿:轮次上限、token 预算、取消、停止原因、MCP、记忆和会话、流式输出、评估,这些在一个 SDK 里全都自带,而且换模型后端时你的代码不用改。
What are similar projects?rrsi, hive, ruflo, qwen-code, Raven, cayu, PocketFlow, adk-python
Size
268 MB
Stars
8.9K
Age
1y
Commits · 90 Days