Vexra Python SDK — embedded vector database
Project description
EmbedDB Python SDK
Python bindings for EmbedDB — the embedded vector database.
Installation
pip install embeddb
Quick Start
import embeddb
# Open or create a database
db = embeddb.Database("data.embeddb")
# Create a collection
col = db.create_collection("docs", dimension=384, distance=embeddb.DistanceMetric.COSINE)
# Insert vectors
col.insert({"id": "doc1", "vector": [0.1] * 384, "metadata": {"title": "Hello"}})
col.insert({"id": "doc2", "vector": [0.2] * 384, "metadata": {"title": "World"}})
# Search
results = col.search(vector=[0.15] * 384, top_k=10)
for hit in results:
print(f"{hit.id}: {hit.score:.4f}")
API
Database
Database(path)— Open or create a databasedb.create_collection(name, dimension, distance)— Create a collectiondb.get_collection(name)— Get an existing collectiondb.close()— Close the database
Collection
col.insert(doc)— Insert a document{"id": str, "vector": [float], "metadata": dict}col.search(vector, top_k=10)— Search for nearest neighbors
Distance Metrics
DistanceMetric.COSINE— Cosine distanceDistanceMetric.EUCLIDEAN— Euclidean (L2) distanceDistanceMetric.DOT_PRODUCT— Dot product similarity
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
vexra-1.1.1.tar.gz
(49.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vexra-1.1.1.tar.gz.
File metadata
- Download URL: vexra-1.1.1.tar.gz
- Upload date:
- Size: 49.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fdacf0623ed2403ff0524a79c5f750a8a9d7b036219f5f7b47b7294c2325f37
|
|
| MD5 |
cdc9210b5b5d72e8a2463645a890cb48
|
|
| BLAKE2b-256 |
b1cef4b8095c20363c22d819b87429f335027cc17ad0a3915395d075fc84198d
|
File details
Details for the file vexra-1.1.1-cp311-cp311-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: vexra-1.1.1-cp311-cp311-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 350.2 kB
- Tags: CPython 3.11, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5afe40adb6e7d8804bbeaf34b041af1de8eababf8b50e6ff54cfd36d5e60b3c7
|
|
| MD5 |
9e8d25e1018e02607290bc274f4b2f95
|
|
| BLAKE2b-256 |
6bbef40589c37606e1c0575cf84d4fb960dd7e851ae0309980521a02fab4de9c
|