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)