Skip to main content

A client application for performing encrypted vector search using homomorphic encryption.

Project description

What is enVector?

enVector is a high-performance encrypted vector search service that keeps both your vectors and similarity scores private during computation. The pyenvector Python SDK lets you talk to the enVector server from Python while keeping all sensitive data encrypted end to end.

pyenvector Example

This example walks through the typical pyenvector workflow for encrypted similarity search and vector database operations.


Install and Import

Install the SDK and import it as ev for brevity.

pip install pyenvector
import pyenvector as ev

🔍 Vector Search

1. Initialize enVector

Set up the connection to the enVector server and configure your key material.

ev.init(
    host="localhost",
    port=50050,
    key_path="./keys",
    key_id="quickstart_key",
)

2. Create Index

Create an index before inserting data. Define the index name and vector dimensionality.

index = ev.create_index("quickstart_index", dim=512)

3. Insert Data

Insert vectors into the index. The snippet below generates random 512-dimensional vectors with normalization and metadata.

import numpy as np

# Function to generate normalized random vectors
def generate_random_vector(dim):
    if dim < 32 or dim > 4096:
        raise ValueError(f"Invalid dimension: {dim}.")

    vec = np.random.uniform(-1.0, 1.0, dim)
    norm = np.linalg.norm(vec)

    if norm > 0:
        vec = vec / norm

    return vec

# Prepare sample data
num_data = 10
db_vectors = [generate_random_vector(512) for _ in range(num_data)]
db_metadata = [f"data_{i+1}" for i in range(num_data)]

# Insert into index
index.insert(db_vectors, metadata=db_metadata)

4. Encrypted Similarity Search

Query the index and retrieve encrypted similarity scores that are decrypted on the client side.

query = db_vectors[1]
top_k = 2

result = index.search(query, top_k=top_k, output_fields=["metadata"])
print(result)

🧹 Clean Up

Remove test data and release keys when you are done.

ev.drop_index("quickstart_index")
ev.delete_key("quickstart_key")

Project details


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 Distributions

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

pyenvector-1.2.1a1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pyenvector-1.2.1a1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (3.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

pyenvector-1.2.1a1-cp313-cp313-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pyenvector-1.2.1a1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pyenvector-1.2.1a1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (3.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

pyenvector-1.2.1a1-cp312-cp312-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyenvector-1.2.1a1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pyenvector-1.2.1a1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (3.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

pyenvector-1.2.1a1-cp311-cp311-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pyenvector-1.2.1a1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pyenvector-1.2.1a1-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (3.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

pyenvector-1.2.1a1-cp310-cp310-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pyenvector-1.2.1a1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

pyenvector-1.2.1a1-cp39-cp39-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (3.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

pyenvector-1.2.1a1-cp39-cp39-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file pyenvector-1.2.1a1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.1a1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6cf515474cbfad8062f59dbc81c0585491cbc0d7846ee92b749c8c227bdd28c7
MD5 f0a6d84c89e9edc5c9c40e84369a4c46
BLAKE2b-256 6a3baabd8c21647222ab218cd0c2e4a6eaec75ee9f5d4c9aa2e688fcc2e014b1

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.1a1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.1a1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a6522f08b024175eb5f0c13b47660899975d30409d70eda97dcc87dd3d7d1a3c
MD5 2e3fead8217d458367985031ee6df2fe
BLAKE2b-256 048c4300b473f62919bc52b8d2793fc19a979688230e2729c4296ff617b04e22

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.1a1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.1a1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c2ad8e887f1cceaa440f81088437f624cd673bdd01ede96dbbb715004e7fe25b
MD5 7721032975062a53d2508435d8ded0b6
BLAKE2b-256 23b88ceef4ebdc64da386a79171ef846b6139f875b2f306c540b8d664ba43bb8

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.1a1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.1a1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e80795d19b32163b401f47ba2ae4c51728593f79de8e4fa163704fd69ffb0c36
MD5 c6370c65ad1e8a203c8bbe2edc094d89
BLAKE2b-256 df0e044d28b8addd58edda38ffb4be2e0e83f1ee5bee903b58f02b21c51f795e

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.1a1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.1a1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 27f9d7e32816bd8b9503b4c2fc770de3af9b7fc5b2d6a564a502b1584fabe358
MD5 62284a349d74c722de96b8794967bcc8
BLAKE2b-256 4cc39250ab12520ca01897953e053ac97abfc0d3f5bf2bb53e626899a8d965a6

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.1a1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.1a1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9b05a0498152ce0a4c8a38da6c9c907298554dd71a9a53df6f900ec2c0ef9af9
MD5 3ecd7b58b8df99641119e6d73b6f06c2
BLAKE2b-256 aa2927e5f8a321695938cdbb52e89f3b24752a92d554213030cb0977c1787fa0

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.1a1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.1a1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a7ec00368c3220d4d63822bb48c33ea31e15ca7d85efd615cf70cbf9c3ea1cc8
MD5 a34f7867bbac79489ca1a406f6f99521
BLAKE2b-256 7e8eafdf8d012b4d12d85674adc93ba39f07db646ac7e52c8618201e651d0636

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.1a1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.1a1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 f4c6efc996424c6b468547e74c3769e8810b67f526a847859e006ecab68ac94a
MD5 7b2ec0f1c0bb836bd8f451bc01801451
BLAKE2b-256 37adfc27d53624159238f9dc22e01e674f9cb55b1f833d662735bd7fe2503cd2

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.1a1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.1a1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 957ce9206750d4bf209faaecd54af707c7f2bb3191656bc982db762f36c79e7e
MD5 22c6489daed50fb982df4b301f51728a
BLAKE2b-256 e8e5f2aaaa0c06f054aecf308c6c50ef81685e7090f8249be7e91a556172a79a

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.1a1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.1a1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 40e7dc8302dff8fbe47b2c1503bbf980884b78a93750d7a2ef402206d25f198d
MD5 1cfaccce9d934f3250675c71d974464a
BLAKE2b-256 fe2fbdd3ffdf2f662d8f22c3f31fc75913e46e7e9beb778530520b889422d136

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.1a1-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.1a1-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a47c6ff8a152bb39c54d1171824829d8dbd961a2dbcabc0d595c1388bbed07d2
MD5 abf30881fd61dd4dc335be5edc26e943
BLAKE2b-256 7feb50de9d8878fe126c7daaa79931029dd79fc7f12aca5a47f936ba850976e6

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.1a1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.1a1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ada886eb0c30bbddd556f5c6ca950cb5649ab0b72456a3be2defa151ffe0940d
MD5 50bc906e3676df472178059d838faafd
BLAKE2b-256 3d493294b563d4859730281c2d9b9c7389e0c6ebd9062e1f4004f8005e0f0a14

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.1a1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.1a1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ee766a602a6dae1f95a2a0e3810288d026eeebcc927a58a9eac417f6df9f49d5
MD5 9808a535cec1bb0cde52e7fbf3e8e1ec
BLAKE2b-256 d4e10d15ec31e8af2238d1b2c21a2fabf0eeb299e5397aa68d163ec4203fd19f

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.1a1-cp39-cp39-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.1a1-cp39-cp39-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2ffb2e5696d9a244b78bb1eb0ea64273ddef36001cdd412d3ddec5cdca7b7463
MD5 0a9bdae9125a3b5d65b6c9cb5de76c3b
BLAKE2b-256 2e9d27eae2886367e1a67628dd84f6e3a080b0d6ee53a55981f39d2376805d34

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.1a1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.1a1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 02b439a448ae4a3cfbcc087fb093f9dd6ecf150dd235f9b88dcac8ac33663827
MD5 a18e700ede31f420329df927551e65ba
BLAKE2b-256 95bca90e4201ae7b53d8b3178e0474d094d4cedb027e55654b1b8c83b8d51f85

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