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.0-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.0-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.0-cp313-cp313-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pyenvector-1.2.0-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.0-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.0-cp312-cp312-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyenvector-1.2.0-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.0-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.0-cp311-cp311-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pyenvector-1.2.0-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.0-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.0-cp310-cp310-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pyenvector-1.2.0-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.0-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.0-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.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fa28e2c71d7157f1be3d812e4ef8d71d37bbe05d7ffabd95c8eeed2269c262ca
MD5 9093c9c3e6e4309a76c0a6afc983b8e1
BLAKE2b-256 7fcce780ddacc82e8c45c806a7f663894b2aa9bcaa1859947156c3157446a597

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 37e451a36a39501603ca6637ead9b41c467a4f2f3cb90b65c62d3fa4f441542c
MD5 d7ee8ed83f1ae854094144884350015c
BLAKE2b-256 e5c6375f87c6dfb2addb96281ca663c3252bcc34c797e56eb93d701144cf161e

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f3e8882f007e32f5faa38e3b0f3960bf0c45eed41c234af8416c6c07f1de8b96
MD5 18773dfd5f8234f7eef8dafc2517d42a
BLAKE2b-256 8e05ed9c081a210a1724be5d1d443dc668fb72ad13f4e518e28c1cc2c8487564

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7ca762e306e710e74be1de3a21cb482c51f25f40c1e9eb3d9c6501a4cd93121c
MD5 62c9f5de41d585c113455c16c2b05864
BLAKE2b-256 a332b576d780f75c3cbebe224eba42bef3d724f4a19623d282a819cd0519254f

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 67ba1e65a939804b251f31051286fa578779a85e8c2162ed1f125c7a0bf373b2
MD5 3f28bf9124670e1c14a8c0cc3d125739
BLAKE2b-256 7b3f6e4b00576ebaac7b7b6f9aa4d51096fc44541b9f31ad9d722b029ba853b8

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7ad140def239fc4ab928f4433cf8edc99ef4f2ee3c492716ef5e8865c849e944
MD5 a86655a251cd571f145c68414e503b20
BLAKE2b-256 5f737949656739b806303d5705b709f4dfb8e71e307c67a5854cd2bd7f45489b

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cf2cae2c0d5494c290cbd6b4a70d5d71a344dbe889f6d4670f817f5a3dd4e4e6
MD5 12ae12c28724383a98d1f55ac1dce884
BLAKE2b-256 e4b67685ca0fcca10e3a201a5414c148c82e7c86e48ebc60c2d5c8218e824521

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8191377e9c02a94f2b60120db78b709cdf940157278afc6381ad5b8f230ec3e8
MD5 9ca7e81e8f60288010e3c5c2de3de93c
BLAKE2b-256 fc9a79735dcf52486660f868f3867f468cba2f24de1242ecf79f666274596a5f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d79480ed1e8bd6a8dbf938f9c3e23dd1b7d5d4c167297f6fdb307cc135828a23
MD5 82daf112434757eb6f41897ab4dcf5b6
BLAKE2b-256 2615d68c885562f4bfa9f210481276b3eaa922b22662a83e12443e84cc9359ee

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cfc891a30401712f42ed0c707a11128fbaf538688ab1b7b8fa387d9feadd3e00
MD5 5b830d3e2787e6a6dbd55056b738bef0
BLAKE2b-256 d8715f680adde9ae6d321fd9664796aedc28949ee2e3e9e12303f05f3eacacdf

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c0e259242230b49059c29e94a2cc219cbafbde15c7df48d390c1b98aa625d01a
MD5 03c61e40bc15a045dca10b65f0888676
BLAKE2b-256 3b4cf19b773eb39a58b2dccb9c763b62e392bf68503815589853e22597a40ae8

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6db9664b166068eb506b497fab3ce8a558116573350339a13755b4fb57899bd3
MD5 97f73cccebc075062cafc304a8c4a57b
BLAKE2b-256 0b4ce53c0d896290c0b81a2b5abcb35485498d3c6d6db0928567d242f0cc6e02

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9ee4b3ddce16b142ffc0e879117b094043c39baa68d749ee36f577de59574fae
MD5 16e5c55c913316e7eaea20a3265a27fd
BLAKE2b-256 a038c4672ae3999b9d53495bc484393d567e6a1cd49a207def187e49a8a466df

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.0-cp39-cp39-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.0-cp39-cp39-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b562d73ae353707c68f968cde46220e37808dae75b24bff141e3f4a8d3e5a4c4
MD5 b511adce29cedbcacbe9508c54a0408e
BLAKE2b-256 ef20ee07a941d108110be77786c17edb1fff898d7871db544aee9b991251e59f

See more details on using hashes here.

File details

Details for the file pyenvector-1.2.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3e54431f6b9a75e56f498419ad319509c8d7622fdc8843f827d3d35069842dd0
MD5 2e98602460dd4031749d55cf129e6d78
BLAKE2b-256 64c604cccd45e8729567739c38afd9c7b4871d5ddb9010b17b285bd9367a899f

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