Skip to content

A minimal, working proof-of-concept showing how to integrate Vanna AI’s conversational analytics API as a LangChain tool — alongside a second tool (OpenWeather) to demonstrate multi-tool agent routing.

Notifications You must be signed in to change notification settings

vanna-ai/langchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LangChain + Vanna AI (with Weather Tool)

A minimal proof-of-concept showing how to integrate Vanna AI — a natural language–to–SQL engine — into a LangChain 1.0 agent, alongside another tool (OpenWeather) to demonstrate multi-tool routing.


⚙️ Features

  • 🧩 Vanna Tool — Streams answers from Vanna’s /chat_sse endpoint
  • 🌤 Weather Tool — Uses OpenWeather API for real-time city forecasts
  • 🧠 LangChain Agent — Automatically decides which tool to call
  • 🔐 .env-based Config — No hard-coded API keys

🚀 Setup

To get started:

  1. Clone the repository

    git clone https://github.com/vanna-ai/langchain.git
    cd langchain
    
  2. Create and activate a virtual environment

    python3 -m venv venv
    source venv/bin/activate
    
  3. Install dependencies

    pip install -r requirements.txt
    
  4. Copy the example environment file and fill in your keys

    cp .env.example .env
    
  5. Run the agent

    python main.py
    

💬 Example Queries

Who is the largest customer, what are total sales?
What's the weather in Paris?

🔑 Environment Variables (.env.example)

OPENAI_API_KEY=your_openai_key
VANNA_API_KEY=your_vanna_key
VANNA_AGENT_ID=look-service-account
VANNA_USER_EMAIL=your_email_here
OPENWEATHER_KEY=your_openweather_key

📁 Repository Structure

.
├── main.py
├── requirements.txt
├── test_vanna_api.py
├── .env.example
├── .gitignore
└── README.md

👨‍💻 Author

Vanna AI
Description: Simple LangChain 1.0 agent integrating Vanna and external APIs.
🌐 https://vanna.ai


🧠 About Vanna

Vanna AI is a conversational analytics engine that connects to your databases and lets you ask business questions in natural language — returning SQL, charts, or dataframes as responses.


About

A minimal, working proof-of-concept showing how to integrate Vanna AI’s conversational analytics API as a LangChain tool — alongside a second tool (OpenWeather) to demonstrate multi-tool agent routing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages