Product submitted to Cognizant Kolkata through Digital Nurture TechnoVerse East Hackathon
Features โข Installation โข Tech Stack โข Usage โข Future Enhancements
- This project is an AI-powered conversational chatbot built for e-commerce platforms.
- It enables users to discover and explore fashion products through natural conversations instead of traditional keyword searches.
- By combining Natural Language Processing (NLP) with Vector Search (Qdrant), the chatbot delivers highly relevant and personalized product recommendations.
- The system is designed with a Flask backend, an interactive frontend UI, and integrates state-of-the-art LLaMA models (via Groq API and Hugging Face) for intelligent query understanding and recommendation.
- Conversational AI Assistant: Powered by LLaMA 3 (70B) via Groq API and Quantized meta-llama/Llama-3.1-8B via HF for natural and human-like conversations.
- Intelligent Vector Search: Leverages Qdrant Vector Database to find the most relevant fashion products using semantic similarity.
- Multi-Attribute Query Handling: Supports dynamic filtering based on brand, color, category, gender, size, and more.
- Context-Aware Query Processing: Understands partial queries and prompts users for missing details to refine results.
- Fallback Recommendation System: Displays 10 random trending products when no attributes are provided, ensuring the user always sees results.
- Optimized Model Performance: Supports 4-bit Quantization (Linux/CUDA) and 8-bit LoRA (Windows) for faster, resource-efficient inference.
- Scalable Architecture: Easily extendable to integrate new product categories, recommendation strategies, or external APIs.
- Frontend: HTML, CSS, JavaScript
- Backend: Flask, Python
- Vector Database: Qdrant
- Groq LLM Model: Groq API using llama-3.3-70b-versatile (powered by META)
- Hugging Face LLM Model: Hugging Face Llama-3.1-8B (powered by META)
- Fine-Tuning: 4-bit Quantization for CUDA/Linux & LoRA (8-bit) for Windows
- Deployment: TBD
Note : Due to Limited Resource, We have used ChatGroq due to resource constraint. If proper GPU support is available we can use the Quantized FT version of the HF-LLM
๐ Source: Custom-curated dataset integrated with Qdrant Vector Database
The Fashion E-Commerce Data Set is a structured product dataset containing detailed information about fashion items.
It is used to power semantic search and AI-driven product recommendations in this project.
- Total Records: ~3,000 fashion products (expandable)
- Type: Tabular (Structured)
- Task: Product Recommendation & Attribute-based Retrieval
- Contains rich product attributes (brand, color, size, category, gender, ratings).
- Enables multi-attribute filtering through natural conversations.
- Optimized for semantic similarity search with vector embeddings.
- Suitable for building personalized recommendation systems in e-commerce.
-
Clone the repository
git clone [email protected]:priyam-hub/Trend-Setters.git cd Trend-Setters
-
Create Conda Environment and Install Dependencies
# CONDA ENV CREATED ALONG WITH DEPENDENCY INSTALLED conda env create -f environment.yml # ACTIVATE CONDA ENVIRONMENT conda activate <env_name>
-
Set up environment variables
- Create a
.envfile in the root directory of the Project and add the following Credentials:
GROQ_API_KEY = "YOUR_GROQ_API_KEY" LLM_MODEL_NAME = "YOUR_LLM_MODEL_NAME" HF_LLM_MODEL_NAME = "YOUR_HF_LLM_MODEL_NAME" QDRANT_API_KEY = "YOUR_QDRANT_API_KEY" QDRANT_CLUSTER_URL = "YOUR_QDRANT_CLUSTER_URL" QDRANT_COLLECTION_NAME = "YOUR_QDRANT_COLLECTION_NAME" HUGGINGFACE_LOGIN_TOKEN = "YOUR_HUGGINGFACE_LOGIN_TOKEN"
- Create a
-
Run the Flask server
python web/app.py
-
Access the E-Commerce Platform Open
http://127.0.0.1:5000in your browser.
- Enter a Query: Type a product-related query (e.g., "Show me blue Adidas shoes").
- NLP Processing: The chatbot extracts attributes like brand, color, and category from your query.
- Smart Filtering:
- If attributes are provided โ Relevant products are displayed.
- If attributes are missing โ It suggests similar items and prompts for more details.
- Fallback Search: If no attributes are found, 10 random products are shown with a prompt to refine the search.
| Query | Result |
|---|---|
| "I am Looking for women Black Top" | ![]() |
| "I am Looking for Women Red Kurtis" | ![]() |
| "Show me women blue jeans" | ![]() |
| "Show me Kurta-Sets for my wife" | ![]() |
| "Show me tops to gift in birthday for my sister" | ![]() |
We benchmarked meta-llama/Llama-3.1-8B across different hardware accelerators and configurations (4-bit & 8-bit).
The chart below shows the predicted inference time (in seconds) for different setups:
| Model | Hardware | Config | Predicted Time (s) |
|---|---|---|---|
| meta-llama/Llama-3.1-8B | CPU | 4-bit | ~60 |
| 8-bit | ~110 | ||
| meta-llama/Llama-3.1-8B | T4 GPU | 4-bit | 10 |
| 8-bit | 17 | ||
| meta-llama/Llama-3.1-8B | A100 GPU | 4-bit | ~3โ4 |
| 8-bit | ~6โ7 | ||
| meta-llama/Llama-3.1-8B | L4 GPU | 4-bit | ~5 |
| 8-bit | ~9 | ||
| meta-llama/Llama-3.1-8B | v5e-1 TPU | 4-bit | ~8 |
| 8-bit | ~13 | ||
| meta-llama/Llama-3.1-8B | v2-8 TPU (Deprecated) | 4-bit | ~15 |
| 8-bit | ~25 | ||
| meta-llama/Llama-3.1-8B | v6e-1 TPU | 4-bit | ~6 |
| 8-bit | ~11 |
Trend-Setters/
โโโ .env # Optional environment variables for API keys, database URLs, and other secrets
โโโ .gitignore # Git ignore rules to exclude unnecessary files from version control
โโโ environment.yml # Conda environment configuration with all dependencies
โโโ LICENSE # MIT License for project usage and distribution
โโโ main.py # Main script to run the application (entry point)
โโโ README.md # Project documentation and overview
โโโ requirements.txt # Python package dependencies for pip installation
โโโ config/
โ โโโ __init__.py # Marks config as a Python package
โ โโโ config.py # Configuration settings for API keys, model paths, and constants
โโโ data/
โ โโโ V-1.01_Updated_Fashion_Dataset.csv # Fashion dataset containing product attributes
โโโ images/
โ โโโ image.png # General images used in README or UI
โ โโโ search_result_1.png # Example screenshot of search result 1
โ โโโ search_result_2.png # Example screenshot of search result 2
โ โโโ search_result_3.png # Example screenshot of search result 3
โโโ logger/
โ โโโ __init__.py # Marks logger as a Python package
โ โโโ logger.py # Custom logging utility for tracking events and errors
โโโ models/
โ โโโ meta-llama/Llama-3.1-8B/ # Pretrained Hugging Face LLaMA 3.1 8B model
โ โโโ model/ # Model weights and architecture
โ โโโ tokenizer/ # Tokenizer files for text processing
โโโ notebooks/
โ โโโ Trend-Setters.ipynb # Jupyter notebook for experiments, analysis, and prototyping
โโโ src/
โ โโโ extractor/
โ โ โโโ __init__.py # Marks extractor as a Python package
โ โ โโโ extractor.py # Extracts product attributes from user queries
โ โโโ llm/
โ โ โโโ __init__.py # Marks LLM module as a package
โ โ โโโ llm_builder.py # Loads and configures LLM models (Groq & Hugging Face)
โ โโโ parser/
โ โ โโโ __init__.py # Marks parser as a Python package
โ โ โโโ parser.py # Parses extracted attributes into search-friendly format
โ โโโ searcher/
โ โโโ __init__.py # Marks searcher as a Python package
โ โโโ extractor.py # Performs vector search on Qdrant and retrieves products
โโโ test/
โ โโโ __init__.py # Marks test folder as a Python package
โ โโโ test.py # Unit tests for different modules
โโโ web/
โโโ static/
โ โโโ css/
โ โ โโโ styles_home.css # CSS for homepage
โ โ โโโ styles.css # General styling for web pages
โ โโโ images/
โ โ โโโ icon/ # Icons used in the UI
โ โ โโโ logo/ # Logo images
โ โ โโโ products/ # Product images for frontend display
โ โโโ js/
โ โโโ home.js # JS for homepage functionalities and search
โ โโโ chatBot.js # JS for chatbot interactions and modal/chat window
โโโ templates/
โ โโโ index_home.html # Homepage template
โ โโโ index.html # Main index page template
โโโ __init__.py # Marks web folder as a Python package
โโโ app.py # Flask application file to run backend and route endpoints
- User Authentication: Enable login/logout with saved chat history.
- Better Query Understanding: Improve NLP pipeline for more accurate attribute extraction.
- UI/UX Enhancements: Add responsive chatbot widget with modern design.
- Randomized Recommendations: Smarter fallback mechanism with trending products instead of purely random ones.
- Multi-Language Support: Let users interact in multiple languages.
- Voice Search: Integrate speech-to-text for hands-free chatbot queries.
- Recommendation Engine: Personalized product suggestions using collaborative filtering.
- Image-Based Search: Upload product images to get visually similar results.
- Real-Time Inventory Sync: Connect with live e-commerce databases to track stock availability.
- Payment Integration: Allow direct checkout and transactions within chatbot.
- Analytics Dashboard: Provide admins with insights on queries, popular searches, and conversion rates.
- Cloud Deployment & Scaling: Deploy with Docker/Kubernetes on AWS/GCP/Azure for high availability.
- Security Enhancements: Implement JWT authentication, role-based access, and encrypted APIs.
This project is licensed under the MIT License.
Made with โค๏ธ by Team Technocrats






