Inspiration

Modern feeds were supposed to open the world up, yet they mostly trap us inside algorithmic echo chambers; serving slightly louder versions of what we already think. I built Outside as a quiet antidote to doomscrolling instead of an endless feed, it delivers one curated, cross-disciplinary micro-lesson a day spanning cognitive science, gaming psychology, architecture, arts, music, and philosophy.

When adding AI to Outside, a real product tension emerged: personal reflections and quick comprehension tools shouldn't have to leave your device, while deep cross-disciplinary synthesis and live web context need the reasoning power of the cloud. Firebase AI Logic Hybrid Inference was the exact architecture needed to solve both sides cleanly.

What it does

Outside turns daily curiosity into a 3-minute habit—powered by daily drop notifications, reflection streaks, and a dual-direction Hybrid AI experience across iOS and Android:

Self-Healing Multi-Perspective Daily Pool (PREFER_IN_CLOUD): Loads today's 3-topic daily pool from Firestore. If the scheduled pool is unavailable or the user is offline, Outside automatically self-heals via Firebase AI Logic—using Gemini 3.8 Flash with structured JSON (responseSchema) online to generate 3 random cross-disciplinary editions with real reference links or falling back to Apple Foundation Models / Gemini Nano on-device when offline.

Hybrid AI Lesson Lens (Dual-Mode): Embedded directly beneath every daily lesson: ELI5 & Analogy (PREFER_ON_DEVICE) & Devil's Advocate (PREFER_ON_DEVICE): Instant, zero-cost comprehension lenses that run locally on-device—even with Wi-Fi off.

Live World Context (ONLY_IN_CLOUD): Connects timeless concepts to real-world current events using Gemini 3.8 Flash + Google Search grounding (Tool.googleSearch()). Private Socratic Reflection Coach (PREFER_ON_DEVICE): Inside the reflection modal, users can tap Private Socratic Nudge to receive a tailored 2-sentence Socratic follow-up processed locally on-device so intimate journal notes stay on the phone.

Echo-Chamber Blindspot Bridge (2-Stage Privacy-Preserving Hybrid Pipeline): Stage 1 (⚡ On-Device): Analyzes the user's private reflections locally and distills them into just 3 anonymized curiosity themes (stripping personal details and raw journal quotes). Stage 2 (☁️ Cloud): Detects the user's comfort-zone domain vs. their least-read blindspot domain, then sends only those anonymized tags to Gemini 3.8 Flash (structured JSON) to synthesize a custom Bridge Lesson connecting what they love to a subject they usually avoid.

Live Hybrid Telemetry & Engine Inspector: Every AI card displays an honest runtime pill (⚡ On-Device • Engine • Latency vs. ☁️ Cloud • Engine • Latency), and Settings → Hybrid AI Engine lets users inspect device capability and switch routing modes (Auto (Hybrid), On-Device Only, Cloud Only).

How we built it

Cross-Platform Client: Flutter (flutter_bloc, firebase_core, firebase_auth, cloud_firestore, firebase_ai, firebase_app_check, onesignal_flutter).

Unified HybridAIService + Native Platform Channels (com.outside.outside/hybrid_ai): Android (MainActivity.kt): Integrates com.google.firebase:firebase-ai + com.google.firebase:firebase-ai-ondevice with OnDeviceConfig(mode = InferenceMode.PREFER_ON_DEVICE) and GenerativeBackend.agentPlatform(location = "global"), routing between Gemini Nano (AICore) and Gemini 3.8 Flash while reporting exact response.inferenceSource (ON_DEVICE vs IN_CLOUD).

iOS (AppDelegate.swift): Integrates Apple's native FoundationModels framework (SystemLanguageModel.default + LanguageModelSession on iOS 26+ Apple Intelligence devices) with automatic cloud fallback to Firebase AI Logic (firebase_ai).

Security: Protected client-side cloud AI calls with Firebase App Check (App Attest on iOS, Play Integrity on Android, and Debug Providers during development).

Backend & Retention: Cloud Firestore, Firebase Auth (Google, Apple, Email), Cloud Functions for scheduled daily drops, and OneSignal for daily lesson pushes and evening streak reminders.

Challenges we ran into

Bridging Native Hybrid SDKs into Flutter: The Dart firebase_ai SDK currently focuses on cloud models, while official on-device hybrid orchestration lives in the native Android (firebase-ai-ondevice) and iOS (FoundationModels) toolchains. We solved this with a lightweight Flutter MethodChannel that preserves exact inference-source and latency telemetry across both platforms.

Output Formatting on Small On-Device Models (~3B params): Small local models occasionally break strict JSON or write overly long headlines when generating full multi-section lessons. We solved this by pairing PREFER_IN_CLOUD (strict JSON responseSchema) for rich 3-topic generation with a lightweight labeled-section parser and sentence-cap safeguard for offline on-device generation.

Cross-Hardware Reality: Testing across both an iOS 26 Apple Silicon environment (with live Apple Foundation Models) and an older physical Samsung Galaxy S21 (without Google AICore / Gemini Nano hardware) surfaced App Check debug-token caching, Gradle 9.3.1 / AGP 9.1.1 DSL changes, and SDK migrations (GenerativeBackend.agentPlatform()), while proving our cloud fallback path in real conditions.

Accomplishments that we're proud of

True Two-Stage Privacy-Preserving Hybrid AI: Moving beyond simple "local with cloud fallback" to a real split pipeline (Echo-Chamber Blindspot Bridge) where on-device AI protects private journal text and cloud AI performs rich structured synthesis on anonymized themes.

Transparent Hybrid UX: Making local vs. cloud routing, fallback behavior, and latency visible in a clean editorial UI without getting in the way of reading.

End-to-End Multi-Platform Verification: Running live on-device inference via Apple Foundation Models (including offline), grounded cloud search and structured JSON via Gemini 3.8 Flash, and seamless firebase-ai-ondevice cloud fallback on a physical Samsung Galaxy S21, all backed by 27 passing automated tests.

What we learned

Match the Routing Mode to the Workload: Hybrid AI works best when you intentionally choose PREFER_ON_DEVICE for private, short, low-latency interactions (Socratic coaching, ELI5, Devil's Advocate, local theme extraction) and PREFER_IN_CLOUD / ONLY_IN_CLOUD for heavy structured generation and live web grounding.

Graceful Fallback Is Essential for Consumer Mobile Apps: Most users don't own the newest flagship hardware yet. Having Firebase AI Logic transparently detect missing on-device capabilities and fall back to Gemini Cloud ensures 100% of users get the full experience from day one.

What's next for Outside - curiosity

Streaming On-Device & Cloud Responses: Upgrade the MethodChannel to an EventChannel so on-device Apple Foundation Models and Gemini Nano tokens stream smoothly word-by-word.

Local Semantic Archive Search: Generate compact on-device summaries and topic embeddings for every completed reflection so users can privately search their personal knowledge archive offline.

Firebase Remote Config Model Management: Drive cloud model names, prompt templates, and hybrid routing defaults remotely via Firebase Remote Config without requiring an App Store or Play Store binary release.

Voice-First Commuter Reflections: Pair on-device speech recognition with the Private Socratic Reflection Coach for hands-free daily journaling on the go.

Built With

Share this project:

Updates

Submission history