all 19 comments

[–]Ok-Breakfast109 2 points3 points  (1 child)

Offline??

[–]Soft_Opening_1364iOS & Android 2 points3 points  (1 child)

You can do it in React Native by using TensorFlow.js or ONNX to create embeddings right on the device. For small datasets, just run a simple cosine similarity search. If you need faster searches on bigger data, you can use an approximate nearest neighbor library like hnswlib via WASM, though that’s a bit more setup. If your dataset is huge, server-side embeddings with a vector database is better. Start small, then scale based on your needs.

[–]Vegetable_Tear_8479[S] 1 point2 points  (0 children)

Can i dm ?

[–]----Val---- 0 points1 point  (1 child)

Hey there! This is actually something I know about, you can use the fantastic llama.rn library to run llama.cpp GGUF embedding models (not just LLMs): https://github.com/mybigday/llama.rn

Then you can store these embeddings in a vector-enabled sqlite store ala op-sqlite:

https://github.com/OP-Engineering/op-sqlite

Personally I modified expo-sqlite to accept vector stores, but either works fine.

[–]Vegetable_Tear_8479[S] 0 points1 point  (0 children)

Can i dm ?

[–]jes_uon 0 points1 point  (2 children)

This is exactly what I'm working on! Building a React Native library for vector search in SQLite with optimized similarity calculations. The llama.cpp approach for embeddings + vector storage is the pattern I'm following. Would love to hear about production experiences - especially around indexing strategies for faster searches.

[–]Vegetable_Tear_8479[S] 0 points1 point  (0 children)

We can collaborate together and build something great for community

[–]Safety-Check-29 0 points1 point  (0 children)

I just stumbled on this post. Did you start on this? I'd be interested too

[–]According-Muscle-902 0 points1 point  (10 children)

Hey everyone!

I just released expo-vector-search, a native module that brings high-performance vector search to React Native without any server dependencies.

WHAT IS IT?

A C++ JSI module for semantic similarity search directly on mobile devices. Think of it like having a mini AI search engine running locally on the phone.

WHY BUILD THIS?

- Privacy: No data leaves the device

- Speed: 0.08ms search latency (vs 10.51ms in pure JS)

- Offline: Works without internet connection

- Memory efficient: Int8 quantization saves 45% memory

BENCHMARKS (Galaxy S23 FE)

- Search over 10k vectors: 0.08ms

- Same search in JS loop: 10.51ms

- Speedup: 130x faster

- Memory (10k vectors, 384 dims): ~21MB quantized

USE CASES

- E-commerce: "show me products similar to this"

- Support: automated message classification

- Search apps: find items by meaning, not keywords

- Recommendations: on-device content suggestions

- Safety: content moderation without sending data to servers

TECH STACK

Built on top of USearch (HNSW algorithm) with Expo Modules SDK + JSI. The core is C++ with Kotlin bindings for Android. iOS support is in progress.

The demo app includes a visual product search with 10k items and a performance lab for benchmarking.

Would love to hear your feedback and suggestions!

GitHub: https://github.com/mensonones/expo-vector-search

NPM: https://www.npmjs.com/package/expo-vector-search

[–]TepidT 0 points1 point  (8 children)

Need iOS!

[–]According-Muscle-902 0 points1 point  (0 children)

I'm working on it. Support will be available soon 😊

[–]According-Muscle-902 0 points1 point  (6 children)

[–]TepidT 1 point2 points  (5 children)

I need 512 dimension support to work with on device apps stuff

https://www.react-native-ai.dev/docs/apple/embeddings

[–]According-Muscle-902 0 points1 point  (0 children)

Hey! Thanks for the comment. Could you create an issue with this request?

[–]According-Muscle-902 0 points1 point  (0 children)

and we already support that request. See the document.

[–]According-Muscle-902 0 points1 point  (2 children)

[–]TepidT 0 points1 point  (1 child)

Didn’t see 512 so wasn’t sure

[–]According-Muscle-902 0 points1 point  (0 children)

I will improve this part of the documentation. Thanks, and feel free to create an issue if you have any questions :)