EmbedDB 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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
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.0-cp311-cp311-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: vexra-1.1.0-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 |
3fb9fe7b0a0938e321636b36aff41697023cc6b2d6197248dc74ae9d84b00513
|
|
| MD5 |
a6f6354bc16cc6f627f66f86f92a21ce
|
|
| BLAKE2b-256 |
9ffcabe2ccdb2d8fd3207487ee7dd20a472c549ac4f7cd7915cec54c064942ec
|