Skip to content

hellypatell/AI-Financial-Data-Engineer-Chat

Repository files navigation

💬 AI Financial Data Chat

An AI-powered web application that allows users to query financial data using natural language and get results directly from a SQL Server database with charts and KPIs.


🚀 Features

  • 🧠 Natural Language → SQL conversion
  • 🗄️ SQL Server (SSMS) integration
  • 📊 Interactive charts (Bar, Pie, Line)
  • 📈 KPI dashboard (Total Rows, Max, Min)
  • 📥 CSV export
  • ⚡ Works without AI using fallback queries
  • 🔐 SQL validation (only SELECT queries allowed)

🛠️ Tech Stack

  • Frontend: HTML, CSS, JavaScript
  • Backend: Python (Flask)
  • Database: SQL Server (SSMS)
  • Libraries: Pandas, PyODBC
  • Visualization: Chart.js
  • AI (Optional): Gemini API

🔄 How It Works

  1. User enters a question in plain English
  2. System converts it into an SQL query
  3. SQL is validated to allow only safe operations
  4. Query runs on SQL Server database
  5. Results are displayed as:
    • Table
    • Charts
    • KPI cards

📌 Example Queries

  • show top 10 records
  • count by sentiment
  • show company and sentiment
  • top companies by news count
  • sector wise sentiment count

📂 Project Structure

AI-Financial-Data-Engineer-Chat/ │ ├── app.py ├── ai_to_sql.py ├── db_connect.py ├── validator.py ├── requirements.txt │ ├── templates/ │ └── index.html │ ├── static/ │ ├── style.css │ └── script.js


🧠 Data Engineering Workflow

  1. Collected financial news dataset from Kaggle
  2. Loaded raw data into staging tables
  3. Cleaned and transformed data (null handling, formatting, type conversion)
  4. Created dimension tables:
    • DimCompany
    • DimDate
    • DimSentiment
    • DimSource
    • DimSector
    • DimImpactLevel
    • DimMarketEvent
  5. Loaded fact table:
    • FactNewsImpact
  6. Connected database with Flask application
  7. Visualized results using charts and KPI dashboard

About

AI-powered financial data chat application that converts natural language into SQL queries and visualizes results using charts and KPIs.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages