abhinav.yadav
CV
Back to Projects

Session-Level Recommendation Engine

Real-time personalization and CTR prediction system

Problem E-commerce and advertising platforms lose user engagement if they cannot present personalized suggestions quickly. For anonymous visitors, lack of historical profiles makes recommendations difficult, necessitating session-based modeling.

Solution Created a real-time session-level recommender engine. It parses a user's clickstream actions in real-time, builds a dynamic session interest vector, retrieves candidates using Elasticsearch vector indexing, and ranks them using a lightweight CTR prediction model.

Challenges * **Latency constraint**: Recommendations must be served under 50 milliseconds to prevent layout shift or loading delays. * **Solution**: Optimized vector indexes and built a lightweight ranking model. Deployed on Flask and Gunicorn with asynchronous workers. * **Cold Start**: Recommending to brand new visitors. * **Solution**: Built popular-item and categorized fallback loops based on referral headers and geo-location.

Results * Personalized recommendations served in under **50ms**. * Achieved double-digit lift in cross-sell CTR. * Successfully scaled to handle registered and anonymous traffic.

System Architecture


[Clickstream Event] ──> [Session Vectorizer] ──> [Elasticsearch Retrieve] ──> [LightGBM Rank] ──> [Ads Served (<50ms)]

Business Results

Served recommendations under 50ms
Increased ad CTR via real-time click modeling
Unified recommendation loop for registered and anonymous users

Technology Stack

PythonElasticsearchLightGBMFlaskGunicornTransformers