An AI agent development project leveraging Amazon Bedrock and the Strands Agents SDK.
This project demonstrates how to build various AI agents using the Strands Agents SDK. You can create simple yet powerful agents centered around three core components: a model, tools, and a prompt.
-
advanced_rag_utils.py: Advanced RAG (Retrieval-Augmented Generation) capabilities using AWS Bedrock
- Knowledge Base retrieval and generation
- Metadata filtering
- Bedrock client configuration
-
llm_cost_utils.py: LLM usage monitoring and cost calculation
- Bedrock token count tracking
- CloudWatch metrics integration
- Cost analysis
The Strands.ipynb notebook includes 10 practical use cases:
- Web Scraping: Extract article titles and links from Hacker News
- Stock Price Analysis: Moving averages, volatility, return rate analysis with visualizations
- Insurance Claims Inspection: Weather data validation and DynamoDB storage
- Knowledge Base + Internet Search: 10K document retrieval and news aggregation
- Custom Python Tools: LLM usage calculator
- DataFrame Manipulation: Data processing with pandas
- PySpark Data Processing: Large-scale data transformation and storage
- Machine Learning Pipeline: Customer churn prediction model
- Multi-Agent System: Financial advisory agent orchestration
- MCP Integration: AWS documentation querying and architecture diagram generation
pip install strands-agents strands-agents-tools strands-agents-builder nest_asyncio uv# For financial analysis
pip install yfinance matplotlib
# For web scraping
pip install beautifulsoup4 pandas requests
# For machine learning
pip install scikit-learn joblib seabornfrom strands import Agent
agent = Agent()
agent("Explain Amazon Bedrock Agents?")Extended Thinking (also called "interleaved thinking" in Claude 4) enables Claude to think more deeply when solving complex problems, providing transparent reasoning processes alongside final answers.
from strands import Agent
from strands.models.bedrock import BedrockModel
model = BedrockModel(
model_id="us.anthropic.claude-sonnet-4-20250514-v1:0",
additional_request_fields={
"anthropic_beta": ["interleaved-thinking-2025-05-14"],
"thinking": {"type": "enabled", "budget_tokens": 8000}
}
)
agent = Agent(model=model)
response = agent("What are the benefits of reasoning models?")The reasoning process is accessible via reasoningContent in the response blocks.
from strands_tools import python_repl, file_write
from strands import Agent
import os
os.environ["BYPASS_TOOL_CONSENT"] = "true"
agent = Agent(tools=[python_repl, file_write])
response = agent("Scrape data from a web page and save it as CSV")from strands import tool, Agent
@tool
def my_custom_tool(query: str) -> str:
"""Custom tool description"""
# Tool logic
return result
agent = Agent(tools=[my_custom_tool])Create a variables.json file in the project root to configure AWS settings:
{
"kbSemanticChunk": "your-knowledge-base-id",
"region": "us-west-2",
"account_number": "your-aws-account-number"
}- Amazon Bedrock models (Nova, Claude, Titan, etc.)
- Anthropic Claude model family
- Ollama (for local development)
- Other providers via LiteLLM
.
├── Strands.ipynb # Main demo notebook
├── research_agent_kb_internet.ipynb # Research agent example
├── advanced_rag_utils.py # RAG utility functions
├── llm_cost_utils.py # Cost calculation tools
├── kb_id.txt # Knowledge Base ID
├── strands.png # Project image
├── README.md # This file (English)
└── README-kr.md # Korean version
- Model-Driven Approach: Easy integration with various LLM models
- Rich Tool Ecosystem: 20+ pre-built tools and MCP server support
- Simple API: Build powerful agents with just a few lines of code
- Scalable: From local development to production deployment
- AWS Integration: Native integration with Bedrock, DynamoDB, CloudWatch, and more
- Strands Agents Official Documentation
- Amazon Bedrock Documentation
- Strands Agents Announcement Blog
- Advanced RAG using Bedrock and SageMaker - AWS Samples
This project is licensed under the MIT License - see the LICENSE file for details.
Issues and pull requests are welcome!
