-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add support for Sqlite vector store #122
Conversation
4a778a9
to
b39fed1
Compare
Hello, @tarrencev, welcome to the Rig community! We appreciate your pull request. I'll be doing a deeper dive and replicating your sqlite setup locally soon but I had a couple of preliminary comments.
|
e0ed435
to
00265b1
Compare
Hey there, thanks for the response:
In this case, we were using it to efficiently copy the embedding vector to a bytes representation for storage in the db but we can do it safely with a copy.
I've added a reference to the sqlite-vec rust docs for initializing the extension.
Sounds good! |
The failing test here seems to depend on a api token |
Looking into it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! A couple of suggested changes (thanks for adding to the PR after my prelim glance). The unsafe
block makes sense since it's straight from the docs so it should be fine to users of sqlite (the comment helps a lot!)
-
The earlier
zerocopy
usage, I accidentally confused the usage ofzerocopy
with theunsafe
block in the example (which, I didn't see why an extra dep. was needed for an example). I see that you reverted this change already (but I don't see it in the commit history) but I think it's actually fine to use it here. Apologies! -
The failing tests, we'll resolve this soon!
-
We are also pursuing a set of integration tests soon. I think this crate should be fairly straightforward to integrate with that but we'll leave updates for that process in our Discord if you wanted to contribute to the testing effort later!
d6a959e
to
4838e66
Compare
Addressed most feedback, if you feel strongly about extracting queries / columns / etc I can try find time to land that too. |
^ Old response, addressed again later Also, for the Great work on the feedback, this will be a very handy addition as a general replacement for Edit: |
Sounds good! I've updated the PR to pass the embedding model by reference |
Last thing I think is a usage comment on the Lines 23 to 90 in 2cba662
We actually do more of this in the #120 (mongodb gets a usage comment). w.r.t the builder pattern, etc. we'll do a follow-up PR after embeddings get merged. |
0977a05
to
3a4d90b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comments and updates from the embeddings merge are fantastic. I made one comment about the change with un-hardcoding of the table names and such, w.r.t sql injections. Once that is fixed, this should be ready to merge!
New vector store: Sqlite
Description
Sqlite using sqlite-vec
Fixes # (issue)
Resolves #124
Testing
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce your results.
cargo run --package rig-sqlite --example vector_search_sqlite
Checklist:
Notes
I think this might have some conflicts with #120?
Perhaps it would be easiest to merge this first then adapt it in that PR or I can adapt it after that is merged. It seems like it might remove a bunch of the code.