Case Study — Bilingual news platform with Multimodal Two-Tower recommendation & LambdaMART reranking

Jagrit

A bilingual (Hindi/English) news platform with live RSS/API ingestion, Gemini API for contextual RAG Q&A and translation, and a 2-stage recommender: custom Multimodal Two-Tower model (ResNet-50 + Multi-Head Attention via Gated Fusion, InfoNCE loss in FAISS) paired with a LambdaMART reranker and MMR diversity.

jagrit-eight.vercel.app
Screenshot of Jagrit
PyTorchFAISSResNet-50LambdaMARTEnsemble LearningFastAPIKafkaRedisReact.jsGemini API
01

Overview

Jagrit is an enterprise-grade bilingual news and content ranking platform for Hindi and English readers. It combines live RSS/API stream ingestion and Gemini-powered contextual RAG Q&A with a production-ready 2-stage recommender: a custom Multimodal Two-Tower model (ResNet-50 + Multi-Head Attention via Gated Fusion) indexed into FAISS for sub-10ms retrieval, paired with a LambdaMART reranker incorporating MMR diversity (λ = 0.75) and negative skip feedback.

02

The Problem

Personalizing multimodal news streams across bilingual audiences requires balancing low-latency candidate retrieval, visual-semantic content understanding, and feed diversity while preventing clickbait echo chambers and cold-start failures.

03

My Contribution

Architected the complete 2-stage recommendation engine in PyTorch and FastAPI. Built the custom Multimodal Two-Tower architecture combining ResNet-50 visual feature extraction with text multi-head attention via Gated Fusion, optimized with InfoNCE contrastive loss (τ = 0.07). Indexed candidate representations into FAISS, trained a LambdaMART reranker with MMR diversity, and integrated a Redis feature store fed by Kafka interaction streams.

04

Architecture

Multimodal Two-Tower Retrieval

Item tower fuses ResNet-50 image feature embeddings with article text representations via a Gated Fusion mechanism. User tower encodes real-time reading history with multi-head self-attention. Trained end-to-end with InfoNCE contrastive loss (τ = 0.07).

FAISS ANN Vector Indexing

Article multimodal embeddings are indexed into FAISS (IndexFlatIP / IndexIVFFlat) for approximate nearest neighbor retrieval, delivering top-100 candidates in under 3ms.

LambdaMART Reranker & MMR Diversity

A gradient-boosted LambdaMART reranker scores candidates using session recency, category affinity, and interaction history. Maximal Marginal Relevance (MMR, λ = 0.75) diversifies the final feed to prevent topic fatigue, with negative skip feedback penalizing unclicked stories.

Live Ingestion & Gemini RAG

Scheduled workers ingest RSS feeds and news APIs, buffering raw stories into MongoDB. Gemini powers automatic Hindi↔English translation and a FAISS-backed RAG pipeline for natural language Q&A across article context.

3-Tier Resilient Feed Fallback

Tier 1 serves personalized Two-Tower + LambdaMART feeds. Tier 2 serves category-based trending articles. Tier 3 serves chronological ingestion order, ensuring 100% feed uptime during cold-start or model warmups.

05

Engineering Decisions & Tradeoffs

Multimodal Two-Tower with InfoNCE over single-modality collaborative filtering

Rationale: News content is inherently multimodal (headlines, body, lead images). Gated fusion of ResNet-50 visual tokens with text embeddings captures visual editorial signals and solves severe new-item cold start.

Tradeoff: Increased offline training complexity and embedding dimensionality; mitigated by indexing fixed item vectors into FAISS.

Two-stage retrieval + reranking over monolithic ranking

Rationale: Scoring 50,000+ candidate articles through a heavy neural ranker at request time would breach the 20ms P95 latency SLA. FAISS retrieval filters to top 100 in 2.8ms, allowing LambdaMART to rerank with rich features in under 6ms.

Tradeoff: Slight loss of theoretical optimality from two-stage decoupling, compensated by 10x lower serving latency.

Maximal Marginal Relevance (MMR) for diversity

Rationale: Pure relevance maximization clusters identical breaking news topics together. MMR with λ = 0.75 introduces semantic novelty without compromising quality.

Tradeoff: Requires pairwise cosine distance computation on the top candidate set before final response return.

06

Challenges & Solutions

Challenge

Sub-10ms P95 end-to-end serving latency in FastAPI

Solution

Precomputed item embeddings in FAISS, asynchronous background logging via Kafka, and feature caching in Redis brought P95 latency down to 8.6ms.

Challenge

User cold start and negative feedback incorporation

Solution

Negative skip feedback explicitly discounts categories after consecutive swipes without clicks, while onboarding topic seeds initialize user tower vectors immediately.

07

Evidence & Results

  • ›0.607 nDCG@10, 0.432 PR-AUC, and 0.198 Cohen's Kappa on evaluation benchmarks
  • ›8.6ms P95 latency in FastAPI serving live recommendations
  • ›100% feed uptime guaranteed by 3-tier fallback architecture
  • ›Full multimodal visual-textual understanding via ResNet-50 and Gated Fusion
  • ›Live deployment running at https://jagrit-eight.vercel.app/
All Projects View Repository Live Demo