Skip to main content
Image

r/reactnative



You built the app. Now you’re maintaining billing, paywalls, edge cases, and bugs. RevenueCat takes monetization off your plate. Start for free up to $2.5k MTR ->
Image You built the app. Now you’re maintaining billing, paywalls, edge cases, and bugs. RevenueCat takes monetization off your plate. Start for free up to $2.5k MTR ->



Built a production RAG-based document manager with React Native & Expo — sharing the architecture
Built a production RAG-based document manager with React Native & Expo — sharing the architecture

Hey r/reactnative!

I recently shipped 1Shelf, an AI-powered document assistant. I focused heavily on moving beyond simple "cloud storage" to a proactive assistant model. Building the orchestration layer for RAG and proactive insights on mobile was a massive challenge—here is how I structured it:

The Core Architecture:

  • Framework: React Native (Expo Managed Workflow).

  • Search Engine: Hybrid approach. We use Lightning-fast Full Text Search (FTS) for metadata/content and a RAG-based Instant Search for natural language queries.

  • Storage: Offline-first with AES-256 encryption at rest.

  • Cloud: Optional sync with Drive, Dropbox, and OneDrive.

Key Technical Deep-Dives:

  1. RAG & Smart Aggregations: This was the toughest part. For queries like "How much did I spend on hotels in Dubai?", the app doesn't just find the files. It performs extraction insights and currency conversions on the fly based on the user's local currency, feeding that structured data into the RAG context.

  2. Proactive "Spotlight" Logic: Instead of waiting for the user to search, I built a proactive layer. It scans for expiry dates, upcoming events, or financial insights (like a bill due) and triggers "Spotlight" notifications. Orchestrating these background checks was a fun challenge.

  3. The "Smart Trips" Engine: This is a custom pipeline that handles:

    • Clustering: Grouping disparate docs (flights, hotels, tickets) into a single entity.

    • Geo-location & Parsing: Identifying locations and timezones across various document layouts to build a cohesive timeline.

  4. Offline-First as a Requirement: I initially underestimated this, but users expect their sensitive docs (IDs, travel passes) to work in "Airplane Mode." Managing a local encrypted state that stays in sync with multiple cloud providers required some very careful conflict-resolution logic.