vectoylite

Utility/Quickstart for sqlite-vec.

The goal of this project is to offer a simple way to get started with SQLite-vec. With this project you can:

It also comes with some settings that you can turn on/off:

Install

If that sounds interesting, you can install this project via pip.f

pip install vectoylite

How to use

from vectoylite.core import VectoyLite
db = VectoyLite("another-demo")

Before running anything it is good to observe that we are running modern versions of everything.

db.print_version()
sqlite_version=3.46.1, vec_version=v0.1.1

VectoLite uses pysqlite3 under the hood to install the most recent version of sqlite, which should be compatible with sqlite-vec right out of the box. There may be edge cases, but we have not hit our head sofar.

Now that we have confirmed the version, lets move on to do some basic vector retreival.

# Examples just for illustrative purposes. 
items = [
    {'i': 1, 'vector':[0.1, 0.1, 0.1, 0.1]},
    {'i': 2, 'vector':[0.2, 0.2, 0.2, 0.2]},
    {'i': 3, 'vector':[0.3, 0.3, 0.3, 0.3]},
    {'i': 4, 'vector':[0.4, 0.4, 0.4, 0.4]},
    {'i': 5, 'vector':[0.5, 0.5, 0.5, 0.5]},
]

# Query these examples
query = [0.3, 0.3, 0.3, 0.3]
db.insert(items)

# View the output
results, distances = db.query(query, k=3)
for res, d in zip(results, distances):
    print(res, d)
{'i': 2} 0.0
{'i': 3} 0.19999998807907104
{'i': 1} 0.20000001788139343

At the moment of making this document there is no support for indexes just yet, but folks are working on that.