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.0b2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (3.5 MB view details)

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

pyenvector-1.2.0b2-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (3.3 MB view details)

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

pyenvector-1.2.0b2-cp313-cp313-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pyenvector-1.2.0b2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (3.5 MB view details)

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

pyenvector-1.2.0b2-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (3.3 MB view details)

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

pyenvector-1.2.0b2-cp312-cp312-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pyenvector-1.2.0b2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (3.5 MB view details)

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

pyenvector-1.2.0b2-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (3.3 MB view details)

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

pyenvector-1.2.0b2-cp311-cp311-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pyenvector-1.2.0b2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (3.5 MB view details)

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

pyenvector-1.2.0b2-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (3.3 MB view details)

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

pyenvector-1.2.0b2-cp310-cp310-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pyenvector-1.2.0b2-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (3.5 MB view details)

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

pyenvector-1.2.0b2-cp39-cp39-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (3.3 MB view details)

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

pyenvector-1.2.0b2-cp39-cp39-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file pyenvector-1.2.0b2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.0b2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b82dd40625ed74cb5b6ec3400a3cf83fa10b57a8323aa6bd5e383d6555304015
MD5 eee37fe07117000f2d6b38859fe1b1d8
BLAKE2b-256 10ff1088a7cd92550922a118643b88836d747f11a9794aba3c9ba14a47666018

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.0b2-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6bbddca5bbea40310d578f1325053656c58bc5d75aad1cd58de3fcf6c4d75741
MD5 f570948f086d084c40521b649701e60c
BLAKE2b-256 89a2ec5b9f39ad8c40223142ba653d94a657cbade27821d13235f70a8737191f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.0b2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 310f35bdd950e6ae811243f07e2be9dc35d00aa5081118d5bef69db3160765d8
MD5 eef6d3bcbe6ad71bee34160ece042166
BLAKE2b-256 17eaa517458dec83e1f1a5dc80cce3f25c8eed4ce18c17fc7c437d2029dbe0a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.0b2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 07c71c879d6bc7b3d13b719cd933b0a0109b7c18bf4673d3bd919e76f8bda345
MD5 8eea22388fbb6b264ecea1c2ce402d68
BLAKE2b-256 56e504779b3f0c191c1e3c9dad9975ab158422ac055c4f5205e39945a6b5f61c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.0b2-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4f2cf4ff4b57a714b12e5799f1473afc77dc102fde5ea6fbe71c9661c89cdcf9
MD5 0eaeaf9603447ec2b9ebd294f3197e31
BLAKE2b-256 8a7d08fe593bcf960adadcb0c9a1c1976ba089645cb122dfc00a2291b8c4dbd9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.0b2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ee80516998924854ae9b03c39145dfe6070a77f37256c3ec1d845e7fdaea7903
MD5 8f96f90995fc1500ca7b3ef0bb661efe
BLAKE2b-256 53e96f013282234c9140c2de07c0d91c853b4038b2d69a3dbb6ceb9cc17185da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.0b2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2a8b775fe4751968d68b5d9c6d5a3266b4745acdd75e76e94aadb3ecb9b486d8
MD5 739d6988819fc5f33ee5d4f5d42afcc9
BLAKE2b-256 fb8d947b8cfdee94a5946f7921f0497ba258b098f6c7611b4d44dfcaf783b6cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.0b2-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d1444e5ee7847afe0d5363d95cfba23df456f12d8e1a42bb64bf2ddbf3107ec7
MD5 f9025d0ae9229d910a029b65ae85a614
BLAKE2b-256 3964c65cde646ee0142eea67cbc679e5207d23fbbb2f6ae8ae88cbbe6b9d8c40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.0b2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8d1ab4b9a05308a1efda4f1278e21524593d3ccffc5859ede0e5dd58bb8fab54
MD5 7ca32d905e625d8a0aa5e567a8d7f0a9
BLAKE2b-256 6b0102e1965cb2e6e62dd92e5fb27964456afd5ec19b02170650fb2e0775e16b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.0b2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c87dbe7dc011f2ee6b019a6358187d8f0f51aea0aea0b3f00f078fd13a9afc5b
MD5 5cb3da591f035bc19978fc5d337e97a2
BLAKE2b-256 ff48ab833a23ac35cffae82c4adcc7210463e113b7bc789f5fdac879d5fbbeb7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.0b2-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a74860002a87d2dce7dbaaaa9ef0e434625e0517e7da56abc100bff57637b397
MD5 6a1f31e03599bd5cf8656b12345c32b1
BLAKE2b-256 bd9527b2d810a221a18e572981d656d2222506c1a853f6ee264ccd448597de7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.0b2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 063b5b64aec1a68ddcc00a92b77d51f6398d5560bbcf6efec252eeddbd46de7f
MD5 7ca2c4929e84c975cf597f76acb20387
BLAKE2b-256 eb0ebb878305fcb2ad54b26de414c41c0dd7d9d96011f3e79873a0b8363ee0fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.0b2-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 23abb58ee4b1b002a8eb140eef1315f704a2ecfa1d2a468dcde3067308083fa5
MD5 b99b54b41446efe811e2b1c576bf5bc1
BLAKE2b-256 a3b246c37447a0892a1b40c09cb5b5fc74883c68edede1eca74ebd6bd1bcfc98

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.0b2-cp39-cp39-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 83fda7da8c0ff0d4034620ab58a8aa30a1341ef25d608864a6d888190ec75c88
MD5 ebf4032d39e0bc9d19312035aa438151
BLAKE2b-256 797a953e12729aeeb2e77912b3fa11215ec40e3570ba4e58ba2c603bcfad4816

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.0b2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8cfbefba20dd55fa1cc94351ef7750e173b3c0e082cf22dd9d97a27000f4f766
MD5 01d98bd359d7f5161deb97dc5cdc9308
BLAKE2b-256 87ca8a7673efc6e23875e9e4500b0222b558e166b3f337cbf6b593e333c8e2cb

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