Hybrid AI Recommendation System for Mobile Apps

TRUETECH 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 1734 services
Hybrid AI Recommendation System for Mobile Apps
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
    858
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    745
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1162
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    1034
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    968
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    563

What is a hybrid recommendation system?

Note: when pure collaborative filtering breaks on a cold start — new users without history don't get relevant recommendations, and a sparse interaction matrix produces noisy predictions. Content-Based, on the other hand, locks the user in a bubble: they only see what they've already viewed and don't discover new categories. The hybrid approach combines the strengths of both methods. We have implemented such systems for over 15 projects in e-commerce and media; our experience is 5+ years in machine learning on mobile platforms. Below are proven strategies and code for iOS and Android.

Our hybrid recommendation system for mobile apps uses AI to deliver personalized recommendations on both iOS and Android platforms. We employ A/B testing on recommendations to validate improvements. The hybrid approach to recommendations combines collaborative and content-based filtering.

Combining Algorithms in a Hybrid System

Weighted Hybrid — weighted sum of scores

The simplest option: final score = α × CF_score + (1−α) × CB_score. The α parameter can be made dynamic — for a new user α = 0.2 (CF weak, trust CB), for an 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:
        return min(0.2 + (interaction_count / 100) * 0.6, 0.8)

Switching Hybrid — choose strategy based on context

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

// Android: strategy based on 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) {
                    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)

Advanced option: CF embeddings of user and item are concatenated with CB features and fed into a shallow neural network (2–3 dense layers). The model is trained end-to-end to predict click probability. This architecture is used by major platforms like YouTube and Pinterest. The Two-Tower model is 20% more accurate in terms of AUC than weighted hybrid.

# 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 the mobile client, Two-Tower serving works via precomputed item embeddings + FAISS ANN.

Advantages of Hybrid Over Pure CF or CB

Pure CF loses quality on sparse data — new users and items don't get adequate recommendations. Pure CB loops on past preferences, missing unexpected intersections. Hybrid combines strengths: social signals (CF) and semantic similarity (CB). In our A/B test, the hybrid system showed a CTR 30% higher than the best single method on a sample of 10,000 users. User churn reduction — up to 15%. For example, weighted hybrid outperforms pure CF by 1.5 times in terms of CTR for cold users.

Strategy When to Use Advantages Disadvantages
Weighted Hybrid Have ready CF and CB, balanced data Simplicity, easy to tune Sensitivity to α weight
Switching Hybrid Different user types (guests, new, active) Flexibility, fast adaptation Complex switching logic
Feature-level Hybrid Large data volume, high accuracy Best quality, end-to-end learning Requires data, resources, time

Choosing a Hybrid Strategy for Your App

The choice depends on data volume, user base size, and business requirements. For startups with up to 10,000 users, Weighted Hybrid is suitable — it's easy to prototype. For apps with different segments (guests, new, active), Switching Hybrid is better. If you have hundreds of thousands of users and millions of interactions, the Two-Tower model will justify the development cost through increased conversion.

Impact of Caching on Recommendation Performance

Client-side caching is critical: it reduces server load and speeds up recommendation display. We use a TTL of 5 minutes with background updates via BGAppRefreshTask (iOS) and WorkManager (Android). This ensures the user sees fresh recommendations when opening the app with no delay.

// iOS: recommendation cache with TTL and background refresh
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
        )
    }
}
Metric Improvement with Hybrid
CTR +20–40%
Time in app +15–25%
Conversion +10–20%
User churn -10–15%

Hybrid recommendation systems are extensively documented in academic literature. For instance, Wikipedia - Recommender System provides an overview of combining filtering methods. The ACM RecSys conference series includes numerous case studies on hybrid approaches.

Implementation costs: Weighted hybrid from $5,000, Switching hybrid $8,000–$15,000, Two-Tower model $15,000–$30,000. Potential annual savings from improved retention exceed $50,000 for mid-size apps. For example, an app with 100k users can expect an additional $20,000 monthly revenue from a 15% churn reduction.

Cost and Timeline DetailsThe typical cost for a weighted hybrid implementation starts at $5,000, while a Two-Tower model can range from $15,000 to $30,000 depending on data complexity. Annual savings from improved retention often exceed $50,000 for mid-size apps. These investments typically pay back in 3-6 months.

Step-by-Step Implementation Guide

  1. Data Audit: Assess available interaction data (ratings, clicks, purchases) and content metadata. Ensure minimum 10,000 interactions for CF.
  2. Select Hybrid Strategy: Based on data volume and user segments, choose weighted, switching, or feature-level hybrid.
  3. Develop Serving Layer: Implement caching with TTL and background refresh for iOS/Android.
  4. A/B Testing: Run experiment comparing hybrid vs. best single method; measure CTR, conversion, churn.
  5. Deploy and Monitor: Gradual rollout with monitoring for drift; retrain models weekly.

What's Included in the Work

  • Data audit: availability of CF signals, quality of CB metadata, user base size.
  • Selection of combination strategy based on task complexity and resources.
  • Development of serving layer with client-side caching (iOS/Android).
  • A/B test: hybrid vs best single recommender → CTR, time in app, conversion.
  • Integration documentation and post-implementation support.
  • Team training on using the system.

Timeline Estimates

Strategy Timelines
Weighted Hybrid (existing components) 1–2 weeks
Switching Hybrid 2–3 weeks
Two-Tower model from scratch 4–6 weeks

The cost is calculated individually. We guarantee post-implementation support and transparent reporting at every stage. Get a consultation — we will analyze your data and propose the optimal solution within 2–3 business days. Contact us to evaluate your project.

Machine Learning in Mobile Apps: CoreML, TFLite, and On-Device Models

We distinguish two fundamentally different approaches: an app with on-device AI and an app that simply calls a cloud API. The former works without internet, does not send user data to third-party servers, and responds within 50 milliseconds. The latter depends on network latency and pricing plans. Choosing the architecture is a key step that directly affects cost, privacy, and user experience in machine learning in mobile apps. Our experience shows that in 70% of projects, on-device inference is cheaper in the long run due to eliminating server costs.

How to Choose Between CoreML and TFLite for On-Device Inference?

CoreML — Apple's native framework for running ML models on device. Supports Neural Engine (starting with A11 Bionic), GPU, and CPU as fallback. Models are converted to .mlmodel format via coremltools from PyTorch, ONNX, or TensorFlow. Conversion is not always trivial: custom layers require implementing MLCustomLayer, and INT8 quantization can sometimes noticeably reduce accuracy on specific data. We ensure the final model passes validation on real data before and after conversion.

TensorFlow Lite — cross-platform alternative for Android and Flutter. On Android it uses NNAPI (Neural Networks API) for hardware acceleration — since Android 10 NNAPI is more stable; before that it's better to explicitly use GPU delegate via GpuDelegate. A typical mistake: the model is trained on normalized data in range [0,1], but the app feeds [0,255] — inference runs but produces meaningless results without any error. We include an automatic input data validation module in the SDK.

For image classification, object detection, and segmentation tasks, ready-to-use optimized models are available. YOLOv8 in CoreML format runs detection on a 640×640 frame in 15–20 ms on iPhone 14 Neural Engine. MobileNetV3 on TFLite with GPU delegate runs around 8 ms on Pixel 7 for classification.

Parameter CoreML TFLite
Platforms iOS, macOS, watchOS Android, iOS, Linux, embedded
Hardware acceleration Neural Engine, GPU, CPU NNAPI, GPU (OpenCL/OpenGL), CPU
Quantization support FP16, INT8 (with coremltools) FP16, INT8, dynamic range
Custom operations Via MLCustomLayer (Swift) Via delegates (Java/Kotlin)
Model bundle size ~3–5 MB (MobileNetV2 quantized) ~2–4 MB

What If You Need Text Generation On-Device?

Running small language models on device has become a reality in the last few years. Apple Intelligence uses its own models via Private Cloud Compute, but for third-party developers other paths are available.

llama.cpp with Metal backend on iOS is a working approach for phi-3-mini (3.8B parameters, 4-bit quantization, ~2.3 GB). Inference: 15–25 tokens/second on iPhone 15 Pro. For integration in Swift, use the Swift Package llama.swift or a wrapper via C interface llama.h. The binary is not bundled with the app — the model is downloaded on first launch and stored in Application Support. Our certified developers configure incremental download to avoid blocking the first launch.

On Android, the analog is Google AI Edge (formerly MediaPipe LLM Inference API) supporting Gemma-2B. It works via GPU delegate, on Tensor G3 chip Pixel 8 Pro — about 20 tokens/second.

Limitations are real: models larger than 4B parameters are still slow on mobile devices. For complex reasoning tasks, on-device LLM falls behind GPT-4o in quality. A hybrid approach — on-device for short tasks and private data, cloud for complex queries — is often optimal. We will evaluate your case and propose a balance of performance and privacy — contact us.

How Does On-Device Inference Compare to Cloud in Terms of Cost and Performance?

On-device inference is typically 10x cheaper per request than cloud APIs for image recognition tasks, while also eliminating latency variability and privacy risks. The table below summarizes the trade-offs.

Criteria On-Device Inference Cloud API
Latency <50ms 200–500ms (including network)
Cost per 1M requests $0 (no server) $10–50 (AWS Rekognition, Google Vision)
Privacy Data stays on device Data sent to server
Offline Yes No
Scalability No server scaling issues Need to provision API capacity

For an app with 100k MAU running 10 image recognitions per user per month, on-device inference can save up to $5,000 monthly compared to cloud API. Get a free consultation on your ML architecture today.

Integrating OpenAI API and Other Cloud Models

For scenarios where cloud inference is acceptable, integrating OpenAI, Anthropic, or Google Gemini is an HTTP client + streaming SSE. In Swift, AsyncThrowingStream is convenient for streaming responses. In Kotlin, use Flow.

Critically: API keys must never be stored in the app bundle. Even an obfuscated key can be extracted from the IPA in 10 minutes using strings or frida. Correct architecture: mobile app → your own backend → OpenAI API. The backend controls rate limiting, logs requests, and protects the key.

What Is Included in the Work (Deliverables)

  • Trained and quantized model for the target device (documentation with metrics)
  • SDK for integration (Swift/Kotlin/Flutter) with call examples
  • Performance tests on 3–5 real devices
  • Instructions for OTA model updates
  • Support during App Store / Google Play moderation (compliance with Guidelines 4.2, 5.1)
  • 2 weeks of technical support after release

Typical Project Pipeline

  1. Task analysis — measure latency, privacy, size, supported devices.
  2. Model prototyping — in Python, evaluate accuracy on target data.
  3. Conversion and quantization — for CoreML/TFLite with validation.
  4. Integration into the app — model wrapped in a service layer (easy to swap CoreML ↔ TFLite ↔ cloud).
  5. Testing — on real devices, measure FPS, RAM, battery.
  6. Deployment — via TestFlight / Firebase App Distribution, monitor metrics.

Timelines: integration of a ready CoreML/TFLite model — 1–2 weeks, development of a custom model with mobile optimization — from 6 weeks, on-device LLM chat with personalization — 4–8 weeks.

Why We Take on Complex Cases?

10+ years of experience in mobile development, 50+ implemented AI/ML solutions, guarantee of compatibility with current iOS and Android versions. All projects undergo code review and load testing. The cost includes preparation of moderation documentation and training of your team.

Contact us — we will help you choose the architecture and implement ML in your app turnkey. Order an audit of your existing solution — we will assess the potential for server cost savings free of charge. In some projects, savings can reach significant amounts per month.