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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

pyenvector-1.2.1-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.1-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.1-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.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyenvector-1.2.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b84b102e43bcb14802d51bcde98c7d83e3b93ed427b9262c38bc6d75bf70aad9
MD5 367c651b2f3f9d1dac29f2c83c078b6d
BLAKE2b-256 8454e3b20e2092b9296ef42c8aff58fc1e71f6694846ee2af64de550ded9b11d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0f2c40f7e38b22961284d6e8c5dbc34e52839e6b8fa9e76d00f77a62b33840d0
MD5 c4f540ce1307527d56dfed0f55526773
BLAKE2b-256 1cdebf1097b299e591ade45f5edd6baa7ec97ca39e91d2e07e08184c6d664a3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f11943c14db2838c124c2d3480828794f32cdc90c4cbf87ae49f560d6be275ac
MD5 2d9fe01e99136ee6a30060381471b4a9
BLAKE2b-256 a47df5f7440b8703e722c4a392e61ff898efe8efafd93b4a13a2abfcb9144a3d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0a095ba4fc863898e4b71a2fffac0d6f5f288b1aa5cf0d5b0c215599019d3f3b
MD5 78d42a71303eef73bab87f55a9c2226b
BLAKE2b-256 d6a72cf183084fe5b710ac46b15425ec576c83aeb0c954bdabf4517295515662

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 28e672706ad2f311157ce4b76934d3dd27b662d581f450ad34ee73853978c205
MD5 c7985e361016a9f71d867f36fc7df9ad
BLAKE2b-256 516c2896e6247765c8e82d0491f3f9a7e7aaeefad01e54cf8b0767f5562abf27

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7a0efada344fdd99502c8983f4db78b76bbe737b100f2fe4fb9e6c0b3f606a02
MD5 54b54ecd395e61a7294bfdc9ccbf93fe
BLAKE2b-256 3c4e65f3c7f0f8249c7b686c6fe7aa49cd604b3e342fac5a582d0c8ad0ed00c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 de008ba8e68ca2b73fbcb30d03deb453b9eeb9818ff9fe027375f42b89270132
MD5 7f9456c982dc6be582def973790a7c57
BLAKE2b-256 8f73237cc943aa83957ab5ec93de55d200d557bae267f18c15dbf61d1cd4e43a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a4b70279cdf0190d110f61fc03fa5f943a59c20c9f05c68a64fc430fa21ac2f6
MD5 78cb816f5adee4ef4ac05a06ff3437df
BLAKE2b-256 2d3907f6107d54c468be79d4af606f7c7f7cb5df9a3e2ab00a452a669088a538

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cf0d373e4ccdc70a9fb05d75df182a1c6d3d46efed15922d14b2094a6944c840
MD5 3a6fdbc27a0bab9010726f50e66ad6d7
BLAKE2b-256 f65bc1f7b60fdc0321b54687cc18e42894f252eb77ff58b787611b2fe44aff1a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d81233af1cc8f9fd82a045e802ce00b1d1ad5382493ef029c5432f6bc00f1553
MD5 89e25beac23436d0e8ef51399a1d4289
BLAKE2b-256 1811f869b3ad78f64025849c74867b2bca0d1aa7c3e09f4cfe62c8df9b758165

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.1-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0aab9bf243d1ebb7b4bbe9a0e58a8d382f602f3598ef5322bd94a54e3c48743f
MD5 93f5d6ae67daf8352c59bed94a5ab037
BLAKE2b-256 dfa3a5e5ea46f5cbcb3221b205215bb9750b2f3875359f4caca6c7c628eff312

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 acc68e06d507529bac9537daae72cea79369f23cbdb953916b46d07a309bbd6a
MD5 9d1bdcc4cae0ae27d911bd17195525c5
BLAKE2b-256 7281e595b7a6562c2fd719a7a6a7917ed387d91808e9255f6f56296d330e66fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e500fb3ee3a00b7798be812357fe01f00e746abbd7422f50a8a65336bafc12b8
MD5 019d95fbeb45947853807326a4ba0bab
BLAKE2b-256 392765663e8b736a3fafadded95bb6047d4c5db632db6dcee741d38a8c346c81

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.1-cp39-cp39-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d1766c210a93682832dbac9cbe79f2eac343281b7d855671c9d492ec1d36367e
MD5 af34a00b7c01b4166827dd60d0fec3fd
BLAKE2b-256 55d73035439e1730b2eb284d489eb0b333a5723fba1fd9eb73370e475ef5a954

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyenvector-1.2.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f5f67f2c3f038734bd19c98f3660218bfc7038b864b03be2eca1769dfce42267
MD5 bc7bb14ee9a188bc4d2fa3a4ff3ac679
BLAKE2b-256 bf16d394a5668c1642664af87dbaa434e398c20a78820e3c47243eebb2577085

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