
weather distance ai agent
weather-distance ai agent using strands-agents
Repository Info
About This Server
weather-distance ai agent using strands-agents
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Weather and Distance from Giza Agent
This is an AI agent built with Strands MCP that can:
- Get the current weather for any city
- Calculate the distance between any city and Giza, Egypt (location of the Great Pyramids)
Setup
-
Install the required packages:
pip install -r requirements.txt -
Install Ollama and download the Llama 3.2 model (optional, for AI-powered responses):
# Install Ollama from https://ollama.com/ # Start the Ollama server ollama serve # In another terminal, pull the Llama 3.2 model ollama pull llama3.2:latest -
Run the agent:
python weather_distance_agent.py
Usage
Once the agent is running, you can ask questions like:
- "What's the weather in Tokyo?"
- "How far is New York from Giza?"
- "Tell me the weather in Paris and how far it is from the pyramids"
Type 'exit' to quit the application.
How It Works
The agent uses:
- Strands Agents SDK for the AI agent framework
- Llama 3.2 model running locally through Ollama for natural language understanding (optional)
- wttr.in API for weather data (no API key required)
- Geopy for geocoding and distance calculations
Geocoding
The agent uses Geopy's Nominatim geocoder to find the coordinates of any city in the world. This allows it to calculate the distance between any city and Giza, Egypt, without relying on a pre-defined list of coordinates.
Fallback Mode
If Ollama is not running or the Llama 3.2 model is not available, the agent will automatically fall back to a rule-based mode that doesn't require an AI model. This ensures the agent can always provide weather and distance information.
Requirements
- Python 3.8+
- Geopy for geocoding and distance calculations
- Ollama installed with Llama 3.2 model (optional, for AI-powered responses)
- Internet connection for weather data and geocoding
Quick Start
Clone the repository
git clone https://github.com/fahmydiab/weather-distance-ai-agentInstall dependencies
cd weather-distance-ai-agent
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.