DEV Community

Arvindh
Arvindh

Posted on

πŸ’¬ Chat2Data – Ask Questions (Powered by Gemini + Streamlit)

I built a lightweight AI assistant using Gemini Pro and Streamlit that allows you to explore a global economic dataset using plain Englishβ€”no SQL required!

πŸ”§ What It Does

  • Converts natural language questions into SQL queries using Gemini
  • Runs the query on a local SQLite database
  • Returns real-time results as a DataFrame
  • Maintains a sidebar question history log for traceability

πŸ“Š Dataset

  • Global Economic Indicators (2010–2025)
  • Sourced from: Kaggle

πŸ’‘ Example Questions

  • Top 5 countries with highest GDP in 2020
  • Show inflation rate of India from 2015 to 2022
  • Compare public debt between United States and China

🧠 Tech Stack

  • 🐍 Python (3.10+)
  • 🎈 Streamlit for the web interface
  • πŸ—ƒοΈ SQLite for database
  • πŸ€– Google Generative AI (Gemini 1.5) for NL-to-SQL
  • πŸ“¦ Pandas for data processing

πŸ“Ž Try It Out

  • πŸ‘‰ Webapp: Chat2Data
  • πŸ‘‰ GitHub Repo: GitHub
  • πŸ”‘ Requires a free Gemini API key
  • πŸ§ͺ Contributions & feedback welcome!

Top comments (0)