#sqlite #store #rig #vector #framework #sq-lite-based

rig-sqlite

SQLite-based vector store implementation for the rig framework

1 unstable release

0.1.0 Dec 3, 2024

#1268 in Database interfaces

Download history 151/week @ 2024-12-02

151 downloads per month

MIT license

22KB
357 lines

+ SQLite logo



Rig-SQLite

This companion crate implements a Rig vector store based on SQLite.

Usage

Add the companion crate to your Cargo.toml, along with the rig-core crate:

[dependencies]
rig-sqlite = "0.1.3"
rig-core = "0.4.0"

You can also run cargo add rig-sqlite rig-core to add the most recent versions of the dependencies to your project.

See the /examples folder for usage examples.

Important Note

Before using the SQLite vector store, you must initialize the SQLite vector extension. Add this code before creating your connection:

use rusqlite::ffi::sqlite3_auto_extension;
use sqlite_vec::sqlite3_vec_init;

unsafe {
    sqlite3_auto_extension(Some(std::mem::transmute(sqlite3_vec_init as *const ())));
}

Dependencies

~30–43MB
~720K SLoC