Home/Expertise

Recommendation systems

A custom sleep-recommendation engine for OptySleep, built around a formula, semantic similarity, caching, and A/B tests. Written from shipped work by Muhammad Huzaifa Shahbaz, AI Systems Engineer at Digital Dividend Global.

What I build

  • On-device-adjacent product recommendations that suggest the next sleep intervention from what the user already tried.
  • The serving path around that model: cache, experiment assignment, and a FastAPI service the iOS app can call.

Architecture

  • OptyAI uses a custom ranking formula plus Sentence-BERT embeddings so 'caffeine reduction helped' can surface a related next step such as a blue-light filter.
  • Redis caches recommendation reads. A/B tests compare formula changes against engagement, retention, and subscription renewal.
  • The service is FastAPI and Python, packaged with Docker, with Firebase in the product stack.

Production constraints

  • The public result is about a 70% increase in iOS engagement, with improved retention and higher subscription renewals.
  • A recommendation that ignores the last trial feels random. The history of what the user already tried is an input, not a log line.
  • iOS integration was handled by Digital Dividend's partner side; the recommendation engine and backend were the in-house piece.

Stack

FastAPI · Python · Redis · Sentence-BERT · Docker · Firebase

Tradeoffs

  • A custom formula is explainable to a product team and harder to improve than an offline-trained ranker once the catalog of sleep methods grows.
  • Semantic similarity finds nearby interventions. It does not by itself know which one changed someone's sleep. The A/B test is what makes that claim.

Projects

External verification

Questions

What recommendation system has he shipped?

OptyAI for OptySleep: a FastAPI service using Redis, A/B testing, and Sentence-BERT similarity. The published engagement change is about 70%.

Is it a generic collaborative-filtering library?

No. The portfolio describes a custom formula over sleep-method history, with embeddings used to propose the next related method.

Other expertise

I love working in Software Dev, Artificial Intelligence & DevOps

M. Huzaifa Shahbaz

All rights are reserved or permitted. ©