Search your phone's photos, screenshots, documents and videos by describing them — on the device, with no account and no server.
Runs Google's EmbeddingGemma 2 locally through LiteRT-LM with NPU acceleration on Snapdragon, Pixel Tensor, and Dimensity — behind one Kotlin Multiplatform core with native Jetpack Compose and SwiftUI apps.
Google Play · App Store · 20s demo video · How it works & benchmarks · free, no ads, no account · Apache-2.0
The demo runs on a sample library, not a real one.
- One search across your files: Photos, screenshots, PDFs, Word docs, spreadsheets, presentations, ebooks and videos. Opens PDFs straight at the matching page and videos at the matching moment. Audio files are currently found by name.
- Hybrid local search: Name, document-text, OCR and photo-label search work right away; the one-time EmbeddingGemma 2 download (388 MB generic, or 447–798 MB chip-specific NPU build) adds search by description and visual similarity.
- System file picker (Android): Search Retriever directly from Android's file picker when attaching files in other apps or websites.
- Browse & organize: Folders, starred files, duplicate finder, and opt-in on-device People grouping (off unless you turn it on).
| Piece | Implementation |
|---|---|
Shared core (core/) |
Kotlin Multiplatform: indexing pipeline, hybrid search, thermal/battery rules, localization |
| Native UI | Jetpack Compose Material 3 (Android, Koin) · SwiftUI (iOS, Kotlin/Native framework) |
| Index | SQLite (SQLDelight): FTS4 + 256-dim int8 Matryoshka vectors with a custom Kotlin/C dot-product kernel |
| Acceleration | NPU on Snapdragon 8 Gen 2 – 8 Elite Gen 5 (SM8550–SM8850: 2.0–2.7× faster embeds than GPU, 6–14 ms query embeds), Pixel Tensor G5/G6 (Pixel 11 Pro Fold: ~350 photos/min pass 1), Dimensity 9400/9500; auto-tuned GPU/CPU elsewhere |
See docs/how-it-works.md for Snapdragon device benchmarks (Galaxy S23–S26), real-library measurements (Pixel 11 Pro Fold, Pixel 8 Pro, iPhone 12 mini), and engineering trade-offs.
File processing, queries and the search index stay on the device, with no Retriever account or backend. Search works offline after the one-time, commit-pinned, SHA-256-verified model download. On Android, Google Play services downloads ML Kit's text-recognition and image-label models (and the face detector if People is turned on), may download additional OCR models for scripts like Chinese or Japanese, and may send Google its own diagnostics (device model, OS and app version, a per-installation identifier, timings and error codes — never your files or text). Cloud file providers may also fetch selected files. Full details in PRIVACY.md.
core/ Shared search, indexing, storage and platform adapters; builds RetrieverCore for iOS
androidApp/ Android UI, background services and system file picker (DocumentsProvider)
iosApp/ SwiftUI app and native Apple adapters (Xcode project)
npu/ Play device-targeted Qualcomm QNN runtime modules (v73/v75/v79/v81)
facepack/ On-demand Play asset pack for opt-in People face recognition
eval/ Synthetic fixtures and optional relevance experiments
scripts/ Verification and optional iOS simulator tools
core and androidApp hold the Kotlin/Android code alongside the native Xcode app, following Kotlin's recommended structure; facepack is a Play asset pack and npu/ holds four code-free Qualcomm runtime feature modules. Retriever coordinates the shared engines; Store owns SQLDelight persistence. Platform sources and extractors supply files and content. Android uses Koin; Swift constructs its services directly. No shared UI module or extra dependency-injection layer is needed.
Keep source changes, indexed content and search visibility consistent: deleted, revised, excluded or
revoked files must not leave stale searchable content. Preserve database migrations and the persisted
app.retriever.IndexWorker class name. The UI calls indexing “processing”; native controls and the
shared mascot honor reduced motion and power saving.
Both apps show words only from core's Strings table (core/src/commonMain/kotlin/app/retriever/core/): one
Kotlin object per language (English.kt is the source), so the compiler keeps every translation complete and each
language writes its own plurals and word order. Words holds the choices between sentences; apps read new words as
Words.strings.x (Swift: Words.shared.strings.x). Each app sets Words.language from the language its own
resources resolved to (Android's language string in values-xx, iOS's first preferred localization).
Only what the OS reads stays in platform files: values-xx/strings.xml, and the String Catalogs for Info.plist,
App Intents and App Shortcuts.
core/fixtures/copy-<tag>.txt is every sentence over a fixed set of inputs per language: English must not change
unless meant to, and the other sheets are what a native speaker reviews. Regenerate them with
./gradlew :core:testAndroidHostTest --tests '*CopySnapshotTest' -Dcopy.write=fixtures. HardCodedCopyTest fails on
a new sentence written into either app's source; core/fixtures/copy-allowlist.txt lists the ones no person sees.
Search filters ("photos from last week") read every language's words from QueryWords.kt: English, Hindi and
Japanese always, the Latin-script others only as the app's language, since their words collide. Filters are kept as
what they mean (DateFilter) and said in the current language. core/fixtures/query-en.txt pins English parsing.
To add a language: copy English.kt to a new object, add its search words to QueryWords, add it to Language, add values-xx/strings.xml and its locale to
res/xml/locales_config.xml, the iOS catalogs' entries and the Xcode project's knownRegions, then write
its sheet. The current translations are machine translations awaiting native review.
Use JDK 25 and Android SDK 37 (build tools 37.0.0). The Gradle wrapper and dependency versions are pinned.
Set ANDROID_HOME or create an untracked local.properties with sdk.dir=/path/to/android/sdk.
Android requires Android 11+ and a 64-bit device. The search model needs at least 4 GB RAM and roughly
388 MB of storage for the generic download; chip-specific models are larger.
./gradlew :androidApp:assembleDebug
./gradlew :androidApp:installDebugFor iOS, open iosApp/iosApp.xcodeproj in Xcode and run the Retriever scheme. For a physical device,
put TEAM_ID=your-team-id in the ignored iosApp/Configuration/Local.xcconfig and select your signing
identity in Xcode. Keep simulator signing enabled so Keychain entitlements work.
scripts/verify.sh # Android/core tests, lint, release APKs, migrations, formatting, notices, 16 KB alignment
scripts/verify.sh --quick # versions, Kotlin formatting and notices
scripts/verify.sh --ios # also compile/test the shared iOS code and run Swift unit tests (macOS/Xcode)Use focused existing tests while developing, for example
./gradlew :androidApp:testDebugUnitTest --tests '*SearchViewModelTest'.
--full adds benchmarks, coverage and bundle ABI validation; combined with --ios, it also runs UI tests.
Formatting uses ./gradlew ktlintFormat and Xcode's xcrun swift-format. No Git hooks are installed.
To inspect newer dependency versions explicitly, run ./gradlew :androidApp:lintDebug -Poutdated.
The iOS tests need the generated local corpus: run eval/make-corpus.sh (Chrome, macOS tools), then
eval/make-media.sh (ffmpeg). scripts/ios-unit-tests.sh RetrieverTests/CopyTests selects a test class;
results are in build/ios-tests/summary.txt. Model-backed simulator checks are optional:
MODELS=/path/to/models scripts/ios-selftest.sh.
./gradlew :androidApp:bundleRelease # build separately from APK tasks
./gradlew :androidApp:assembleRelease
./gradlew :androidApp:installRelease # test the optimized build locallyOutputs are under androidApp/build/outputs/: the app bundle, per-ABI APKs and R8 mapping. Standalone APKs
carry no Qualcomm QNN runtime; Snapdragon phones stay on the GPU unless installed from the bundle
(bundletool --local-testing).
iosApp/Configuration/Config.xcconfig holds the version and build number for both apps: Android reads
MARKETING_VERSION as versionName and CURRENT_PROJECT_VERSION as versionCode. Bump the build number
there before each store upload, and tag the commit after it, e.g. git tag -a v0.2-5 -m "Retriever 0.2 (5)".
Store builds need the Play upload key, kept outside the repo and named in ~/.gradle/gradle.properties.
Without it, release builds use the debug key for local testing, and Play refuses their uploads.
retrieverUploadStoreFile=/path/to/upload-keystore
retrieverUploadStorePassword=...
retrieverUploadKeyAlias=...
retrieverUploadKeyPassword=...fastlane uploads to both stores; neither lane sends anything for review. Its
credentials go in the gitignored fastlane/.env: GOOGLE_PLAY_JSON_KEY_PATH (a Play service account invited
to the app), and IOS_TEAM_ID with an App Store Connect API key (APP_STORE_CONNECT_KEY_ID,
APP_STORE_CONNECT_ISSUER_ID, APP_STORE_CONNECT_KEY_PATH).
bundle exec fastlane android release # bundle, uploaded as a draft production release
bundle exec fastlane ios release # archive, uploaded to App Store ConnectThe bundle carries the R8 mapping and the baseline profile, so Play deobfuscates crashes itself.
The Play Console needs declarations for all-files access (MANAGE_EXTERNAL_STORAGE, on-device file search),
the dataSync foreground service (local file processing, with a video), and photo and video access
(READ_MEDIA_IMAGES/VIDEO, searching the whole library is the core feature), plus a privacy policy URL and
the Data safety form. Check model download, processing and background recovery on physical hardware. A
successful build alone does not establish store approval or device performance.
eval/src contains synthetic documents and generated photos, not user data; keep these fixtures stable.
Benchmarks are opt-in with -Pbench. The custom vector kernel and ranking defaults have measured
reasons to exist; compare device results before replacing them. Relevance rejection remains disabled:
previous calibration did not establish a reliable cutoff. Small-corpus scores do not prove relevance
on a real library.
To regenerate model dumps, set MODELS and PREPARED (containing manifest.json, queries.json and
library/) and run scripts/ios-dump.sh M440 70. Replay with :core:testAndroidHostTest --tests '*RelevanceReplayTest.replayDump' and the relevance.dump, relevance.data, and relevance.out system
properties; python3 -I eval/relevance-fit.py build/fit summarizes the resulting TSVs.
Snapdragon NPU timings: build with ./gradlew :androidApp:assembleDebug :androidApp:assembleDebugAndroidTest -PqnnInApk
and run SnapdragonNpuTest on Firebase Test Lab; results are logged under the NpuBench tag.
Retriever is licensed under the Apache License 2.0. Third-party notices retain the licenses for dependencies, model weights and adapted code; the same notices are included in the app.
The license covers the code, not the name: the Retriever name, app icon and mascot artwork identify the official apps, so a fork published to an app store needs its own name and icon.
