Introduction
Strands Agents is an open-source SDK that simplifies the development of AI agents capable of using tools, making decisions, and automating workflows, moving far beyond basic chatbot interactions.
In this article, you will learn how to create a simple agent using Strands Agents SDK, add a custom tool to your agent, use a default model provider, and run the agent locally to automatically analyze IT support tickets and categorize them.
In this example, you'll build an AI agent that can.
- Read the incoming ticket content, for example: "I’m unable to connect to the VPN from home."
- Classify the ticket into categories like.
- Password Reset
- VPN Issue
- Billing Inquiry
- General IT Support
- Suggest the right team or next action, such as escalating to the network support team.
We’ll use the Strands Agents SDK to define this agent and register a custom Python function (called a "tool") for ticket classification. This example provides a practical approach to getting started with agent-based workflows and realizing immediate value from automating repetitive IT tasks.
Note. The default model provider is Amazon Bedrock, and the default model is Claude 3.7 Sonnet in the US Oregon (us-west-2) region.
Pre-requisites
- Install or update to the latest version of the AWS CLI.
- Get credentials to grant programmatic access.
- Visual Studio Code.
- Access to the Amazon Bedrock foundation model. The default model provider is Amazon Bedrock, and the default model is Claude 3.7 Sonnet in the US Oregon (us-west-2) region.
Create an agent using the Strands Agents SDK
Perform the following steps to create and configure an agent using Strands Agents SDK.
- Open Visual Studio Code.
- Navigate to the folder where you want to create your Python file.
- Open a new PowerShell terminal in Visual Studio Code.
- Run the following command to create a virtual environment to install the Strands Agents SDK and its dependencies.
python -m venv .venv
- Run the following command to activate the virtual environment.
.venv\Scripts\Activate.ps1
- Run the following command to install the strands-agents SDK package.
pip install strands-agents
- Create a new Python file and name it ticket_triage_agent.py.
- Copy and paste the below code into ticket_triage_agent.py.
from strands import Agent, tool
# Python function to define a custom tool using the @tool decorator
@tool
def classify_ticket(content: str) -> dict:
content = content.lower()
if "password" in content:
return {
"category": "Password Reset",
"team": "Service Desk Team"
}
elif "vpn" in content:
return {
"category": "VPN Issue",
"team": "Network Support Team"
}
elif "billing" in content or "invoice" in content:
return {
"category": "Billing Query",
"team": "Finance Support Team"
}
elif "email" in content:
return {
"category": "Email Access",
"team": "Messaging Support Team"
}
else:
return {
"category": "General IT Support",
"team": "General IT Team"
}
# Create an agent with custom classify_ticket tool
agent = Agent(tools=[classify_ticket])
# Ticket details
ticket = """
Hi team, I can't connect to the VPN while working remotely. Tried restarting my laptop and router but still no luck.
"""
# Ask the agent a question that uses the available tools
response = agent(f"""
Please read the ticket below and:
1. Classify the issue using available tools
2. Suggest which team should handle it
Ticket: {ticket}
""")
- Run the following command to execute your Python code.
python -u .\ticket_triage_agent.py
- Refer to the output below to see how the agent categorized the IT support ticket using the custom tool.
I'll help you analyze this ticket and determine the appropriate classification and team assignment.
First, let me classify the ticket using the available tool:
Tool #1: classify_ticket
Based on the classification results:
1. **Issue Classification**: VPN Issue
2. **Recommended Team Assignment**: Network Support Team
This is appropriate as the ticket clearly describes a VPN connectivity problem that persists despite basic troubleshooting steps (restarting laptop and router). The Network Support Team would have the expertise to diagnose and resolve VPN connection issues, which could involve checking VPN server status, user credentials, network configurations, or client software functionality.
Summary
This article walked you through the process of creating and configuring a simple agent using Strands Agents SDK.
Next Steps
- Integrate with real ticketing systems, such as Jira or ServiceNow, to automatically update or route tickets.
- Add sentiment analysis or priority detection to identify urgent tickets.
- Extend the agent with additional tools or workflows for more complex decision-making.
- Explore multi-agent setups supported by Strands Agents SDK for advanced use cases.