Introducing Strands Agents, an Open Source AI Agents SDK — Suman Debnath, AWS

AI EngineerAbout 4 min readJun 27, 2025Watch original
THE SUMMARYAI-generated

Key Concepts

Strands SDK, agentic loop, tools, models, scaffolding, Langfuse, LightLM, Bedrock, MCP (Multi-Compute Protocol), manim, custom tools, default tools, system prompt, one-shot prompting.

Strands SDK Overview

Strands is an open-source SDK designed to simplify the creation of agents by minimizing scaffolding. The core idea is to leverage the increasing intelligence of models to handle reasoning, reducing the need for extensive prompts and system configurations. The SDK focuses on two primary components: models and tools, represented by the two strands in the logo. Strands integrates with third-party providers like Langfuse and LightLM, allowing the use of various models, including local models via llama.

Demo 1: File Processing and Speech

This demo illustrates how to create a Strands agent that reads a file, generates a summary, writes the summary to a local drive, and speaks the result.

Step-by-step process:

  1. Installation: Install strands-agent and strands-tool using pip.
    pip install strands-agent
    pip install strands-tool
    
  2. Import Strands: Import the strands library in your Python code.
    import strands
    
  3. Model Definition (Optional): Define the model to be used. By default, Strands uses Bedrock's cloud 3.7. You can specify a different model if desired.
    # Example of defining a model (not always necessary)
    model = "claude-3-opus-20240229" # Example Model ID
    
  4. System Prompt (Optional): A system prompt can be provided, but the agent is designed to work effectively without it.
    system_prompt = "You are a helpful assistant." # Example System Prompt
    
  5. Agent Creation and Task Execution: Provide the agent with a task, such as reading a file, summarizing it, writing it to a markdown file, and speaking the result.
    task = "Read chapter 10, summarize it, write it to a markdown file, and speak it out."
    response = agent.run(task)
    

Tools Used: The demo utilizes default tools provided by strands-tool for reading, writing, and speech generation, eliminating the need for custom tool creation.

Demo 2: MCP Integration for Video Generation with manim

This demo showcases the integration of Strands with an MCP server to generate videos using the manim library. manim is used for creating mathematical visualizations.

Step-by-step process:

  1. MCP Server Setup: Assume an MCP server is already set up and capable of generating videos using manim.
  2. Import Libraries: Import strands_agent and MCPClient.
    from strands_agent import StrandsAgent
    from fast_mcp import MCPClient
    
  3. Create MCP Client: Create an MCP client instance, providing the path to the MCP server.
    mcp_client = MCPClient(server_path="path/to/mcp/server")
    
  4. Agent Creation with MCP Tools: Create a Strands agent, specifying the MCP client as the tool. This broadcasts all tools available on the MCP server to the Strands agent.
    agent = StrandsAgent(tools=mcp_client.list_tools_sync())
    
  5. Prompting for Video Generation: Provide a prompt to the agent, instructing it to create a visualization. For example:
    prompt = "Create a visualization for the cubic equation within the range of x=-3 to x=3."
    video = agent.run(prompt)
    

Key Points:

  • No explicit system prompt or scaffolding is required. The model is expected to reason and generate the video based on the prompt.
  • The duration and other parameters of the video can be defined.

Custom Tool Creation

Strands allows the creation of custom tools by decorating a Python function with @tool. This makes the function accessible to the Strands agent as a tool.

Example:

from strands.tools import tool

@tool
def retrieve_from_quadrant(query: str) -> str:
    """Retrieves information from a quadrant database."""
    # Implementation details here
    return "Information from quadrant"

Once decorated, retrieve_from_quadrant becomes a tool that can be used by the Strands agent.

MCP Server Code Snippet

The MCP server code involves importing fast_mcp and defining tools using the @mcp_tool decorator.

from fast_mcp import mcp_tool, run_mcp_server

@mcp_tool
def generate_manim_video(equation: str, x_min: float, x_max: float) -> str:
    """Generates a video visualization of a given equation using manim."""
    # manim code execution logic here
    return "path/to/generated/video.mp4"

## Run the MCP server
run_mcp_server(tools=[generate_manim_video])

Resources

  • GitHub Repository: [Strands GitHub Link] (Hypothetical)
  • Documentation: strandsagent.com (Hypothetical)
  • Launch Blog: [Launch Blog Link] (Hypothetical)

Synthesis/Conclusion

Strands SDK offers a streamlined approach to building agents by minimizing scaffolding and leveraging the reasoning capabilities of modern models. By focusing on models and tools, Strands simplifies agent creation and allows for seamless integration with third-party services and custom functionalities. The demos highlight the ease of use and flexibility of Strands in various applications, from simple file processing to complex video generation using MCP and manim. The ability to create custom tools further enhances the adaptability of Strands to specific use cases.

AI summaries can miss context or contain errors. Check important details against the original video.

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.