PocketOps AI — Your Offline-First AI Troubleshooting Partner
INSPIRATION:
When something breaks—a car on a remote highway, a cooling pump in a basement, or an electrical system during a power outage—immediate technical guidance can make all the difference. Yet, these are precisely the situations where internet connectivity is often unavailable or unreliable.
Most AI-powered assistants depend heavily on cloud connectivity, leaving users without help when they need it most.
We built PocketOps AI to bridge this gap: an offline-first AI troubleshooting assistant that delivers intelligent, actionable diagnostics even without an internet connection. Powered by Gemini Nano for on-device inference and Gemini Flash for cloud-based intelligence, PocketOps AI adapts to the user's connectivity and needs, ensuring reliable assistance anywhere.
WHAT IT DOES:
PocketOps AI transforms natural-language descriptions of technical problems into structured, step-by-step troubleshooting guides.
⚡ On-Device Diagnostics with Gemini Nano: Diagnoses technical problems locally using Gemini Nano, enabling private, low-latency assistance without relying on an internet connection, when the local model is available.
☁️ Advanced Cloud Intelligence with Gemini Flash: Seamlessly leverages Gemini Flash through Firebase AI Logic for more complex troubleshooting, deeper analysis, and cloud-powered multimodal capabilities when connectivity is available.
🔄 Interactive Troubleshooting Threads: Every issue becomes an ongoing troubleshooting session. If a suggested fix doesn't work, users can select "Didn't work?" to receive updated instructions based on the previous steps and conversation context.
🏷️ Transparent AI Execution: Every response clearly identifies where it was generated, displaying labels such as "Generated locally · Gemini Nano" or "Generated in cloud · Gemini Flash."
💾 Offline-First Storage & Cloud Synchronization: Troubleshooting guides are stored locally using IndexedDB, making saved solutions accessible offline. When connectivity returns, records synchronize with Cloud Firestore.
🛡️ Intelligent Fallback System: If internet connectivity is unavailable and the local AI model cannot be used, PocketOps AI falls back to keyword-based matching against previously saved troubleshooting guides, ensuring users aren't left without assistance.
HOW WE BUILT IT:
We built PocketOps AI using a modern web stack and Firebase's hybrid AI infrastructure.
Firebase AI Logic SDK (firebase/ai): Our core AI integration, enabling a unified interface for on-device Gemini Nano and cloud-based Gemini Flash, with structured JSON generation for consistent troubleshooting outputs.
Hybrid AI Router: A custom routing engine that evaluates connectivity, local model availability, prompt complexity, and user preferences to determine the best inference runtime.
Firebase App Check: Integrated with reCAPTCHA Enterprise to help protect Firebase services and AI endpoints against unauthorized access and abuse.
Cloud Firestore: Provides cloud-backed storage and synchronization of troubleshooting records across devices.
Firebase Authentication: Supports anonymous sign-in for frictionless onboarding and Google Authentication for account linking and cross-device synchronization.
Firebase Remote Config: Allows us to dynamically adjust cloud model settings, system instructions, and routing thresholds without requiring a new deployment.
Frontend Stack: Built using React 19, TypeScript, Vite, and Tailwind CSS for a responsive, modern user experience.
Progressive Web App (PWA): Implemented using Workbox Service Workers to support installation, offline caching, and resilient access to the application.
Firebase Hosting: Used to deploy and serve the web application.
Intelligent Hybrid Routing
PocketOps AI dynamically selects the appropriate AI runtime based on the current environment and user preferences.
Supported routing preferences include:
prefer_on_device — Prioritizes local inference while allowing cloud fallback.
only_on_device — Restricts inference to the local model.
prefer_in_cloud — Prioritizes cloud inference while allowing local fallback where supported.
only_in_cloud — Restricts inference to the cloud model.
This architecture enables PocketOps AI to balance privacy, responsiveness, availability, and diagnostic depth.
CHALLENGES WE RAN INTO:
- Schema Consistency Across Local and Cloud Models
Ensuring that Gemini Nano and Gemini Flash produced consistent structured outputs was challenging. We needed a unified schema for probable causes, confidence levels, safety precautions, and troubleshooting steps to ensure that responses remained compatible with the frontend.
- Offline-First State Synchronization
Managing local data and cloud synchronization required careful architecture. We implemented IndexedDB-based persistence and queued synchronization mechanisms to ensure that troubleshooting records remained accessible offline and could be synchronized when connectivity was restored.
- Graceful Degradation
We wanted to eliminate dead-end experiences. When connectivity was unavailable and the local model wasn't ready, the application needed to remain useful. This led us to implement a fallback system that retrieves relevant previously saved guides through intelligent keyword matching.
- Hybrid Model Routing
Balancing local model availability, connectivity, user preferences, and cloud access required building a routing layer that could make intelligent decisions at runtime without disrupting the user experience.
WHAT WE LEARNED:
Building PocketOps AI taught us that hybrid AI is not simply about choosing the most powerful model—it's about choosing the right runtime for the situation.
Integrating Firebase AI Logic with on-device inference opened up possibilities for privacy-conscious, offline-capable applications. We learned how local inference, cloud intelligence, persistent storage, and intelligent routing can work together to create applications that remain useful even under unreliable network conditions.
We also gained valuable experience building offline-first applications, managing asynchronous synchronization, handling structured AI outputs, and designing resilient user experiences.
What's Next for PocketOps AI?
Android Support: Bringing PocketOps AI to Android using Gemini Nano and extending the hybrid architecture to mobile environments.
Visual Diagnostics: Expanding multimodal capabilities to support component identification, equipment inspection, and analysis of multimeter readings through images.
Collaborative Fleet Workspaces: Enabling maintenance teams to share troubleshooting records, repair histories, and resolution notes across their devices.
Growing Offline Knowledge Base: Building a richer collection of cached troubleshooting guides that improves fallback usefulness when neither cloud nor local inference is available.
Context-Aware Diagnostics: Improving troubleshooting recommendations based on equipment type, previous repair attempts, and user-provided observations.
OUR VISIONl:
We envision a world where technical assistance is always accessible, regardless of connectivity.
PocketOps AI brings intelligent troubleshooting out of the cloud and into the real world—where problems happen.
Built With
- cloud-firestore
- firebase
- firebase-ai-logic
- firebase-app-check
- firebase-authentication
- firebase-hosting
- firebase-remote-config
- gemini-flash
- gemini-nano
- pwa
- react
- tailwind-css
- typescript