Skip to content

The AI E-commerce Analytics Co-Pilot is a conversational data assistant that lets users query their e-commerce data using natural language. Powered by LLMs like Gemini or Phi-3, it intelligently translates questions into safe SQL queries, executes them on a local SQLite database, and returns results with charts and plain-English insights.

Notifications You must be signed in to change notification settings

Sri-Ganesan-M/AI_E-com_Analytics_Co-Pilot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 AI E-commerce Analytics Co-Pilot

Ask natural questions. Get real insights. Instantly.
Conversational Business Intelligence for your E-commerce data.

Live Demo LangChain LLM Database


App Screenshot or GIF Placeholder


🌐 Try It Live

Experience the AI E-commerce Co-Pilot in action:
👉 Click here to open the live demo


✨ What This App Does

AI E-commerce Analytics Co-Pilot is your intelligent data assistant. Built for business users and analysts, it lets you ask natural questions like:

“What was the click-through rate of my top 5 products last week?”

And instantly receive:

  • Clean tabular results
  • A visual chart
  • A plain-English explanation from the AI

All without writing a single SQL query.

This tool brings real-time insights to your fingertips by connecting LLMs to your structured e-commerce data.


🔍 Key Features

💬 Natural Language Interface

Ask questions in plain English. The system converts them into SQL, runs the query on your database, and returns rich, interactive results.

🧠 AI-Powered Query Engine

Built on LangChain, the agent uses either:

  • Google Gemini Pro API (in production)
  • Phi-3 via Ollama (locally)

...to generate SQL and explain results clearly.

🔄 Intelligent Routing

User input is classified into:

  • Queries (generate SQL)
  • Casual chat (friendly replies)
  • Off-topic input (graceful fallback)

This avoids unnecessary LLM calls and ensures a fast experience.

🛠 Self-Healing SQL Generation

If a generated query fails (e.g., bad column name), the agent automatically:

  • Analyzes the error
  • Fixes the query
  • Re-executes it

No need for user retries.

📊 Beautiful Visual Output

  • Auto-generated bar/line/pie charts using Chart.js
  • Full data tables with sorting
  • Optional CSV export

🔐 Security & Reliability

  • Only SELECT queries allowed — no mutations
  • Unsafe SQL is blocked at validation
  • Prompt is hard-coded with schema & rules
  • Metrics like RoAS use NULLIF to avoid crashes

🧱 Built With

Layer Technologies
Frontend React, TypeScript, Vite, Chart.js, Bootstrap, Lucide React
Backend FastAPI, Python, LangChain, SQLAlchemy, Pandas
LLM Options Phi-3 via Ollama (locally), Google Gemini API (deployed)
Database SQLite
Deployment Render, .env-based configuration

🛠 Architecture Diagram

App Screenshot or GIF Placeholder

About

The AI E-commerce Analytics Co-Pilot is a conversational data assistant that lets users query their e-commerce data using natural language. Powered by LLMs like Gemini or Phi-3, it intelligently translates questions into safe SQL queries, executes them on a local SQLite database, and returns results with charts and plain-English insights.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published