AI Hybrid Recommendation System for Mobile App

BLACKSPARC.TECH is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.

Development and support of all types of mobile applications:

Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1All 1735 services
AI Hybrid Recommendation System for Mobile App
Complex
~2-4 weeks
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    792
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    671
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1097
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    969
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    914
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    495

AI-Powered Hybrid Recommendation System for Mobile Apps

Pure Collaborative Filtering breaks on cold start. Pure Content-Based ignores social signals and gets stuck in filter bubble. Hybrid systems combine both — these power recommendation feeds of major platforms: Netflix, Spotify, Amazon.

Main engineering question isn't "do we need hybrid", but "how exactly to combine".

Three Combination Strategies

Weighted Hybrid — Score Weighted Sum

Simplest: final score = α × CF_score + (1−α) × CB_score. Parameter α can be dynamic — for new user α = 0.2 (CF weak, trust CB), for experienced user α = 0.7.

class WeightedHybridRecommender:
    def __init__(self, cf: CFRecommender, cb: CBRecommender):
        self.cf = cf
        self.cb = cb

    def recommend(self, user: User, candidates: list[str], n: int = 20) -> list[str]:
        alpha = self._compute_alpha(user.interaction_count)

        cf_scores = self.cf.score(user.id, candidates)   # dict[item_id -> float]
        cb_scores = self.cb.score(user.profile, candidates)

        hybrid_scores = {
            item_id: alpha * cf_scores.get(item_id, 0) + (1 - alpha) * cb_scores.get(item_id, 0)
            for item_id in candidates
        }
        return sorted(hybrid_scores, key=hybrid_scores.get, reverse=True)[:n]

    def _compute_alpha(self, interaction_count: int) -> float:
        # linear growth: 0.2 at 0 interactions, 0.8 at 100+
        return min(0.2 + (interaction_count / 100) * 0.6, 0.8)

Switching Hybrid — Strategy by Context

Instead of mixing scores — switch between recommenders entirely. Switch logic can be complex: CF for logged-in users with history, CB for guests, popularity-based for new users without onboarding.

// Android: strategy by user context
sealed class RecommendationContext {
    object Guest : RecommendationContext()
    data class NewUser(val preferences: List<String>) : RecommendationContext()
    data class ActiveUser(val userId: String, val interactionCount: Int) : RecommendationContext()
}

class HybridRecommenderRepository(
    private val cfApi: CFRecommendationApi,
    private val cbApi: CBRecommendationApi,
    private val popularApi: PopularityApi
) {
    suspend fun getRecommendations(context: RecommendationContext): List<Product> {
        return when (context) {
            is RecommendationContext.Guest ->
                popularApi.getTopProducts(count = 20)
            is RecommendationContext.NewUser ->
                cbApi.getByPreferences(context.preferences, count = 20)
            is RecommendationContext.ActiveUser -> {
                if (context.interactionCount < 15) {
                    // mix: 30% CF + 70% CB
                    mergeRecommendations(
                        cfApi.getPersonalized(context.userId, count = 6),
                        cbApi.getSimilarToHistory(context.userId, count = 14)
                    )
                } else {
                    cfApi.getPersonalized(context.userId, count = 20)
                }
            }
        }
    }
}

Feature-Level Hybrid via Neural Network (Two-Tower Model)

Advanced: CF embeddings of user and item concatenated with CB features and fed into shallow neural network (2–3 dense layers). Model trained end-to-end to predict click probability. This Two-Tower architecture used by Google and Airbnb.

# Two-Tower model (simplified)
class TwoTowerModel(nn.Module):
    def __init__(self, user_emb_dim=64, item_emb_dim=64, cb_features_dim=50):
        super().__init__()
        self.user_tower = nn.Sequential(
            nn.Linear(user_emb_dim, 128), nn.ReLU(),
            nn.Linear(128, 64)
        )
        self.item_tower = nn.Sequential(
            nn.Linear(item_emb_dim + cb_features_dim, 128), nn.ReLU(),
            nn.Linear(128, 64)
        )

    def forward(self, user_emb, item_emb, cb_features):
        user_out = self.user_tower(user_emb)
        item_input = torch.cat([item_emb, cb_features], dim=-1)
        item_out = self.item_tower(item_input)
        return torch.sigmoid((user_out * item_out).sum(dim=-1))

On mobile client, Two-Tower serving works via pre-computing item embeddings + FAISS ANN.

Mobile Integration: Caching and Recommendation Updates

// iOS: recommendation cache with TTL and background update
class RecommendationCache {
    private let cache = NSCache<NSString, CachedRecommendations>()
    private let ttl: TimeInterval = 300  // 5 minutes

    func get(userId: String) -> [Product]? {
        guard let cached = cache.object(forKey: userId as NSString),
              Date().timeIntervalSince(cached.timestamp) < ttl
        else { return nil }
        return cached.products
    }

    func set(userId: String, products: [Product]) {
        cache.setObject(
            CachedRecommendations(products: products, timestamp: Date()),
            forKey: userId as NSString
        )
    }
}

Recommendations refresh in background via BGAppRefreshTask (iOS) / WorkManager (Android) — user sees fresh content on app open without waiting.

Process

Data audit: CF signal availability, CB metadata quality, user base size.

Choose combination strategy based on task complexity and resources.

Develop serving layer with client-side caching.

A/B test: hybrid vs best single recommender → CTR, time in app, conversion.

Timeline Guidance

Weighted Hybrid with ready CF and CB components — 1–2 weeks. Two-Tower model from scratch — 4–6 weeks including data collection, training, deployment.