A high-performance, local-first mobile application for document indexing and semantic search. This project allows users to search through personal documents (PDF, TXT, MD) using a combination of traditional keyword matching (BM25) and modern vector embeddings—all processed entirely on-device for maximum privacy.
- Hybrid Search Engine: Combines Full-Text Search (FTS5) with Vector Similarity (RRF) using
op-sqlite. - Native PDF Extraction: High-performance text and page parsing via PDFBox (Android) and PDFKit (iOS).
- On-Device Embeddings: Uses
onnxruntime-react-nativeto generate embeddings locally. - Privacy First: No data leaves the device; all indexing and searching happen offline.
- Smart Chunking: Page-aware document splitting for precise search result navigation.
- Node.js: 18.x or later
- React Native CLI
- Android: Android Studio & SDK (API 21+)
- iOS: macOS with Xcode (15+) and CocoaPods
-
Clone the repository:
git clone <repository-url> cd client
-
Install dependencies:
npm install # or yarn install -
Install iOS Pods:
cd ios && pod install && cd ..
The app uses the multilingual-e5-small model for generating text embeddings. To keep the repository lightweight, the model file is not included and must be downloaded manually.
-
Create the models directory if it doesn't exist:
mkdir -p assets/models
-
Download the quantized ONNX model. You can use the following command (or download it manually from a source like Hugging Face):
# Example: Downloading from a compatible source curl -L "https://huggingface.co/intfloat/multilingual-e5-small/resolve/main/model.onnx" -o assets/models/model_quantized.onnx
Note: Ensure the filename is exactly
model_quantized.onnx. -
Verify you have the following files in
assets/models/:model_quantized.onnx(The file you just downloaded)tokenizer.json(Already in the repo)tokenizer_config.json(Already in the repo)
npx react-native run-androidnpx react-native run-ios- BM25: Classic keyword-based search. Best for finding exact terms and names.
- Semantic: Vector-based search. Best for finding concepts and related meanings even without exact word matches.
- Hybrid: Combined ranking (Reciprocal Rank Fusion). Provides the most balanced results by merging both strategies.
android/&ios/: Native modules for PDF extraction and platform configurations.src/services/: Core logic for Database, Embedding, and Search services.src/screens/: UI components for searching, document management, and results.assets/models/: Tokenizer and ONNX model files.
MIT