A beginner-friendly (Level 100) hands-on workshop demonstrating how to build Agentic AI from scratch using pure Python and AWS SDKβno complex frameworks required. In just one hour, learn what makes AI "agentic" by creating an intelligent weather assistant that thinks, plans, acts, and responds autonomously.
Workshop Type: Hands-on, code-from-scratch approach Duration: ~1 hour Target Audience: Beginners to AI and AWS Prerequisites: Basic Python knowledge, AWS account Region: US West (Oregon) β
us-west-2
An AI agent using pure Python and AWS SDK that:
| Capability | Implementation |
|---|---|
| π§ Thinks | Interfaces with Claude 4.5 Sonnet through Amazon Bedrock API |
| π§ Acts | Makes HTTP requests to National Weather Service API using Python's subprocess |
| π Processes | Handles JSON data with native Python data structures |
| π¬ Responds | Communicates via command-line and Streamlit web interfaces |
The agent accepts multiple location formats:
- City names: "Seattle", "New York City"
- ZIP codes: "90210", "10001"
- Coordinates: "47.6062,-122.3321"
- Descriptions: "National park near Homestead in Florida"
- Reasoning queries: "Largest city in California"
- Points API β Converts location to NWS forecast office coordinates
- Forecast API β Retrieves detailed weather data for that grid
- Command-Line Interface (
weather_agent_cli.py) β Quick terminal-based queries - Web Application (
weather_agent_web.py) β Interactive Streamlit UI with real-time progress tracking
βββββββββββββββ
β User Input β β Location (city, ZIP, coordinates, descriptions)
ββββββββ¬βββββββ
β
βββββββββββββββββββββββ
β π§ Claude 4.5 Sonnetβ β AI analyzes location and plans API calls
β (Amazon Bedrock) β
ββββββββ¬βββββββββββββββ
β
ββββββββββββββββββββββββββββββββββββββ
β π Points API URL Generated β
β https://api.weather.gov/points/... β
ββββββββ¬ββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββ
β π Execute Points β β curl command to NWS
β API Call β
ββββββββ¬βββββββββββββββ
β
βββββββββββββββββββββββ
β π Points Response β β Extract forecast URL from JSON
ββββββββ¬βββββββββββββββ
β
βββββββββββββββββββββββ
β π€οΈ Execute Forecastβ β curl to gridpoints/SEW/124,67/forecast
β API Call β
ββββββββ¬βββββββββββββββ
β
βββββββββββββββββββββββ
β π Raw JSON Data β β Temperature, wind, conditions
ββββββββ¬βββββββββββββββ
β
βββββββββββββββββββββββ
β π§ Claude Processes β β Convert raw data to summary
β (Amazon Bedrock) β
ββββββββ¬βββββββββββββββ
β
βββββββββββββββββββββββ
β π¬ Human-Readable β β "Today: Partly cloudy, 72Β°F"
β Response β "Wind: West 5-10 mph"
βββββββββββββββββββββββ
| Characteristic | Implementation |
|---|---|
| π€ Autonomy | β’ Interprets location descriptions β’ Generates correct API URLs β’ Decides relevant weather info β’ Handles errors independently |
| β‘ Reactivity | β’ Adapts to city names, ZIP codes, coordinates β’ Processes varying API structures β’ Handles network issues β’ Works with incomplete data |
| π― Proactivity | β’ Plans complete API strategies β’ Takes initiative to call APIs β’ Analyzes weather insights β’ Presents user-friendly results |
def call_claude_sonnet(prompt):
"""Connect to Claude 4.5 Sonnet - the agent's 'brain'"""
bedrock = boto3.client(
service_name='bedrock-runtime',
region_name='us-west-2'
)
response = bedrock.converse(
modelId='us.anthropic.claude-sonnet-4-5-20250929-v1:0',
messages=[{
"role": "user",
"content": [{"text": prompt}]
}],
inferenceConfig={
"maxTokens": 2000,
"temperature": 0.7
}
)
return True, response['output']['message']['content'][0]['text']def execute_curl_command(url):
"""Agent's 'hands' - executes HTTP requests"""
result = subprocess.run(
['curl', '-s', url],
capture_output=True,
text=True,
timeout=30
)
return True, result.stdoutdef generate_weather_api_calls(location):
"""Agent's 'planning brain' - figures out right API calls"""
prompt = f"""
You are an expert at working with the National Weather Service API.
Generate the NWS Points API URL for "{location}".
Instructions:
1. Determine approximate lat/lon coordinates
2. Generate: https://api.weather.gov/points/{{lat}},{{lon}}
Return ONLY the complete Points API URL.
"""
success, response = call_claude_sonnet(prompt)
api_url = response.strip()
return True, [api_url]def process_weather_response(raw_json, location):
"""Agent's 'analysis brain' - makes sense of complex data"""
prompt = f"""
Convert this raw NWS forecast data for "{location}" into a
clear, helpful weather summary.
Raw Data: {raw_json}
Include: location intro, current conditions, 2-3 day outlook,
notable patterns/alerts. Format for easy reading.
"""
return call_claude_sonnet(prompt)- Python 3.7+
- AWS account with Bedrock access
- AWS CLI configured
-
Clone or download the project files
-
Create virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install boto3 streamlit requests Pillow- Configure AWS credentials:
aws configure
# Enter your AWS Access Key ID
# Enter your AWS Secret Access Key
# Default region: us-west-2- Enable Claude 4.5 Sonnet in Bedrock:
- Open Amazon Bedrock console
- Navigate to Model access
- Enable
Claude 4.5 Sonnet - Wait for "Access granted" status
python weather_agent_cli.pystreamlit run weather_agent_web.pyAccess at: http://localhost:8501
Try these example queries:
- "Seattle" (major city)
- "90210" (ZIP code)
- "New York City" (multi-word city)
- "National park near Homestead in Florida" (descriptive)
- "Largest City in California" (requires reasoning)
- Amazon Bedrock β Foundation model hosting (Claude 4.5 Sonnet)
- AWS IAM β Authentication and permissions
- boto3 β AWS SDK for Python
- Claude 4.5 Sonnet (
us.anthropic.claude-sonnet-4-5-20250929-v1:0)- Complex reasoning and planning
- Processing structured data
- Human-like responses
- National Weather Service API β Free, real-time US weather data
- Points API: Location to forecast office mapping
- Forecast API: Detailed weather forecasts
- Python 3.7+ β Core programming language
- Streamlit β Web interface framework
- subprocess β HTTP requests via curl
- json β Data processing
The project includes screenshots of:
-
Main Landing Page
- Dark-themed UI with location input field
- "Get Weather Forecast" button
- "Clear Results" button
- Example suggestions section
-
Weather Analysis Process
- 6-step process visualization with checkmarks
- Generated Points API URL display
- Expandable raw API responses
- Process status sidebar
- "What Makes This Agentic?" explanation
-
Final Weather Forecast Display
- Location and timestamp
- Current conditions
- 3-day detailed outlook with temperatures and precipitation chances
All screenshots are stored in the /images folder.
The agentic patterns learned in this project apply to:
- Forecast assistants with alerts
- Climate monitoring and predictions
- Disaster response coordination
- Trip planning with weather integration
- Route optimization
- Event management
- Market analysis with data gathering
- Customer support with knowledge bases
- Risk assessment
- Code assistants
- DevOps automation
- Documentation generation
By completing this workshop, I gained expertise in:
β Amazon Bedrock Integration β Connecting to Claude 4.5 Sonnet and handling API responses β API Integration Patterns β AI-driven URL generation and sequential API calls β Prompt Engineering β Structured prompts for specific tasks and output formatting β Agentic Workflow Design β Think β Plan β Act β Process β Respond pattern β JSON Data Processing β Extracting and transforming complex API responses β Error Handling β Building resilient systems with proper exception management β UI Development β Creating both CLI and web interfaces with Streamlit
- Add more APIs (international weather, air quality, traffic)
- Improve error handling with retry logic
- Add memory to store previous queries
- Enhance UI with weather maps and charts
- Multi-agent systems (weather + travel + events)
- Tool integration (calculators, databases, notifications)
- Conversation flow with context maintenance
- Production deployment (Lambda, ECS, EKS)
- Security & compliance (auth, encryption, audits)
- Performance optimization (caching, parallelization)
The Agentic AI Workflow:
Input β AI Planning β Action β AI Processing β Response
This pattern is reusable across countless domainsβfrom customer support to research automation to business intelligence. Anyone can build intelligent systems that reason, plan, and take meaningful actions in the real world.
Ramakrishna Natarajan Sr. Partner Solutions Architect, AWS
Ahmad Sultani π LinkedIn | π¦ X (Twitter) βοΈ AWS Solutions Architect Associate (SAA-C03) β In Progress π€ Specialization: Generative AI & Agentic Systems πΊ β AWS Tutorials & Tech Updates
MIT.
Welcome to the world of agentic AI! π