> For the complete documentation index, see [llms.txt](https://docs.envector.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.envector.io/1.4.x/sdk-user-guide/encrypted-index.md).

# Encrypted Index

This section covers all aspects of managing encrypted indexes in enVector, from creation to deletion. enVector indexes provide secure, encrypted storage for your vector data while maintaining full search functionality.

## What are enVector Indexes?

enVector indexes are encrypted data structures that store and organize your vector embeddings securely. Unlike traditional vector databases, enVector indexes:

* **Store data encrypted**: All vectors are encrypted using homomorphic encryption
* **Enable encrypted search**: Perform similarity searches without decrypting data
* **Maintain privacy**: Server never sees plaintext data
* **Support metadata**: Store additional information alongside encrypted vectors

## Index Operations Overview

### 1. [Create Indexes](/1.4.x/sdk-user-guide/encrypted-index/creation.md)

Learn how to create new encrypted indexes with various configurations:

* Basic index creation with encryption settings
* Complete working examples with error handling
* Best practices for production deployments

### 2. [Access Existing Indexes](/1.4.x/sdk-user-guide/encrypted-index/access.md)

Discover how to work with indexes already on the server:

* List all available indexes
* Get detailed index information
* Create Index objects for existing indexes
* Examine index contents and properties
* Perform operations on existing indexes

### 3. [Drop/Delete Indexes](/1.4.x/sdk-user-guide/encrypted-index/drop.md)

Safely remove indexes when they're no longer needed:

* Two methods: Index object method and direct API calls
* Safe deletion with confirmation
* Batch deletion for multiple indexes
* Comprehensive error handling and verification

## Key Concepts

### Encryption Modes

* **Index Encryption**: Always "cipher" - indexes are stored encrypted
* **Query Encryption**:
  * "plain" - queries sent in cleartext (faster, less private)
  * "cipher" - queries encrypted (fully private)

### Index Types

* **Flat Index**: Simple, exact similarity search
* **Maximum Dimension**: 4096 (32-4096 supported)

### Search Types

* **IP (Inner Product)**: Similarity scoring using inner product computation

## Quick Start

Here's a basic workflow for working with indexes:

```python
import pyenvector as ev

# 1. Connect to server
ev.init_connect(address="localhost:50050")

# 2. Create an index
index = ev.create_index("my_index", dim=512)

# 3. Insert encrypted data
# ... insert vectors and metadata ...

# 4. Search the index
results = index.search(query_vectors, top_k=10)

# 5. When done, drop the index
index.drop()
```

## Best Practices

1. **Plan Your Dimensions**: Choose appropriate vector dimensions based on your model requirements
2. **Encryption Strategy**: Select query encryption based on your privacy needs
3. **Resource Management**: Always drop indexes when they're no longer needed
4. **Error Handling**: Implement proper error handling for production use
5. **Key Management**: Ensure proper key registration before creating indexes

## Common Use Cases

* **Document Search**: Store document embeddings and search for similar content
* **Image Retrieval**: Find similar images using feature vectors
* **Recommendation Systems**: Build secure recommendation engines
* **Anomaly Detection**: Identify unusual patterns in encrypted data
* **Semantic Search**: Enable natural language search on encrypted text embeddings

## Next Steps

Choose a specific operation from the sidebar to learn more:

* [**Create**](https://github.com/CryptoLabInc/envector-docs/tree/v1.4.6/gitbook/en/user-guide/encrypted-index/broken-reference/README.md): Build new encrypted indexes
* [**Access**](https://github.com/CryptoLabInc/envector-docs/tree/v1.4.6/gitbook/en/user-guide/encrypted-index/broken-reference/README.md): Work with existing indexes
* [**Drop**](https://github.com/CryptoLabInc/envector-docs/tree/v1.4.6/gitbook/en/user-guide/encrypted-index/broken-reference/README.md): Remove indexes safely

For more advanced topics, see the [Data Manipulation](https://github.com/CryptoLabInc/envector-docs/tree/v1.4.6/gitbook/en/data-manipulation/README.md) section to learn about inserting, searching, and retrieving data from your indexes.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.envector.io/1.4.x/sdk-user-guide/encrypted-index.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
