Bharath2769/AI-Powered-Conversational-Commerce-Platform
๐๏ธ AI-Powered Conversational Commerce Platform
Hybrid Recommendation Engine & RAG-Powered AI Shopping Assistant with Real-Time Analytics
๐ Live Demo
- Live Application (Hugging Face Spaces): AI-Powered Conversational Commerce Platform
- Demo Login Credentials:
- Email:
john.doe@example.com - Password:
password123
(Note: The Hugging Face Space serves both the React Frontend and the FastAPI Backend natively from a single unified Docker container!)
๐ Overview
The AI-Powered Conversational Commerce Platform is a full-stack, enterprise-grade e-commerce engine that blends traditional recommendation algorithms with modern Generative AI. It solves the classic e-commerce discovery problem by offering both dynamic product grids based on user interactions and a Retrieval-Augmented Generation (RAG) Chat Assistant that users can talk to naturally.
Why it Exists:
Standard e-commerce systems struggle with the cold-start problem (handling new users) and rigid search bars. This system solves these issues by orchestrating a dynamic machine learning pipeline that shifts strategies in real-time, while offering a conversational AI assistant that understands complex queries (e.g., "I'm looking for a gaming laptop under $2000 with at least 16GB RAM").
๐๏ธ System Architecture
The application uses a decoupled but unified architecture. A React SPA (Single Page Application) serves as the presentation layer, communicating with a FastAPI backend API that handles ML execution, vector searches, and state preservation using a MongoDB database.
graph TD
A[React Client UI] <-->|HTTP / JSON| C[FastAPI Backend Application]
C <-->|CRUD & Auth| D[(MongoDB Atlas Cloud)]
C <-->|Generate Conversational Responses| LLM[Google Gemini 2.5 Flash]
subgraph Machine Learning Pipeline
C --> E[Hybrid ML Recommendation Engine]
E --> F[Popularity Recommender]
E --> G[Content-Based Recommender]
E --> H[Collaborative Filtering Recommender]
end
subgraph RAG Pipeline
C --> RAG[RAG Service]
RAG -->|Vector Search| VDB[(ChromaDB Vector Store)]
VDB <-->|Embeddings| ONNX[Local ONNX Model: all-MiniLM-L6-v2]
endEnd-to-End Sequence Flow (RAG Chat)
When a user asks the AI Assistant for a product:
- The user's query is sent to the FastAPI backend.
- ChromaDB embeds the query using a local ONNX model (
all-MiniLM-L6-v2) to bypass API rate limits and ensure lightning-fast vector search. - The top 10 semantically relevant products are retrieved from the vector database.
- The Hybrid ML Engine cross-references the retrieved products with the user's personal recommendation scores to re-rank the results.
- The final context is passed to Google's Gemini 2.5 Flash LLM.
- Gemini generates a conversational, personalized response explaining exactly why those products fit the user's needs.
โก Key Features
- ๐ฌ RAG-Powered AI Chat Assistant: Talk naturally to the store. Built with ChromaDB, local ONNX embeddings, and Gemini 2.5 Flash.
- ๐ง Multi-Strategy ML Pipeline: Native support for Popularity-based ranking, Content-based filtering, User-User Collaborative filtering, and SVD Matrix Factorization.
- โ๏ธ Adaptive Strategy Selection: Recommender engine automatically changes algorithms based on individual user interaction density (Views vs. Purchases).
- ๐ Product Analytics Dashboard: Interactive graphs displaying database counts and active model performance metrics.
- ๐ Secure Authentication: JWT-based login, signup, and protected routing.
- ๐จ State-of-the-Art UX: Modern dark-themed user interface styled with Tailwind CSS, featuring radial gauges, responsive product grids, and interactive search.
- ๐ณ Hugging Face Deployment: Fully dockerized to run as a unified service on Hugging Face Spaces (16GB RAM / 2 vCPU).
๐ง Recommendation Strategy
The machine learning engine dynamically orchestrates recommendation generation based on a user's interaction count. This ensures users are never shown empty recommendations, solving the classic cold-start problem.
๐ ๏ธ Tech Stack
๐จ Screenshots
1. Analytics & Model Performance Dashboard
2. Dashboard System Overview
3. Personalized User Recommendations
๐ Installation & Local Setup
Running with Docker (Quickest)
- Clone the repository:
git clone https://github.com/BharathReddyRamasani/AI-Powered-Conversational-Commerce-Platform.git
cd AI-Powered-Conversational-Commerce-Platform- Set up environment variables in
.env: MONGODB_URL: Your MongoDB Connection StringDB_NAME: Database nameSECRET_KEY: Random string for JWT tokensGEMINI_API_KEY: Your Google Gemini API Key- Build and run the unified Docker container:
docker build -t conversational-commerce .
docker run -p 7860:7860 --env-file .env conversational-commerce- Access the unified application:
- App:
http://localhost:7860 - API Docs:
http://localhost:7860/docs
๐ฎ Future Improvements
- [ ] Redis Cache Layer: Implement Redis caching for user recommendations to lower latency below 10ms.
- [ ] Streaming Chat Responses: Add server-sent events (SSE) to stream Gemini responses token-by-token.
- [ ] Real-Time Stream Processing: Utilize Kafka or RabbitMQ to stream user interactions directly to the ML models.
