Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›’ Amazon-Style Personalized Product Recommendation Engine

AI-Powered Semantic Search, Personalization & Product Intelligence Platform


Python Streamlit FAISS Transformers Sentence Transformers Pandas


ML Pipeline Search Personalization Explainability Status


๐ŸŽฏ Vision

Modern e-commerce platforms rely on intelligent recommendation systems to connect users with relevant products. Traditional keyword-based search systems often fail because they match words rather than meaning.

This project addresses that challenge by combining:

  • ๐Ÿ” Semantic Search
  • ๐Ÿง  Transformer-Based Embeddings
  • โšก Vector Retrieval
  • ๐ŸŽฏ Business-Aware Ranking
  • ๐Ÿ‘ค Personalized Recommendations
  • ๐Ÿ’ก Explainable AI
  • ๐Ÿ“Š Interactive Analytics

into a unified recommendation platform capable of delivering highly relevant product suggestions.

The architecture is inspired by recommendation systems used by platforms such as:

  • Amazon
  • Flipkart
  • Walmart
  • Shopify
  • Alibaba

while emphasizing transparency, modularity, and explainability.


๐Ÿ› Design Philosophy

The recommendation engine follows five core principles:

1๏ธโƒฃ Understand Meaning, Not Keywords

Semantic embeddings enable the system to understand user intent beyond exact keyword matching.


2๏ธโƒฃ Retrieve Before Ranking

Recommendations are generated using a two-stage pipeline:

  • Candidate Retrieval
  • Multi-Signal Ranking

This mirrors modern industrial recommendation architectures.


3๏ธโƒฃ Multiple Signals Matter

Recommendations are not driven solely by similarity.

The engine incorporates:

  • Semantic Relevance
  • Product Ratings
  • Popularity
  • Budget Constraints
  • Business Quality Signals

4๏ธโƒฃ Personalization Improves Relevance

Recommendations adapt to different user personas and preferences.


5๏ธโƒฃ Explainability Builds Trust

Every recommendation is accompanied by a human-readable explanation describing why it was selected.


๐Ÿ— System Architecture

                         User Query
                              โ”‚
                              โ–ผ

                Sentence Transformer Encoder
                     all-MiniLM-L6-v2
                              โ”‚
                              โ–ผ

                  Semantic Query Embedding
                              โ”‚
                              โ–ผ

                   FAISS Vector Database
                    IndexFlatL2 Search
                              โ”‚
                              โ–ผ

                  Top-K Candidate Products
                              โ”‚
                              โ–ผ

                   Multi-Signal Ranking
          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
          โ–ผ            โ–ผ            โ–ผ            โ–ผ

     Similarity    Rating    Popularity    Budget

                              โ”‚
                              โ–ผ

                     Personalization Layer
                              โ”‚
                              โ–ผ

                     Explainability Engine
                              โ”‚
                              โ–ผ

                      Streamlit Dashboard

๐Ÿš€ Key Features

๐Ÿ” Semantic Search Engine

Traditional search:

Keyword โ†’ Match

ARGUS-style retrieval:

Meaning โ†’ Retrieval

Capabilities

  • Transformer Embeddings
  • Context-Aware Search
  • Semantic Understanding
  • Query Intent Recognition
  • Dense Vector Retrieval

Model

all-MiniLM-L6-v2

Embedding Dimension:

384

โšก Vector Retrieval Layer

High-performance nearest-neighbor search powered by FAISS.

Features

  • IndexFlatL2 Retrieval
  • Fast Top-K Search
  • Semantic Similarity Matching
  • Scalable Candidate Retrieval

Benefits

  • Millisecond Search
  • Efficient Vector Operations
  • Production-Ready Retrieval Architecture

๐ŸŽฏ Multi-Signal Ranking Engine

Candidate products are ranked using a weighted scoring framework.

Ranking Signals

Signal Purpose
Semantic Similarity Measures query relevance
Product Rating Captures customer satisfaction
Popularity Measures market adoption
Budget Match Ensures affordability alignment
Business Score Incorporates platform priorities

Ranking Formula

Final Score =
0.35 ร— Similarity
+ 0.25 ร— Rating
+ 0.15 ร— Popularity
+ 0.10 ร— Budget Match
+ 0.05 ร— Business Score

๐Ÿ‘ค Personalization Layer

Profile-aware recommendation boosting enables tailored experiences.

๐ŸŽฎ Gaming User

Boosts products related to:

  • Gaming
  • RTX GPUs
  • Graphics Performance
  • ASUS
  • Lenovo LOQ
  • Gaming Laptops

๐Ÿค– AI / ML Student

Boosts products optimized for:

  • Machine Learning
  • Deep Learning
  • High RAM
  • CUDA Support
  • GPU Workloads

๐ŸŽ“ Student

Prioritizes:

  • Affordability
  • Battery Life
  • Lightweight Devices
  • Daily Productivity

๐Ÿ’ก Explainable AI Layer

Every recommendation includes transparent reasoning.

Example Explanations

  • Retrieved due to strong semantic relevance
  • Highly rated by customers
  • Fits specified budget constraints
  • Suitable for AI workloads
  • Matches selected user profile

This transforms recommendations from:

"Recommended"

to:

"Recommended because..."

๐Ÿ“Š Analytics Dashboard

Interactive Streamlit dashboard providing:

User Features

  • Product Search
  • Profile Selection
  • Recommendation Results
  • Explanation Viewer

Analytics Features

  • Product Distribution
  • Rating Analysis
  • Recommendation Trends
  • Search Statistics
  • Ranking Insights

๐Ÿ”„ End-to-End Workflow

Stage 1 โ€” Data Processing

Raw product and review data are cleaned and standardized.

Operations

  • Missing Value Handling
  • Duplicate Removal
  • Product Aggregation
  • Feature Engineering
  • Metadata Processing

Stage 2 โ€” Embedding Generation

Product descriptions are converted into dense semantic vectors using Sentence Transformers.

Model

all-MiniLM-L6-v2

Stage 3 โ€” Vector Index Construction

Generated embeddings are stored inside a FAISS index.

Benefits

  • Fast Retrieval
  • Scalable Search
  • Efficient Similarity Matching

Stage 4 โ€” Candidate Retrieval

User queries are embedded and matched against product vectors.

Output

Top-K Candidate Products

Stage 5 โ€” Ranking

Retrieved products are scored using business and relevance signals.


Stage 6 โ€” Personalization

User-profile boosts are applied.


Stage 7 โ€” Explainability

Recommendation reasoning is generated.


Stage 8 โ€” Dashboard Presentation

Results are delivered through an interactive Streamlit interface.


๐Ÿ“ˆ Evaluation Framework

The recommendation engine includes standard ranking metrics.

Implemented Metrics

Metric Description
Precision@K Relevant items within Top-K results
Recall@K Coverage of relevant products
NDCG@K Ranking quality evaluation

Evaluation Output

results/evaluation_report.csv

๐Ÿ›  Technology Stack

Machine Learning

  • Sentence Transformers
  • Hugging Face Transformers
  • NumPy
  • Pandas

Vector Retrieval

  • FAISS
  • Dense Embeddings
  • Semantic Search

Frontend

  • Streamlit Dashboard
  • Interactive Analytics

Analytics

  • Matplotlib
  • Seaborn

Testing

  • Unit Testing
  • Recommendation Validation
  • Ranking Verification

๐Ÿ“‚ Project Structure

amazon-rec-engine/
โ”‚
โ”œโ”€โ”€ analytics/
โ”œโ”€โ”€ assets/
โ”‚   โ”œโ”€โ”€ system_architecture.png
โ”‚   โ””โ”€โ”€ screenshots/
โ”‚
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ raw/
โ”‚   โ””โ”€โ”€ processed/
โ”‚
โ”œโ”€โ”€ logs/
โ”œโ”€โ”€ models/
โ”œโ”€โ”€ results/
โ”œโ”€โ”€ src/
โ”œโ”€โ”€ tests/
โ”‚
โ”œโ”€โ”€ app.py
โ”œโ”€โ”€ run_pipeline.py
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ LICENSE

๐Ÿงช Engineering Highlights

Machine Learning

  • Semantic Search
  • Dense Vector Retrieval
  • Explainable AI
  • Recommendation Systems

Software Engineering

  • Modular Architecture
  • Scalable Pipeline Design
  • Reusable Components
  • Logging Framework

Data Engineering

  • Data Processing Pipeline
  • Feature Engineering
  • Vector Indexing

Product Engineering

  • Personalized Experiences
  • Business-Aware Ranking
  • Analytics Dashboard

๐Ÿ”ฎ Future Roadmap

Recommendation Intelligence

  • Collaborative Filtering
  • Hybrid Recommendation Systems
  • User Behavior Modeling

Learning-to-Rank

  • LambdaMART
  • XGBoost Ranker
  • LightGBM Ranker

Real-Time Learning

  • Click Feedback
  • Purchase Signals
  • Reinforcement Feedback Loops

Search Enhancements

  • Multimodal Search
  • Image Retrieval
  • Visual Product Matching

Deployment

  • FastAPI
  • Docker
  • AWS
  • Kubernetes

๐Ÿ‘จโ€๐Ÿ’ป Author

Omjee R Giri

AI & Machine Learning Engineer โ€ข Recommendation Systems Enthusiast โ€ข Data Science Practitioner

Built to explore:

  • Recommendation Systems
  • Semantic Search
  • Vector Databases
  • Explainable AI
  • Personalized Ranking
  • Production ML Architectures

๐Ÿ›’ Recommendation Is Not Search.

It's Understanding Intent.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages