Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NativeWeather-Agent 🧠🌤️

A framework-free, first-principles implementation of an autonomous real-time weather agent loop utilizing Groq and LLaMA 3.3-70B.

🚀 Architectural Value (Why this exists)

Most modern AI applications abstract away core reasoning loops inside heavy third-party orchestration wrappers like LangChain or LangGraph. While convenient, this often obscures the underlying mechanics of context logging and model interaction.

NativeWeather-Agent completely eliminates this abstraction layer. Built entirely from scratch using native Python dictionaries, standard requests pipelines, and native Groq tool-calling schemas, this repository serves as a portfolio piece proving deep understanding of state log manipulation, autonomous runtime loops, routing logic, and dynamic tool dependencies.

🛠️ Multi-Step Dependency Execution

The agent natively resolves complex, multi-turn tool dependency cycles. For example, when processing a query like: "What is the weather in Bathinda right now?", the agent executes a sequential workflow completely decoupled from hardcoded logic:

  1. Reasoning Step: Analyzes the query, recognizes a lack of real-time spatial knowledge, and schedules get_coordinates.
  2. Context Logging: Appends the assistant's tool-call intent into the persistent message state array.
  3. Dynamic Injection: Executes the native geocoding API request and pipes the resulting latitude/longitude outputs straight into a subsequent evaluation.
  4. Tool Transition: Automatically triggers get_weather with the freshly parsed coordinates.
  5. Synthesis: Grounds the finalized real-time meteorological vectors back into the LLM context window for a clean text summary.

🔒 Production Edge-Case Guardrails

  • Zero Abstraction Bloat: Built using lightweight, native python dictionaries and native JSON schemas, maximizing inference tracking speed.
  • Safe Attribute Reflection: Utilizes getattr(message, "tool_calls", None) validation to gracefully intercept terminal non-tool responses from the model, eliminating standard NoneType attribute crashes.
  • Environment Isolation: Securely decouples API credentials from the code path using python-dotenv.

📦 Tech Stack

  • Inference Model: LLaMA-3.3-70b-versatile (via Groq API)
  • Core Language: Python 3.10+
  • External APIs: Open-Meteo Geocoding & Weather Forecast Engines

🔧 Installation & Set Up

  1. Clone the repository:

    git clone [https://github.com/your-username/NativeWeather-Agent.git](https://github.com/your-username/NativeWeather-Agent.git)
    cd NativeWeather-Agent
    
  2. Install dependencies:

    pip install -r requirements.txt
  3. Set up your API key: Create a .env file in the root directory and add your Groq API key:

    GROQ_API_KEY=your_groq_api_key_here
    
  4. Run the agent:

    python agent.py

About

A framework-free, first-principles implementation of an autonomous multi-step weather agent loop utilizing Groq, LLaMA 3.3-70B, and Open-Meteo REST APIs. Demonstrates native tool routing and dynamic dependency injection without orchestration overhead.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages