Product Recommender System
This project demonstrates a product recommender system built using:
- Backend: FastAPI (semantic search + Pinecone integration + GenAI & CV endpoints)
- Frontend: React (Vite) — interface for search, image upload, and generated descriptions
- Modeling: text+image embeddings, simple CV classifier (MLP / KNN), GenAI generator (Flan-T5)
- Vector DB: Pinecone (used for production-like vector storage; local file index also supported)
- Notebooks: Data Analytics + Model Training (with evaluations & comments)
Demonstration - ML based product Recommendation

Demonstration - CV based image search

Demonstration - GenAi based creative description

Quickstart (local dev)
Prereqs: Python 3.10+, Node 16+, Git
# cd to backend
cd backend
# create virtualenv (Windows PowerShell)
python -m venv .venv
.venv\Scripts\Activate.ps1
# install dependencies
pip install -r requirements.txt
# start dev server
uvicorn app.main:app --reload --host 127.0.0.1 --port 8000API endpoints : GET /health — healthcheck POST /recommend — query by text: {"prompt":"wooden chair","top_k":6} POST /search/image?top_k=5 — multipart upload file POST /gen/description — body: { "title":"...", "description":"...", "meta": {...} } GET /analytics/summary — dataset analytics
cd frontend
npm install
# set VITE_API_BASE in .env or export env var
npm run devBoth Attached
PINECONE_API_KEY= PINECONE_ENV= PINECONE_INDEX_NAME= USE_PINECONE=true VECTOR_DIM=512
fastapi>=0.95.0 uvicorn[standard]>=0.22.0 python-multipart>=0.0.6 pydantic>=1.10.7 numpy>=1.24.0 pandas>=2.0.0 requests>=2.28.0 pillow>=9.0.0 scikit-learn>=1.2.0 joblib>=1.2.0 pinecone-client>=5.1.0 transformers>=4.35.0 torch>=2.0.0 # if you are using CPU-only, this will still install CPU wheel; remove if you use separate model host tqdm>=4.65.0 ftfy>=6.1.1 safetensors>=0.3.0 accelerate>=0.20.0 typing-extensions>=4.5.0
Requirement Implementation
- Backend (FastAPI) REST API with endpoints for recommendations, image-based search, NLP-based grouping, analytics, and GenAI description generation
- Frontend (React + Vite) Clean UI with product cards, search bar, image upload, and description generator
- VectorDB (Pinecone) Stores product embeddings (CLIP-based) for semantic retrieval
- ML Models KNN + MLP models trained on product embeddings for similarity and classification
- NLP CLIP text encoder + HuggingFace Transformers for text embeddings and prompt understanding
- Computer Vision (CV) CLIP image encoder + KNN/MLP classifier for image-category mapping
- GenAI FLAN-T5 (via HuggingFace Transformers) for generating creative product design descriptions Integration Framework LangChain used for GenAI pipeline orchestration and embedding-based query flow
Backend
FastAPI — primary REST API framework Uvicorn — ASGI server LangChain — for GenAI orchestration (prompt templates + HuggingFaceHub integration) Hugging Face Transformers — for text & generative models (FLAN-T5, CLIP) scikit-learn — for KNN/MLP classifier and preprocessing PyTorch — backend for model inference Pinecone — VectorDB for semantic search NumPy / Pandas / Joblib — data utilities
Frontend
React + Vite — modern frontend setup Tailwind CSS — clean responsive UI shadcn/ui components — cards, buttons, routing Lucide React — icons
Data
Provided product dataset with fields: title, brand, description, price, categories, images, manufacturer, package dimensions, country_of_origin, material, color, uniq_id
Preprocessed embeddings are stored in Pinecone and also as local backup (app/data/index.npz).
⚙️ Architecture User → Frontend (React) ↕ REST API Backend (FastAPI) ├── /recommend (text-based recommendations) ├── /search/image (image similarity search) ├── /gen/description (creative GenAI descriptions) ├── /analytics/summary (dataset insights) ├── /cv/classify (optional CV product type classification) │ ├── Models: │ ├── CLIP encoder (text+image) │ ├── KNN for embeddings │ ├── MLP for image category prediction │ └── FLAN-T5 (Generative text) │ └── Vector Database: Pinecone → stores embeddings + metadata
