Book Recommendation System
- #E-Commerce
A personalized recommendation engine for a US online bookstore with about 380k titles and 2.1 million readers. It blends collaborative and content-based filtering, learns from every rating and retrains every night.
- Machine Learning
Impact
The client runs an online bookstore and reading app with about 2.1 million registered readers and 14 million ratings. Every reader saw the same bestseller shelf, 68% of ratings landed on 3% of the catalog, and the merchandising team built lists by hand.
We built a hybrid recommender with a nightly feedback loop. One FastAPI endpoint serves ranked, explained shelves to the storefront, the iOS and Android apps and the weekly email, running in Docker on the client's existing cloud.
Services we provided
Data Audit and Cleaning
Recommendation Model Development
Offline and A/B Evaluation
Event Pipeline and Serving API
Merchandising Dashboard
QA, Load Testing and Rollout
Tech Stack
Python
Pytorch
FastAPI
PostgreSQL
Docker
Challenges and Solutions
🧐 Challenges
- The rating matrix was 99.98% empty, and 41% of readers had rated fewer than five books.
- About 6% of ratings came from bot-like or bulk-import accounts, and reader tastes shifted every 8 to 10 months.
- Nobody had defined how a recommender would be judged against catalog depth, engagement and 30-day retention.
- The storefront, two apps and the weekly email needed recommendations from one source in under 400 ms.
💡 Solutions
- Data cleaning removed about 850,000 bot-like ratings and merged 23,000 duplicate editions before any model work.
- A hybrid of matrix factorization, content-based filtering and item-to-item similarity, weighted per reader by how much the system knows about them.
- Cold-start onboarding: new readers rate five books from a genre-balanced starter set at signup.
- Every rating, skip and purchase lands on a Kafka topic; models retrain nightly and weekly, and shadow evaluation gates each promotion.
- One FastAPI endpoint answers in under 120 ms from the Redis cache and under 350 ms at p95 when it re-ranks.
- Each recommendation carries a reason, and diversity rules stop one series from filling a shelf.
Business value
- 6.4% click-through on personalized shelves, roughly 3x the old popularity shelf.
- NDCG@10 of 0.38 on the holdout, up from 0.21.
- 27% of orders now start from a recommendation, up from about 9%.
- +18% lift in 30-day reader retention.
- <350 ms p95 for freshly ranked recommendations.
- 31% of the catalog shown on a shelf in a given month, up from about 3%.
User flow