https://github.com/strands-agents/sdk-python
A model-driven approach to building AI agents in just a few lines of code.
https://github.com/strands-agents/sdk-python
agentic agentic-ai agents ai anthropic autonomous-agents bedrock genai litellm llama llm machine-learning mcp multi-agent-systems ollama openai opentelemetry python
Last synced: 4 months ago
JSON representation
A model-driven approach to building AI agents in just a few lines of code.
- Host: GitHub
- URL: https://github.com/strands-agents/sdk-python
- Owner: strands-agents
- License: apache-2.0
- Created: 2025-05-14T19:59:51.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-06-11T14:14:50.000Z (4 months ago)
- Last Synced: 2025-06-11T15:50:26.920Z (4 months ago)
- Topics: agentic, agentic-ai, agents, ai, anthropic, autonomous-agents, bedrock, genai, litellm, llama, llm, machine-learning, mcp, multi-agent-systems, ollama, openai, opentelemetry, python
- Language: Python
- Homepage: https://strandsagents.com
- Size: 242 KB
- Stars: 1,467
- Watchers: 24
- Forks: 129
- Open Issues: 69
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-repositories - strands-agents/sdk-python - A model-driven approach to building AI agents in just a few lines of code. (Python)
- awesome-ChatGPT-repositories - sdk-python - A model-driven approach to building AI agents in just a few lines of code. (Langchain)
- awesome-agents - Strands Agents SDK - driven approach to building AI agents in just a few lines of code.  (Frameworks)
README
Strands Agents
A model-driven approach to building AI agents in just a few lines of code.
Documentation
◆ Samples
◆ Python SDK
◆ Tools
◆ Agent Builder
◆ 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, LiteLLM, Llama, Ollama, OpenAI, 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
```bash
# Install Strands Agents
pip install strands-agents strands-agents-tools
``````python
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 3.7 Sonnet in the us-west-2 region. See the [Quickstart Guide](https://strandsagents.com/) for details on configuring other model providers.
## Installation
Ensure you have Python 3.10+ installed, then:
```bash
# 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:
```python
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?")
```### MCP Support
Seamlessly integrate Model Context Protocol (MCP) servers:
```python
from strands import Agent
from strands.tools.mcp import MCPClient
from mcp import stdio_client, StdioServerParametersaws_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")
```### Multiple Model Providers
Support for various model providers:
```python
from strands import Agent
from strands.models import BedrockModel
from strands.models.ollama import OllamaModel
from strands.models.llamaapi import LlamaAPIModel# 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")# 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:
- [Amazon Bedrock](https://strandsagents.com/latest/user-guide/concepts/model-providers/amazon-bedrock/)
- [Anthropic](https://strandsagents.com/latest/user-guide/concepts/model-providers/anthropic/)
- [LiteLLM](https://strandsagents.com/latest/user-guide/concepts/model-providers/litellm/)
- [LlamaAPI](https://strandsagents.com/latest/user-guide/concepts/model-providers/llamaapi/)
- [Ollama](https://strandsagents.com/latest/user-guide/concepts/model-providers/ollama/)
- [OpenAI](https://strandsagents.com/latest/user-guide/concepts/model-providers/openai/)Custom providers can be implemented using [Custom Providers](https://strandsagents.com/latest/user-guide/concepts/model-providers/custom_model_provider/)
### Example tools
Strands offers an optional strands-agents-tools package with pre-built tools for quick experimentation:
```python
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](https://github.com/strands-agents/tools).
## Documentation
For detailed guidance & examples, explore our documentation:
- [User Guide](https://strandsagents.com/)
- [Quick Start Guide](https://strandsagents.com/latest/user-guide/quickstart/)
- [Agent Loop](https://strandsagents.com/latest/user-guide/concepts/agents/agent-loop/)
- [Examples](https://strandsagents.com/latest/examples/)
- [API Reference](https://strandsagents.com/latest/api-reference/agent/)
- [Production & Deployment Guide](https://strandsagents.com/latest/user-guide/deploy/operating-agents-in-production/)## Contributing ❤️
We welcome contributions! See our [Contributing Guide](CONTRIBUTING.md) for details on:
- Reporting bugs & features
- Development setup
- Contributing via Pull Requests
- Code of Conduct
- Reporting of security issues## License
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
## Security
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
## ⚠️ Preview Status
Strands Agents is currently in public preview. During this period:
- APIs may change as we refine the SDK
- We welcome feedback and contributions