Lightweight vector database.
Project description
VectorLiteDB
VectorLite is a simple vector database powered by sentence-transformers
and hnswlib
, designed for efficient storage and search of textual data.
🚀 Quick Install
pip install vectorlite
Usage
Run as api server
-
serve vectorlite
-
Navigate to http://localhost:4440/docs
Run integrated in code
Initialization
from vectorlite import VectorLite
vl = VectorLite()
Adding Data
data = ["Sample text 1", "Sample text 2", "Another example"]
vl.create(data)
Read All Data
all_data = vl.read_all()
To limit the number of records returned:
limited_data = vl.read_all(max_items=2)
Read Specific Data by Index
item = vl.read(1)
Update Data by Index
vl.update(1, "Updated sample text 2")
Delete Data by Index
vl.delete(1)
Similarity Search
results = vl.similarity_search("A related sample text", k=3)
Semantic Search
results = vl.semantic_search("A related sample text", k=3)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vectorlite-0.3.7.tar.gz
(8.1 kB
view hashes)
Built Distribution
Close
Hashes for vectorlite-0.3.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 824d84af41b5436c4a8c92325ef7f3e38c8cf62a5f9bfccf680532c33e050f59 |
|
MD5 | 46e3779aea8f7b092ba379f1f889f9ca |
|
BLAKE2b-256 | 9a7ec1a951c1a3a747775ee99ba5b03a73087ecd33ff0d9b04961cf2b8740f1e |