{"id":28463829,"url":"https://github.com/strands-agents/sdk-python","last_synced_at":"2026-03-04T23:03:29.234Z","repository":{"id":293711832,"uuid":"983715534","full_name":"strands-agents/sdk-python","owner":"strands-agents","description":"A model-driven approach to building AI agents in just a few lines of code.","archived":false,"fork":false,"pushed_at":"2026-01-16T18:48:51.000Z","size":2663,"stargazers_count":4891,"open_issues_count":338,"forks_count":601,"subscribers_count":49,"default_branch":"main","last_synced_at":"2026-01-17T04:43:27.542Z","etag":null,"topics":["agentic","agentic-ai","agents","ai","anthropic","autonomous-agents","bedrock","genai","litellm","llama","llm","machine-learning","mcp","multi-agent-systems","ollama","openai","opentelemetry","python","strands-agents"],"latest_commit_sha":null,"homepage":"https://strandsagents.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/strands-agents.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-05-14T19:59:51.000Z","updated_at":"2026-01-17T02:09:11.000Z","dependencies_parsed_at":"2025-12-18T03:08:25.329Z","dependency_job_id":null,"html_url":"https://github.com/strands-agents/sdk-python","commit_stats":null,"previous_names":["strands-agents/sdk-python"],"tags_count":39,"template":false,"template_full_name":"amazon-archives/__template_Apache-2.0","purl":"pkg:github/strands-agents/sdk-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strands-agents%2Fsdk-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strands-agents%2Fsdk-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strands-agents%2Fsdk-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strands-agents%2Fsdk-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strands-agents","download_url":"https://codeload.github.com/strands-agents/sdk-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strands-agents%2Fsdk-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28644715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T21:29:11.980Z","status":"ssl_error","status_checked_at":"2026-01-21T21:24:31.872Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic","agentic-ai","agents","ai","anthropic","autonomous-agents","bedrock","genai","litellm","llama","llm","machine-learning","mcp","multi-agent-systems","ollama","openai","opentelemetry","python","strands-agents"],"created_at":"2025-06-07T05:01:13.763Z","updated_at":"2026-03-04T23:03:29.222Z","avatar_url":"https://github.com/strands-agents.png","language":"Python","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cdiv\u003e\n    \u003ca href=\"https://strandsagents.com\"\u003e\n      \u003cimg src=\"https://strandsagents.com/latest/assets/logo-github.svg\" alt=\"Strands Agents\" width=\"55px\" height=\"105px\"\u003e\n    \u003c/a\u003e\n  \u003c/div\u003e\n\n  \u003ch1\u003e\n    Strands Agents\n  \u003c/h1\u003e\n\n  \u003ch2\u003e\n    A model-driven approach to building AI agents in just a few lines of code.\n  \u003c/h2\u003e\n\n  \u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://github.com/strands-agents/sdk-python/graphs/commit-activity\"\u003e\u003cimg alt=\"GitHub commit activity\" src=\"https://img.shields.io/github/commit-activity/m/strands-agents/sdk-python\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/strands-agents/sdk-python/issues\"\u003e\u003cimg alt=\"GitHub open issues\" src=\"https://img.shields.io/github/issues/strands-agents/sdk-python\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/strands-agents/sdk-python/pulls\"\u003e\u003cimg alt=\"GitHub open pull requests\" src=\"https://img.shields.io/github/issues-pr/strands-agents/sdk-python\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/strands-agents/sdk-python/blob/main/LICENSE\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/strands-agents/sdk-python\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/strands-agents/\"\u003e\u003cimg alt=\"PyPI version\" src=\"https://img.shields.io/pypi/v/strands-agents\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://python.org\"\u003e\u003cimg alt=\"Python versions\" src=\"https://img.shields.io/pypi/pyversions/strands-agents\"/\u003e\u003c/a\u003e\n  \u003c/div\u003e\n  \n  \u003cp\u003e\n    \u003ca href=\"https://strandsagents.com/\"\u003eDocumentation\u003c/a\u003e\n    ◆ \u003ca href=\"https://github.com/strands-agents/samples\"\u003eSamples\u003c/a\u003e\n    ◆ \u003ca href=\"https://github.com/strands-agents/sdk-python\"\u003ePython SDK\u003c/a\u003e\n    ◆ \u003ca href=\"https://github.com/strands-agents/tools\"\u003eTools\u003c/a\u003e\n    ◆ \u003ca href=\"https://github.com/strands-agents/agent-builder\"\u003eAgent Builder\u003c/a\u003e\n    ◆ \u003ca href=\"https://github.com/strands-agents/mcp-server\"\u003eMCP Server\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\nStrands 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.\n\n## Feature Overview\n\n- **Lightweight \u0026 Flexible**: Simple agent loop that just works and is fully customizable\n- **Model Agnostic**: Support for Amazon Bedrock, Anthropic, Gemini, LiteLLM, Llama, Ollama, OpenAI, Writer, and custom providers\n- **Advanced Capabilities**: Multi-agent systems, autonomous agents, and streaming support\n- **Built-in MCP**: Native support for Model Context Protocol (MCP) servers, enabling access to thousands of pre-built tools\n\n## Quick Start\n\n```bash\n# Install Strands Agents\npip install strands-agents strands-agents-tools\n```\n\n```python\nfrom strands import Agent\nfrom strands_tools import calculator\nagent = Agent(tools=[calculator])\nagent(\"What is the square root of 1764\")\n```\n\n\u003e **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](https://strandsagents.com/) for details on configuring other model providers.\n\n## Installation\n\nEnsure you have Python 3.10+ installed, then:\n\n```bash\n# Create and activate virtual environment\npython -m venv .venv\nsource .venv/bin/activate  # On Windows use: .venv\\Scripts\\activate\n\n# Install Strands and tools\npip install strands-agents strands-agents-tools\n```\n\n## Features at a Glance\n\n### Python-Based Tools\n\nEasily build tools using Python decorators:\n\n```python\nfrom strands import Agent, tool\n\n@tool\ndef word_count(text: str) -\u003e int:\n    \"\"\"Count words in text.\n\n    This docstring is used by the LLM to understand the tool's purpose.\n    \"\"\"\n    return len(text.split())\n\nagent = Agent(tools=[word_count])\nresponse = agent(\"How many words are in this sentence?\")\n```\n\n**Hot Reloading from Directory:**\nEnable automatic tool loading and reloading from the `./tools/` directory:\n\n```python\nfrom strands import Agent\n\n# Agent will watch ./tools/ directory for changes\nagent = Agent(load_tools_from_directory=True)\nresponse = agent(\"Use any tools you find in the tools directory\")\n```\n\n### MCP Support\n\nSeamlessly integrate Model Context Protocol (MCP) servers:\n\n```python\nfrom strands import Agent\nfrom strands.tools.mcp import MCPClient\nfrom mcp import stdio_client, StdioServerParameters\n\naws_docs_client = MCPClient(\n    lambda: stdio_client(StdioServerParameters(command=\"uvx\", args=[\"awslabs.aws-documentation-mcp-server@latest\"]))\n)\n\nwith aws_docs_client:\n   agent = Agent(tools=aws_docs_client.list_tools_sync())\n   response = agent(\"Tell me about Amazon Bedrock and how to use it with Python\")\n```\n\n### Multiple Model Providers\n\nSupport for various model providers:\n\n```python\nfrom strands import Agent\nfrom strands.models import BedrockModel\nfrom strands.models.ollama import OllamaModel\nfrom strands.models.llamaapi import LlamaAPIModel\nfrom strands.models.gemini import GeminiModel\nfrom strands.models.llamacpp import LlamaCppModel\n\n# Bedrock\nbedrock_model = BedrockModel(\n  model_id=\"us.amazon.nova-pro-v1:0\",\n  temperature=0.3,\n  streaming=True, # Enable/disable streaming\n)\nagent = Agent(model=bedrock_model)\nagent(\"Tell me about Agentic AI\")\n\n# Google Gemini\ngemini_model = GeminiModel(\n  client_args={\n    \"api_key\": \"your_gemini_api_key\",\n  },\n  model_id=\"gemini-2.5-flash\",\n  params={\"temperature\": 0.7}\n)\nagent = Agent(model=gemini_model)\nagent(\"Tell me about Agentic AI\")\n\n# Ollama\nollama_model = OllamaModel(\n  host=\"http://localhost:11434\",\n  model_id=\"llama3\"\n)\nagent = Agent(model=ollama_model)\nagent(\"Tell me about Agentic AI\")\n\n# Llama API\nllama_model = LlamaAPIModel(\n    model_id=\"Llama-4-Maverick-17B-128E-Instruct-FP8\",\n)\nagent = Agent(model=llama_model)\nresponse = agent(\"Tell me about Agentic AI\")\n```\n\nBuilt-in providers:\n - [Amazon Bedrock](https://strandsagents.com/latest/user-guide/concepts/model-providers/amazon-bedrock/)\n - [Anthropic](https://strandsagents.com/latest/user-guide/concepts/model-providers/anthropic/)\n - [Gemini](https://strandsagents.com/latest/user-guide/concepts/model-providers/gemini/)\n - [Cohere](https://strandsagents.com/latest/user-guide/concepts/model-providers/cohere/)\n - [LiteLLM](https://strandsagents.com/latest/user-guide/concepts/model-providers/litellm/)\n - [llama.cpp](https://strandsagents.com/latest/user-guide/concepts/model-providers/llamacpp/)\n - [LlamaAPI](https://strandsagents.com/latest/user-guide/concepts/model-providers/llamaapi/)\n - [MistralAI](https://strandsagents.com/latest/user-guide/concepts/model-providers/mistral/)\n - [Ollama](https://strandsagents.com/latest/user-guide/concepts/model-providers/ollama/)\n - [OpenAI](https://strandsagents.com/latest/user-guide/concepts/model-providers/openai/)\n - [OpenAI Responses API](https://strandsagents.com/latest/user-guide/concepts/model-providers/openai/)\n - [SageMaker](https://strandsagents.com/latest/user-guide/concepts/model-providers/sagemaker/)\n - [Writer](https://strandsagents.com/latest/user-guide/concepts/model-providers/writer/)\n\nCustom providers can be implemented using [Custom Providers](https://strandsagents.com/latest/user-guide/concepts/model-providers/custom_model_provider/)\n\n### Example tools\n\nStrands offers an optional strands-agents-tools package with pre-built tools for quick experimentation:\n\n```python\nfrom strands import Agent\nfrom strands_tools import calculator\nagent = Agent(tools=[calculator])\nagent(\"What is the square root of 1764\")\n```\n\nIt's also available on GitHub via [strands-agents/tools](https://github.com/strands-agents/tools).\n\n### Bidirectional Streaming\n\n\u003e **⚠️ 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.\n\nBuild 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](https://strandsagents.com/latest/documentation/docs/user-guide/concepts/experimental/bidirectional-streaming/quickstart) guide. \n\n**Supported Model Providers:**\n- Amazon Nova Sonic (v1, v2)\n- Google Gemini Live\n- OpenAI Realtime API\n\n**Installation:**\n\n```bash\n# Server-side only (no audio I/O dependencies)\npip install strands-agents[bidi]\n\n# With audio I/O support (includes PyAudio dependency)\npip install strands-agents[bidi,bidi-io]\n```\n\n**Quick Example:**\n\n```python\nimport asyncio\nfrom strands.experimental.bidi import BidiAgent\nfrom strands.experimental.bidi.models import BidiNovaSonicModel\nfrom strands.experimental.bidi.io import BidiAudioIO, BidiTextIO\nfrom strands.experimental.bidi.tools import stop_conversation\nfrom strands_tools import calculator\n\nasync def main():\n    # Create bidirectional agent with Nova Sonic v2\n    model = BidiNovaSonicModel()\n    agent = BidiAgent(model=model, tools=[calculator, stop_conversation])\n\n    # Setup audio and text I/O (requires bidi-io extra)\n    audio_io = BidiAudioIO()\n    text_io = BidiTextIO()\n\n    # Run with real-time audio streaming\n    # Say \"stop conversation\" to gracefully end the conversation\n    await agent.run(\n        inputs=[audio_io.input()],\n        outputs=[audio_io.output(), text_io.output()]\n    )\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n\u003e **Note**: `BidiAudioIO` and `BidiTextIO` require the `bidi-io` extra. 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 handlers using the `BidiInput` and `BidiOutput` protocols.\n\n**Configuration Options:**\n\n```python\nfrom strands.experimental.bidi.models import BidiNovaSonicModel\n\n# Configure audio settings and turn detection (v2 only)\nmodel = BidiNovaSonicModel(\n    provider_config={\n        \"audio\": {\n            \"input_rate\": 16000,\n            \"output_rate\": 16000,\n            \"voice\": \"matthew\"\n        },\n        \"turn_detection\": {\n            \"endpointingSensitivity\": \"MEDIUM\"  # HIGH, MEDIUM, or LOW\n        },\n        \"inference\": {\n            \"max_tokens\": 2048,\n            \"temperature\": 0.7\n        }\n    }\n)\n\n# Configure I/O devices\naudio_io = BidiAudioIO(\n    input_device_index=0,  # Specific microphone\n    output_device_index=1,  # Specific speaker\n    input_buffer_size=10,\n    output_buffer_size=10\n)\n\n# Text input mode (type messages instead of speaking)\ntext_io = BidiTextIO()\nawait agent.run(\n    inputs=[text_io.input()],  # Use text input\n    outputs=[audio_io.output(), text_io.output()]\n)\n\n# Multi-modal: Both audio and text input\nawait agent.run(\n    inputs=[audio_io.input(), text_io.input()],  # Speak OR type\n    outputs=[audio_io.output(), text_io.output()]\n)\n```\n\n## Documentation\n\nFor detailed guidance \u0026 examples, explore our documentation:\n\n- [User Guide](https://strandsagents.com/)\n- [Quick Start Guide](https://strandsagents.com/latest/user-guide/quickstart/)\n- [Agent Loop](https://strandsagents.com/latest/user-guide/concepts/agents/agent-loop/)\n- [Examples](https://strandsagents.com/latest/examples/)\n- [API Reference](https://strandsagents.com/latest/api-reference/agent/)\n- [Production \u0026 Deployment Guide](https://strandsagents.com/latest/user-guide/deploy/operating-agents-in-production/)\n\n## Contributing ❤️\n\nWe welcome contributions! See our [Contributing Guide](CONTRIBUTING.md) for details on:\n- Reporting bugs \u0026 features\n- Development setup\n- Contributing via Pull Requests\n- Code of Conduct\n- Reporting of security issues\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n\n## Security\n\nSee [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.\n\n","funding_links":[],"categories":["🌟 Core Frameworks","Python","Agent SDK","📚 Projects (1974 total)","Langchain","Frameworks","🧱 Agent Frameworks","Building","Official Resources","Agent Integration \u0026 Deployment Tools","MCP Frameworks and libraries","Tools and Code","A01_文本生成_文本对话"],"sub_categories":["3. ** [Effective harnesses for long-running agents](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents)**","MCP Servers","Multi-Agent Orchestration","Frameworks","For PyPI Packages","AI Agent Orchestration","Python","Agent Frameworks","大语言对话模型及数据"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrands-agents%2Fsdk-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrands-agents%2Fsdk-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrands-agents%2Fsdk-python/lists"}