Inspiration

The documents that matter most (an equipment manual, an insurance policy, a research paper, a field guide) are usually needed exactly when you have no signal, or when you'd rather not upload them to someone else's server. Chat assistants are great until you're offline, and they will happily invent an answer your document never gave. We wanted the opposite: ask your own documents, get an answer that shows where it came from, and never have anything leave the phone.

What it does

Pepper: Offline Doc Search is a private, fully offline question-answering app for Android.

  • Sourced answers, offline. Ask a question in plain language. Pepper retrieves the relevant passages, writes a short answer on-device, and shows a confidence level plus the exact source passage behind it. Airplane mode is fine.
  • Bring any PDF, privately. Import a PDF and it is parsed, chunked and indexed on the phone. The document never leaves the device.
  • It says "Insufficient evidence" instead of guessing. If your documents don't cover a question, Pepper tells you so rather than making something up. Precision beats a confident wrong answer.
  • Reference packs and offline maps. Download free public-domain reference packs and offline map regions, then search them with no connection.
  • Pepper Plus. One subscription unlocks the app: $4.99/month or $39.99/year, with a 14-day free trial. Purchases are tied to your account, so restoring on a new phone takes one tap.

How we built it

  • Kotlin + Jetpack Compose, Hilt, Room and WorkManager.
  • Hybrid retrieval on-device: SQLite FTS5 keyword search fused with vector search (ONNX Runtime sentence embeddings), then an on-device cross-encoder reranker picks the best passages.
  • On-device generation with Gemini Nano through the ML Kit GenAI Prompt API, grounded strictly in the retrieved passages, with an abstention path when the evidence is weak.
  • PDF ingestion with pdfium: format-specific cleanup and sentence-aware chunking, all on the phone.
  • RevenueCat on top of Google Play Billing for the subscription: offerings, a 14-day trial offer on the base plan, entitlement checks that also work offline after a cold start, and restore/manage from Settings. Sign-in (Auth0) comes before purchase, so every purchase is keyed to an account and never lost to an anonymous ID. Our pack-download signer also checks the entitlement server-side.
  • MapLibre for offline maps.

Challenges we ran into

  • Retrieval quality on arbitrary documents. A retriever tuned on one corpus falls apart on "bring your own" documents. We built an evaluation harness that runs the real on-device pipeline against the real device database, and used it to find the actual bottlenecks: oversized chunks diluting matches, a missing FTS5 build on Room, and a reranker too shallow when quantized.
  • Honesty over fluency. A small on-device model will always produce something. Getting it to reliably say "insufficient evidence" instead meant building an explicit evidence gate, and accepting fewer answers in exchange for far fewer wrong ones.
  • Phone constraints. Memory, heat, 16 KB native page alignment on Android 16 (we rebuilt SQLite from source for it) and model latency. Time-to-first-token dropped from about 7 to 8 seconds to about 2.
  • Shipping. A first-ever Play release under a brand-new organization account, a whole-app paywall that still had to work for reviewers and judges (hence the 14-day trial and a dedicated reviewer account), and a release pipeline built from scratch inside the Shipaton window.

What we learned

  • Measure on the device, with the device's data. Laptop results and fixtures lied to us more than once.
  • For a paywalled utility, sign-in before purchase plus RevenueCat entitlements removes a whole class of "I paid but it's locked" support problems.
  • A clear "I don't know" builds more trust than a clever answer.

What's next

  • An iPhone version, coming soon.
  • Stronger downloadable models: an option to download larger on-device models for a richer offline chat-with-AI experience.
  • Better search results from an improved retrieval algorithm.
  • Images in search results, so figures, diagrams and photos from your documents show up alongside the text that answers you.

Built With

  • android
  • auth0
  • gemini-nano
  • google-play-billing
  • hilt
  • jetpack-compose
  • kotlin
  • maplibre
  • ml-kit
  • onnx-runtime
  • pdfium
  • revenuecat
  • room
  • sqlite
Share this project:

Updates

Submission history