core

All the core components are stored here.

source

VectoyLite

 VectoyLite (path:str)

Initializes the VectoLite instance with a connection to the SQLite database.

Type Details
path str The path to the SQLite database file.

source

VectoyLite.print_version

 VectoyLite.print_version ()

Prints the SQLite and SQLite-vec versions.

VectoyLite("demo").print_version()
sqlite_version=3.46.1, vec_version=v0.1.1

source

VectoyLite.parse_item

 VectoyLite.parse_item (item:Dict)

Parses an item and returns its MD5 hash, serialized contents, and vector. This is mainly meant as an internal method, but there may be times when you want to confirm these manually.

Type Details
item Dict The item to parse.
Returns tuple A tuple containing the MD5 hash (str), serialized contents (str), and serialized vector (bytes).
VectoyLite("demo").parse_item({"hello": "world", "vector": [1, 2, 3]})
('fbc24bcc7a1794758fc1327fcfebdaf6', b'{"hello":"world"}', [1, 2, 3])
VectoyLite("demo").parse_item({"hello": "world!", "vector": [1, 2, 3]})
('a8af219242bb71a1c085ee0c7e16e322', b'{"hello":"world!"}', [1, 2, 3])

source

VectoyLite.insert

 VectoyLite.insert (stream)

Inserts a stream of items into the specified table.

Type Details
stream An iterable stream of dictionaries to insert.
VectoyLite("demo").insert([{"hello": "world!", "vector": [1, 2, 3, 4]}])
a8af219242bb71a1c085ee0c7e16e322 b'{"hello":"world!"}' [1, 2, 3, 4]

source

VectoyLite.query_idx

 VectoyLite.query_idx (query, k=5)

Queries the specified table for the nearest neighbors to the given query vector.

Type Default Details
query The query vector
k int 5
Returns tuple A tuple containing the rowids and distances of the nearest neighbors.

source

VectoyLite.query

 VectoyLite.query (query, k=5)

Queries the specified table for the nearest neighbors to the given query vector.

Type Default Details
query The query vector
k int 5
Returns tuple A tuple containing the inserted items and distances of the nearest neighbors.