Skip to content

Mst-KrgZ/amazon-analytics-chatbot

Repository files navigation

🤖 Amazon Analytics Chatbot

RAG + SQL Powered Decision Support System for Amazon Seller Analytics


🚀 Business Impact

This project transforms raw Amazon Seller data into an AI-powered analytics assistant that enables fast, data-driven decision making.

  • 💬 Ask questions in natural language (no SQL required)
  • 📊 Retrieve insights directly from structured business data
  • ⚡ Combine database queries with AI-generated explanations
  • 🧠 Support operational and strategic decisions

👉 Goal: Make complex e-commerce analytics accessible through a chatbot interface


🎯 Use Case

This system is designed for:

  • 🛒 E-commerce Managers → analyze sales, performance, and trends
  • 📊 Data Analysts → speed up data exploration
  • 💰 Business Teams → access insights without technical knowledge

Example Queries

  • “Which products generated the highest revenue last month?”
  • “Show sales trends by country”
  • “Which categories are declining?”
  • “Top performing ASINs in the last 30 days”

👉 The system converts these into SQL + contextual answers automatically.


🧠 Project Overview

This project implements a Retrieval-Augmented Generation (RAG) pipeline combined with SQL-based querying.

It integrates:

  • Structured database queries (SQLite)
  • Vector search (FAISS)
  • Natural language understanding (LLM)
  • Business data sources (Amazon Seller data)

👉 Result: Hybrid AI system combining symbolic + semantic retrieval


🏗️ System Architecture

🔹 Indexing Pipeline (Offline)

  • Load CSV data sources
  • Convert to structured tables (SQLite)
  • Create document chunks
  • Generate embeddings (Sentence Transformers)
  • Store vectors in FAISS index

🔹 Retrieval Pipeline (Online)

  • User query (natural language)
  • Intent detection (SQL vs semantic search)
  • Retrieve relevant context
  • Execute SQL query (if needed)
  • Combine results with LLM
  • Generate final answer

⚙️ Features

  • 💬 Natural language query interface
  • 🧠 RAG-based context retrieval
  • 🗄️ SQL database integration (SQLite)
  • 🔎 Vector search with FAISS
  • 📊 Structured + unstructured data support
  • ⚡ Hybrid reasoning (SQL + LLM)
  • 🧩 Modular pipeline (easy to extend)

🧬 Data Sources

The system uses multiple Amazon datasets:

  • 📁 Orders (time series revenue data)
  • 📊 Business Reports
  • 📢 Advertising reports
  • 🔍 Search term data

⚠️ Note: Data is partially masked / synthetic for portfolio purposes.


🧪 Core Technologies

  • Python
  • Streamlit
  • SQLite
  • FAISS
  • Sentence Transformers
  • Pandas / NumPy
  • Local LLM (via Ollama or API)

📊 Example Workflow

  1. User asks: → “Show revenue trend for last 3 months”

  2. System:

    • detects analytical intent
    • generates SQL query
    • retrieves data
    • enriches with LLM explanation
  3. Output:

    • structured data result
    • human-readable insight

🛠️ Installation

git clone https://github.com/Mst-KrgZ/amazon-analytics-chatbot.git
cd amazon-analytics-chatbot

pip install -r requirements.txt
streamlit run app.py

📦 Requirements

  • Python 3.11
  • Streamlit
  • Pandas / NumPy
  • FAISS
  • Sentence Transformers
  • SQLite
  • LLM backend (Ollama / API)

👨‍💻 Author

Mesut Karagöz Data Scientist

🔗 GitHub: https://github.com/Mst-KrgZ 🔗 LinkedIn: https://www.linkedin.com/in/mesut-karagöz-181733260/


⚡ Final Note

This project goes beyond a chatbot — it is a data-driven decision support system powered by AI and structured analytics.

About

RAG + SQL-based Amazon Seller Analytics Chatbot using Streamlit, SQLite, FAISS and local LLM integration for data-driven decision support.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages