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.2.0.tar.gz (49.7 kB view details)

Uploaded Source

Built Distributions

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

vexra-1.2.0-cp311-cp311-win_amd64.whl (274.0 kB view details)

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

vexra-1.2.0-cp311-cp311-macosx_11_0_arm64.whl (322.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file vexra-1.2.0.tar.gz.

File metadata

  • Download URL: vexra-1.2.0.tar.gz
  • Upload date:
  • Size: 49.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for vexra-1.2.0.tar.gz
Algorithm Hash digest
SHA256 e1566686456f2b8d01722dd561e62bb5a8b8e28f8a767b005afe81af54785f1c
MD5 78c46769e23abbe7b2fb7ab025fbbb6b
BLAKE2b-256 1d5bbcb2466ad5c4b4ba55b98b6b0f6694be00de9592621ebd906c690104c246

See more details on using hashes here.

File details

Details for the file vexra-1.2.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: vexra-1.2.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 274.0 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for vexra-1.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8fbee67f7cfc144bd04764cc8b3227b8eb867a3ac88f1e0820516664d7da0917
MD5 9187cc57b3ca05d4bf072339ca625c03
BLAKE2b-256 3c57dc7bed34d19200fe40f0ea2c34b5647348109fe3c87118b816036a67fd2d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vexra-1.2.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 179c3bb8fbbb1e82b470df92a9bb47b749c1666af55c6f535a34c819912c4862
MD5 d95b4afb86b5c3ac3247789ccd77fbad
BLAKE2b-256 971de65c54cbb2300d520f82f63b1669c18b8356752ee9dd41c7a1b0adbcb2e4

See more details on using hashes here.

File details

Details for the file vexra-1.2.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vexra-1.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c449beb7d6a4bcbef7b105328279fbb1525305cc14823449ef9b755fce5a75a0
MD5 d0df53427373728022cb71f98f1c995b
BLAKE2b-256 cc4c184c9f8936d7c6243cb1e22d4c431dfe957c498818e6827639d36594f2e5

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