Skip to main content

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 database
  • db.create_collection(name, dimension, distance) — Create a collection
  • db.get_collection(name) — Get an existing collection
  • db.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 distance
  • DistanceMetric.EUCLIDEAN — Euclidean (L2) distance
  • DistanceMetric.DOT_PRODUCT — Dot product similarity

Project details


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vexra-1.1.1-cp311-cp311-manylinux_2_34_x86_64.whl (350.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

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

Hashes for vexra-1.1.1.tar.gz
Algorithm Hash digest
SHA256 0fdacf0623ed2403ff0524a79c5f750a8a9d7b036219f5f7b47b7294c2325f37
MD5 cdc9210b5b5d72e8a2463645a890cb48
BLAKE2b-256 b1cef4b8095c20363c22d819b87429f335027cc17ad0a3915395d075fc84198d

See more details on using hashes here.

File details

Details for the file vexra-1.1.1-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for vexra-1.1.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5afe40adb6e7d8804bbeaf34b041af1de8eababf8b50e6ff54cfd36d5e60b3c7
MD5 9e8d25e1018e02607290bc274f4b2f95
BLAKE2b-256 6bbef40589c37606e1c0575cf84d4fb960dd7e851ae0309980521a02fab4de9c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page