strands-agents 1.57.1


pip install strands-agents

  Latest version

Released: Sep 25, 2026


Meta
Author: AWS
Requires Python: >=3.10

Classifiers

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers

License
  • OSI Approved :: Apache Software License

Operating System
  • OS Independent

Programming Language
  • Python :: 3
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

Topic
  • Scientific/Engineering :: Artificial Intelligence
  • Software Development :: Libraries :: Python Modules

Strands Agents - Python SDK

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 PyPI version Python versions Strands Discord

Documentation ◆ Samples ◆ Tools ◆ MCP Server

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.

Feature Overview

  • Lightweight & Flexible: Simple agent loop that just works and is fully customizable
  • Model Agnostic: Support for Amazon Bedrock, Anthropic, Gemini, LiteLLM, Llama, Ollama, OpenAI, Writer, and custom providers
  • Advanced Capabilities: Multi-agent systems, autonomous agents, and streaming support
  • Built-in MCP: Native support for Model Context Protocol (MCP) servers, enabling access to thousands of pre-built tools

Quick Start

# Install Strands Agents
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")

Note: For the default Amazon Bedrock model provider, you'll need AWS credentials configured and model access enabled for Claude 4 Sonnet in the us-west-2 region. See the Quickstart Guide for details on configuring other model providers.

Installation

Ensure you have Python 3.10+ installed, then:

# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows use: .venv\Scripts\activate

# Install Strands and tools
pip install strands-agents strands-agents-tools

Features at a Glance

Python-Based Tools

Easily build tools using Python decorators:

from strands import Agent, tool

@tool
def word_count(text: str) -> int:
    """Count words in text.

    This docstring is used by the LLM to understand the tool's purpose.
    """
    return len(text.split())

agent = Agent(tools=[word_count])
response = agent("How many words are in this sentence?")

Hot Reloading from Directory: Enable automatic tool loading and reloading from the ./tools/ directory:

from strands import Agent

# Agent will watch ./tools/ directory for changes
agent = Agent(load_tools_from_directory=True)
response = agent("Use any tools you find in the tools directory")

MCP Support

Connect to Model Context Protocol (MCP) servers:

from strands import Agent
from strands.tools.mcp import MCPClient
from mcp import stdio_client, StdioServerParameters

aws_docs_client = MCPClient(
    lambda: stdio_client(StdioServerParameters(command="uvx", args=["awslabs.aws-documentation-mcp-server@latest"]))
)

with aws_docs_client:
   agent = Agent(tools=aws_docs_client.list_tools_sync())
   response = agent("Tell me about Amazon Bedrock and how to use it with Python")

The SDK works with both major versions of the mcp package through a built-in compatibility layer, so most code that uses MCPClient runs unchanged on either version. A fresh install resolves to mcp 2.x, and pinning mcp<2 keeps you on 1.x. See docs/MCP_VERSIONS.md for support status, the behavior differences on 2.x, and migration notes.

Multiple Model Providers

Support for various model providers:

from strands import Agent
from strands.models import BedrockModel
from strands.models.ollama import OllamaModel
from strands.models.llamaapi import LlamaAPIModel
from strands.models.gemini import GeminiModel
from strands.models.llamacpp import LlamaCppModel

# Bedrock
bedrock_model = BedrockModel(
  model_id="us.amazon.nova-pro-v1:0",
  temperature=0.3,
  streaming=True, # Enable/disable streaming
)
agent = Agent(model=bedrock_model)
agent("Tell me about Agentic AI")

# Google Gemini
gemini_model = GeminiModel(
  client_args={
    "api_key": "your_gemini_api_key",
  },
  model_id="gemini-2.5-flash",
  params={"temperature": 0.7}
)
agent = Agent(model=gemini_model)
agent("Tell me about Agentic AI")

# Ollama
ollama_model = OllamaModel(
  host="http://localhost:11434",
  model_id="llama3"
)
agent = Agent(model=ollama_model)
agent("Tell me about Agentic AI")

# Llama API
llama_model = LlamaAPIModel(
    model_id="Llama-4-Maverick-17B-128E-Instruct-FP8",
)
agent = Agent(model=llama_model)
response = agent("Tell me about Agentic AI")

Built-in providers:

Custom providers can be implemented using Custom Providers

Example tools

Strands offers an optional strands-agents-tools package with pre-built tools for quick experimentation:

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

It's also available on GitHub via strands-agents/tools.

Bidirectional Streaming

⚠️ Experimental Feature: Bidirectional streaming is currently in experimental status. APIs may change in future releases as we refine the feature based on user feedback and evolving model capabilities.

Build real-time voice and audio conversations with persistent streaming connections. Unlike traditional request-response patterns, bidirectional streaming maintains long-running conversations where users can interrupt, provide continuous input, and receive real-time audio responses. Get started with your first BidiAgent by following the Quickstart guide.

Supported Model Providers:

  • Amazon Bedrock Nova Sonic
  • Google Gemini Live
  • OpenAI Realtime API

Installation:

# Server-side only (no audio I/O dependencies)
pip install strands-agents[bidi]

# With all portable Bidi providers, terminal I/O, and audio processing (no local audio devices)
pip install strands-agents[bidi-all]

# For local microphone/speaker access, install PortAudio for your OS first, then:
pip install strands-agents[bidi,bidi-io,bidi-pyaudio]

Note: Bedrock Nova Sonic requires Python 3.12+ due to its experimental AWS SDK dependency.

Quick Example:

import asyncio
from strands.experimental.bidi.agent import BidiAgent
from strands.experimental.bidi.models import BedrockNovaSonicModel
from strands.experimental.bidi.io import AudioIO
from strands_tools import calculator, stop

async def main():
    # Create bidirectional agent with Nova Sonic v2
    model = BedrockNovaSonicModel(model_id="amazon.nova-2-sonic-v1:0")
    agent = BidiAgent(model=model, tools=[calculator, stop])

    # Setup audio I/O (local audio requires the bidi-pyaudio extra)
    audio_io = AudioIO()

    # Run with real-time audio streaming and terminal transcripts
    # stop tool allows user to verbally stop agent execution
    await agent.run(
        inputs=[audio_io.input()],
        outputs=[audio_io.output()]
    )

if __name__ == "__main__":
    asyncio.run(main())

Note: ConsoleIO is included with the bidi-io extra. AudioIO requires the bidi-io and bidi-pyaudio extras plus the PortAudio system library. For server-side deployments where audio I/O is handled by clients (browsers, mobile apps), install only strands-agents[bidi] and implement custom input/output streams using the InputStream and OutputStream protocols.

Configuration Options:

from strands.experimental.bidi.models import BedrockNovaSonicModel

# Configure audio streams and Nova Sonic session parameters.
model = BedrockNovaSonicModel(
    model_id="amazon.nova-2-sonic-v1:0",
    audio={
        "input": {"sample_rate": 16000},
        "output": {"sample_rate": 16000},
    },
    voice="matthew",
    params={
        "turnDetectionConfiguration": {
            "endpointingSensitivity": "MEDIUM"
        },
        "inferenceConfiguration": {
            "maxTokens": 2048,
            "temperature": 0.7
        },
    },
)

# Configure I/O devices
audio_io = AudioIO(
    input_device_index=0,  # Specific microphone
    output_device_index=1,  # Specific speaker
    input_buffer_size=10,
    output_buffer_size=10
)

Documentation

For detailed guidance & examples, explore our documentation:

Development

pip install hatch
hatch test        # run unit tests
hatch fmt         # format & lint

Contributing ❤️

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

  • Reporting bugs & features
  • Development setup
  • Contributing via Pull Requests
  • Code of Conduct
  • Reporting of security issues

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 file for details.

Security

See CONTRIBUTING for more information.

1.57.1 Sep 25, 2026
1.57.0 Sep 22, 2026
1.56.0 Sep 15, 2026
1.55.1 Sep 09, 2026
1.55.0 Sep 08, 2026
1.54.0 Aug 27, 2026
1.53.0 Aug 21, 2026
1.52.0 Aug 12, 2026
1.51.0 Aug 07, 2026
1.50.2 Jul 27, 2026
1.50.1 Jul 24, 2026
1.50.0 Jul 24, 2026
1.48.0 Jul 17, 2026
1.47.0 Jul 10, 2026
1.46.0 Jul 08, 2026
1.45.0 Jun 25, 2026
1.44.0 Jun 16, 2026
1.43.0 Jun 12, 2026
1.42.0 Jun 01, 2026
1.41.0 May 21, 2026
1.40.0 May 14, 2026
1.39.0 May 08, 2026
1.38.0 Apr 30, 2026
1.37.0 Apr 22, 2026
1.36.0 Apr 17, 2026
1.35.0 Apr 08, 2026
1.34.1 Apr 01, 2026
1.34.0 Mar 31, 2026
1.33.0 Mar 24, 2026
1.32.0 Mar 20, 2026
1.31.0 Mar 19, 2026
1.30.0 Mar 11, 2026
1.29.0 Mar 04, 2026
1.28.0 Feb 25, 2026
1.27.0 Feb 19, 2026
1.26.0 Feb 11, 2026
1.25.0 Feb 05, 2026
1.24.0 Jan 29, 2026
1.23.0 Jan 21, 2026
1.22.0 Jan 13, 2026
1.21.0 Jan 02, 2026
1.20.0 Dec 15, 2025
1.19.0 Dec 03, 2025
1.18.0 Nov 21, 2025
1.17.0 Nov 18, 2025
1.16.0 Nov 12, 2025
1.15.0 Nov 04, 2025
1.14.0 Oct 29, 2025
1.13.0 Oct 17, 2025
1.12.0 Oct 10, 2025
1.11.0 Oct 08, 2025
1.10.0 Sep 29, 2025
1.9.1 Sep 19, 2025
1.9.0 Sep 17, 2025
1.8.0 Sep 10, 2025
1.7.1 Sep 05, 2025
1.7.0 Sep 02, 2025
1.6.0 Aug 26, 2025
1.5.0 Aug 19, 2025
1.4.0 Aug 08, 2025
1.3.0 Aug 04, 2025
1.2.0 Jul 30, 2025
1.1.0 Jul 24, 2025
1.0.1 Jul 18, 2025
1.0.0 Jul 15, 2025
0.3.0 Jul 11, 2025
0.2.1 Jul 04, 2025
0.2.0 Jul 02, 2025
0.1.9 Jun 24, 2025
0.1.8 Jun 18, 2025
0.1.7 Jun 09, 2025
0.1.6 May 30, 2025
0.1.5 May 26, 2025
0.1.4 May 23, 2025
0.1.3 May 21, 2025
0.1.2 May 18, 2025
0.1.1 May 17, 2025
0.1.0 May 16, 2025
0.0.1 May 14, 2025

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
boto3 (<2.0.0,>=1.26.0)
botocore (<2.0.0,>=1.29.0)
docstring-parser (<1.0,>=0.15)
httpx (<1.0.0,>=0.28.1)
jsonschema (<5.0.0,>=4.0.0)
mcp (<2.2,>=1.23.0)
opentelemetry-api (<2.0.0,>=1.30.0)
opentelemetry-instrumentation-threading (<1.00b0,>=0.51b0)
opentelemetry-sdk (<2.0.0,>=1.30.0)
pydantic (<3.0.0,>=2.4.0)
pyyaml (<7.0.0,>=6.0.0)
typing-extensions (<5.0.0,>=4.13.2)
watchdog (<7.0.0,>=6.0.0)