Documentation ◆ Samples ◆ Python SDK ◆ Tools ◆ Agent Builder ◆ MCP Server
Welcome to the Strands Agents Samples repository!
Explore easy-to-use examples to get started with Strands Agents.
The examples in this repository are for demonstration and educational purposes only. They demonstrate concepts and techniques but are not intended for direct use in production. Always apply proper security and testing procedures before using in production environments.
pip install strands-agents
pip install strands-agents-tools
Follow the instructions here to configure your model provider and model access.
from strands import Agent, tool
from strands_tools import calculator, current_time, python_repl
@tool
def letter_counter(word: str, letter: str) -> int:
"""
Count the occurrences of a specific letter in a word.
"""
if not isinstance(word, str) or not isinstance(letter, str):
return 0
if len(letter) != 1:
raise ValueError("The 'letter' parameter must be a single character")
return word.lower().count(letter.lower())
agent = Agent(tools=[calculator, current_time, python_repl, letter_counter])
message = """
I have 4 requests:
1. What is the time right now?
2. Calculate 3111696 / 74088
3. Tell me how many letter R's are in the word "strawberry" 🍓
4. Output a script that does what we just spoke about!
Use your python tools to confirm that the script works before outputting it
"""
agent(message)
Start with the 01-getting-started directory. Create your first agent and explore notebook-based examples covering core functionalities.
Looking for inspiration? Check out more examples in the 02-samples folder for real-world use cases.
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
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
See CONTRIBUTING for more information.
Strands Agents is currently in public preview. During this period:
- APIs may change as we refine the SDK
- We welcome feedback and contributions