asg017 / sqlite-vec

Work-in-progress vector search SQLite extension that runs anywhere.
Apache License 2.0
948 stars 17 forks source link

Does this support mobile and flutter? #6

Open zhubarb opened 1 month ago

zhubarb commented 1 month ago

The only dart/flutter compatible vector db project I am aware of is this: https://github.com/FastCodeAI/DVDB.

I was wondering whether this would support Android / IoS / Flutter?

Specifically, Flutter has the following package: import 'package:sqflite/sqflite.dart' [1]; and I am curious whether this sqlite-vec would be compatible with this?

asg017 commented 1 month ago

Ideally it should work on mobile devices. It's written in portable C, so theoretically you should be able to compile sqlite-vec to work on any mobile device.

I'm unsure about sqflite, however. Is it possible to load sqlite extensions in sqflite? I can't seem to find any examples of that in their documentation. I guess we could compile on own version of SQLite with sqlite-vec builtin, but I'm unsure how the sqflite ecosystem usually handles these things

To be clear: I 100% want sqlite-vec to work on all devices, including Android/iOS/Flutter/Dart etc. But I haven't personally ever done much mobile development in the past. Would be happy to make it work if someone shows me the ropes!

zhubarb commented 1 month ago

Hi Alex, Makes sense, thanks. I think flutter/dart would be good for "two birds-one stone"ing the problem in terms of Android and IoS compatibility.

Regarding the ability to load extensions with sqflite, I found:

  1. https://stackoverflow.com/questions/53351775/loading-json1-extension-with-flutter-sqflite
  2. https://github.com/tekartik/sqflite/issues/105

I will keep digging, and post here if I find a lead.