AWS Strands Agents
12 Bedrock, LangGraph, and async tool-calling agent patterns
👋 Hello World Agent ⓘ
Minimal single-turn Amazon Nova Lite agent invocation via the AWS Strands Agents SDK.
Send a prompt to a zero-tool Strands Agent(model=BedrockModel("amazon.nova-lite-v1:0")) and inspect its response.
🕸️ LangGraph ReAct Agent ⓘ
LangGraph create_react_agent with ChatBedrockConverse (Nova Lite) and a @tool greet(name) function.
Compare Strands with LangGraph's explicit StateGraph cycle as the agent calls greet(name) for each person and synthesizes a reply.
⚙️ Function-to-Tool Health Check ⓘ
@tool decorator reflection turning check_server_status(server_url: str) into a Bedrock tool schema.
Ask the agent to verify whether an HTTP endpoint is live; it executes a real requests.get() health check with a 5s timeout.
💳 Multi-Parameter Tip & Split Agent ⓘ
Multi-parameter @tool calculate_tip(bill_amount: float, tip_percentage: float = 15.0, num_people: int = 1).
Extracts typed numeric arguments and defaults from natural language to compute tip, total bill, and per-person split.
🏷️ Multi-Tool Sales Pipeline ⓘ
Sequential 3-tool chain: get_sales_data(quarter) → analyze_sales(revenue, deals, quarter) → send_email(to, subject, body).
Fetches quarterly sales metrics ($125,000 across 42 deals in Q4), computes average deal size, and emails a summary report.
📦 Custom Inventory Lookup Tool ⓘ
Domain-specific @tool check_inventory(product_id: str) querying an in-memory warehouse catalog.
Check stock status and unit counts for tracked catalog SKUs: PROD-123 (15 in stock), PROD-456 (out of stock), and PROD-789 (8 low stock).
🧮 Prebuilt Calculator Tool ⓘ
Off-the-shelf calculator tool from strands_tools paired with a math assistant system prompt.
Delegates exact exponentiation and arithmetic expressions to the prebuilt SymPy-backed calculator instead of token prediction.
🧰 Multi-Prebuilt Tools (HTTP + Calculator) ⓘ
Combining prebuilt http_request and calculator tools from strands_tools for live data analysis.
Fetches live JSON data from an external URL via http_request and pipes the extracted numbers into calculator.
☁️ Natural-Language AWS CLI (use_aws) ⓘ
Prebuilt use_aws tool from strands_tools translating natural language into live boto3 AWS SDK calls.
Inspect AWS resources (such as S3 buckets, EC2 instances, or DynamoDB tables) in us-west-2 using IAM credentials.
🏛️ Stateful Class-Based Inventory Tools ⓘ
InventoryTools class encapsulating shared self.inventory state across @tool check_stock and @tool update_stock methods.
Mutate and verify live stock counts for PROD-123 (15), PROD-456 (0), or PROD-789 (8) within a stateful class instance.
⚡ Async Parallel Warehouse Tools ⓘ
Non-blocking async def check_warehouse_inventory(product_id, warehouse) via agent.invoke_async().
Queries east (50 units), west (30 units), and central (75 units) warehouses concurrently (~2s parallel vs ~6s sequential).
🌍 Multi-Tool Travel Assistant Capstone ⓘ
4-tool coordinator combining get_weather_forecast, suggest_packing_list, estimate_trip_cost (INR), and prebuilt calculator.
Plan a trip to Goa, Bangalore, Jaipur, or Manali with weather forecasts, packing checklists, INR cost breakdowns, and budget validation.