Daily Python Projects

Daily Python Projects

Build a Weather AI Assistant with LangChain 1.0

Level: Real World

Ardit Sulce's avatar
Ardit Sulce
Oct 30, 2025
∙ Paid

Today, we will use the new LangChain 1.0 version that released this October. It is a major improvement to the previous 0.3.27 version.

Your task for today is to build a command-line Weather Assistant agent using LangChain + Google Gemini that can answer weather queries and call a simple (weather) tool to fetch simulated weather data. The weather tool calling follows the standard LLM tool calling approach.

Project Task

Create a Weather Assistant that:

  • Uses langchain-google-genai to chat with a Gemini model

  • Registers a get_weather(city: str) -> str tool

  • Uses langgraph memory checkpointer for conversation threads

  • Loads API keys via .env using python-dotenv

  • Runs an interactive CLI loop until the user types quit

  • Returns friendly, concise bot responses

This project gives you hands-on practice with LangChain tools, agent creation, environment variables, and building a simple conversational loop.

Expected Output

☁️ WEATHER BOT (Type ‘quit’ to exit)

You: What’s the weather in Tokyo?
Bot: 🌤️ Weather in Tokyo: Sunny, 22°C, 45% humidity

You: what about paris
Bot: 🌤️ Weather in paris: Partly cloudy, 18°C, 55% humidity

You: quit

🔧 Setup

Environment variables (create a .env file), get a Gemini API key from here and place this line in the .env file:

GOOGLE_API_KEY=YOUR_KEY_HERE

Install dependencies:

pip install langchain langchain-google-genai langgraph python-dotenv

Join the Python & AI Builders Skool Community

Got questions to ask the author about this project? Join our Python & AI Builders community for weekly Python & AI videos and discussions:

skool.com/automateit

💻 View This Project in Jupyter Notebook

Become a premium member to access the working code in a Jupyter Notebook with the ready-to-run solution to get the output instantly and extend the code as you wish.

Click below to access the notebook (7-day risk-free trial):

Keep reading with a 7-day free trial

Subscribe to Daily Python Projects to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Ardit Sulce
Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture