Strands Agents
ツールとプロンプトだけを書き、どれをいつ呼んで、いつ終えるかはモデルが判断するAWS製のSDK
Strands Agentsとは
Strands Agentsは、処理の流れをグラフとして組み立てる方式とは逆の設計です。システムプロンプトと、ツールとして印を付けた普通の関数を渡せば、どれをどの順で呼び、いつ終えるかはモデルが判断します。最初のエージェントは配線図ではなく数行で書ける一方、想定外の動きをしたときに見比べるグラフがないため、実行の記録をたどって原因を探すことになります。そのループの周りには、長く動かすために必要な部品が揃っています。各ステップで呼ばれるフックでツール実行を記録したり拒否したりでき、会話マネージャは履歴がモデルの上限に達する前に切り詰めや要約を行います。あるエージェントを別のエージェントのツールとして渡すこともできます。
Strands Agentsで何ができますか?
- デコレータ1つで関数をツールにする — 普通の関数に印を付けるだけでモデルが呼べるようになります。引数の定義は型注釈から生成されるため、別途スキーマを書いて同期させる必要がありません。
- MCPサーバーのツールを取り込む — MCPサーバーを指定すると、そこにあるツールが自分で書いたツールと同じ並びで使えるようになります。変換用のコードは要りません。
- ツール実行の直前に割り込む — フックはループの各段階で呼ばれるため、これから実行される内容を記録したり、引数を書き換えたり、実行そのものを拒否したりできます。
- 長い会話を上限内に収める — 会話マネージャが履歴の増加に応じて古いやり取りを削るか要約するので、モデルの入力上限に達して実行が失敗することを避けられます。
- エージェントを別のエージェントに渡す — あるエージェントを別のエージェントのツールとして渡したり、複数を群として動かして1つの作業を分担させたりできます。
- 判断の履歴をトレースとして残す — ループはOpenTelemetry形式で記録を出力するため、サービス監視で使っている道具でそのまま、どのツールがどの順で動き、いくらかかったかを確認できます。
Strands Agentsを選ぶ前に
- 2つの言語で機能が揃っていません。人の承認を待って実行を止める仕組みはPython向けとして説明され、TypeScript版は今後の対応と案内されています。
- 既定の想定はAWS寄りです。モデルの提供元はAmazon Bedrockが前提で、配置手順もLambdaやFargate、EKSが中心ですが、他の提供元や実行環境も利用できます。
よくある質問
Strands Agentsは商用利用できますか?
Strands AgentsはApache-2.0ライセンスで公開されています。OSI承認のオープンソースライセンスで、商用利用が認められています。
Strands Agentsはどの形で使えますか?
Strands Agentsはセルフホスト・ローカル実行の形で利用できます。
ドキュメント
strands-agents/harness-sdk のREADMEより転載(Apache-2.0)。 原文を読む ↗
Strands Agents is a simple yet powerful SDK that takes a model-driven approach to building and running AI agents. From simple conversational assistants to complex autonomous workflows, from local development to production deployment, Strands Agents scales with your needs.
This monorepo contains the Python SDK, TypeScript SDK, documentation site, and supporting packages:
| Directory | Description |
|---|---|
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.
- Build your way. Any model, any cloud. Context management, execution limits, and observability built in before you write a line of config. Swap backends when you scale; your code stays the same.
- Model agnostic. First-class support for Amazon Bedrock, Anthropic, OpenAI, and Gemini, plus many more providers and custom ones.
- Stay in control. The agent loop traces every decision by default. Hooks let you intercept any step to log it, validate it, or redirect it.
- Deliver outcomes that work. Guardrails catch mistakes before they run. Steering handlers let agents correct themselves instead of failing silently.
MCP, streaming, multi-agent patterns, and structured output are all built in.
Quick Start
Both SDKs default to the Amazon Bedrock model provider, so you’ll need AWS credentials configured and model access enabled for Claude Sonnet. The Quickstart Guide covers configuring other providers (Anthropic, OpenAI, Gemini, Ollama, and more).
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 20+:
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:
- User Guide
- Quick Start Guide
- Agent Loop
- Examples
- API Reference: Python · TypeScript
- Production & Deployment Guide
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/
Stay in touch with the team
Come meet the Strands team and other users on Discord
Security
See CONTRIBUTING for more information.