# US 2026/0303334 A1 · Encrypted embedding search for retrieval-augmented generation applications

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2026/0303334 A1
- Document ID: US20260303334A1
- Status: Published application
- Kind: A1
- Application number: 19/391,299
- Filed: 2025-11-17
- Published: 2026-10-01
- Earliest claimed: 2025-03-25
- Assignees: Mirror Security Limited
- Applicants: Mirror Security Limited
- Inventors: Aditya Kuppa
- Web page: https://patentgrep.com/patent/US20260303334A1

## CPC

- H04L 9/0861: {Generation of secret information including derivation or calculation of cryptographic keys or passwords}
- G06F 16/2228: {Indexing structures}
- G06F 16/282: {Hierarchical databases, e.g. IMS, LDAP data stores or Lotus Notes}
- H04L 9/008: {involving homomorphic encryption}
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Encrypted embedding search for retrieval-augmented generation is provided. A computer-implemented method comprises receiving an encrypted query embedding associated with a search request. The method includes traversing a hybrid search index structure to identify candidate nodes from a plurality of nodes, where each node is associated with a respective encrypted embedding comprising ciphertexts corresponding to elements of an embedding vector. The respective encrypted embedding comprises ciphertexts corresponding to elements of an embedding vector of a plurality of embedding vectors. The method includes performing homomorphic similarity computations between the encrypted query embedding and the respective encrypted embedding associated with each candidate node. The method includes generating similarity scores based on the homomorphic similarity computations and generating a search result corresponding to the search request based on the similarity scores.

## Claims

### Claim 1

A computer-implemented method, comprising:
in a computer system that comprises a processor:
receiving an encrypted query embedding of a query embedding vector associated with a search request;
traversing a hybrid search index structure to identify a set of candidate nodes from a plurality of nodes of the hybrid search index structure, wherein
each node of the plurality of nodes is associated with a respective encrypted embedding of a plurality of encrypted embeddings, and
the respective encrypted embedding comprises ciphertexts corresponding to elements of an embedding vector of a plurality of embedding vectors;
performing homomorphic similarity computations between the encrypted query embedding and the respective encrypted embedding associated with each candidate node of the set of candidate nodes;
generating similarity scores based on the homomorphic similarity computations; and
generating a search result corresponding to the search request based on the similarity scores.

### Claim 2 (depends on 1)

The computer-implemented method according to claim 1, wherein the encrypted query embedding comprises ciphertexts corresponding to elements of the query embedding vector.

### Claim 3 (depends on 1)

The computer-implemented method according to claim 1, further comprising:
retrieving an initial plurality of embedding vectors from a vector database;
preprocessing the initial plurality of embedding vectors through a normalization and transformation pipeline to obtain the plurality of embedding vectors;
encrypting each embedding vector of the plurality of embedding vectors based on a homomorphic encryption scheme to generate the plurality of encrypted embeddings,
wherein the plurality of encrypted embeddings comprises the respective encrypted embedding of each embedding vector of the plurality of embedding vectors; and
constructing the hybrid search index structure comprising a Navigable Small-World Graph (NSW) graph,
wherein the NSW graph comprises the plurality of nodes and edges between the plurality of nodes, and
connectivity information for the edges is in plaintext.

### Claim 4 (depends on 3)

The computer-implemented method according to claim 3, wherein the NSW graph is a hierarchical navigable small world (HNSW) graph,
the plurality of nodes of the HNSW graph is spread across hierarchical levels of the HNSW graph, and
the traversal of the hybrid search index structure is a progressive traversal across the hierarchical levels of the HNSW graph to identify the set of candidate nodes.

### Claim 5 (depends on 3)

The computer-implemented method according to claim 3, wherein the preprocessing comprises:
normalizing each embedding vector of the initial plurality of embedding vectors to a unit length to obtain a plurality of normalized embedding vectors;
applying a scaling transformation based on specific scaling factors to each normalized embedding vector of the plurality of normalized embedding vectors to obtain a plurality of scaled embedding vectors; and
adding a randomization factor from a multivariate normal distribution to each scaled embedding vector of the plurality of scaled embedding vectors to obtain the plurality of embedding vectors.

### Claim 6 (depends on 3)

The computer-implemented method according to claim 3, wherein the homomorphic encryption scheme comprises a fully homomorphic encryption (FHE) scheme based on a Ring Learning with Errors (RLWE) problem.

### Claim 7 (depends on 3)

The computer-implemented method according to claim 3, further comprising selecting the homomorphic encryption scheme based on a data type of the elements in the embedding vector,
wherein the homomorphic encryption scheme comprises at least one of Cheon-Kim-Kim-Song (CKKS) scheme, Brakerski/Fan-Vercauteren (BFV) scheme, Brakerski-Gentry-Vaikuntanathan (BGV) scheme, Fully Homomorphic Encryption over Torus (TFHE) scheme, or Ring Learning with Errors (RLWE) scheme.

### Claim 8 (depends on 3)

The computer-implemented method according to claim 3, further comprising:
sampling discrete Gaussian distributions over a polynomial ring to generate a public key and a secret key; and
encrypting the plurality of embedding vectors based on the public key to generate the plurality of encrypted embeddings.

### Claim 9 (depends on 1)

The computer-implemented method according to claim 1, further comprising:
identifying, from the plurality of encrypted embeddings, a set of encrypted embeddings similar to the encrypted query embedding based on the similarity scores;
applying a homomorphic decryption scheme to the identified set of encrypted embeddings to generate a set of decrypted embedding vectors;
querying a vector database to retrieve a set of context documents associated with the set of decrypted embedding vectors; and
generating the search result further based on the set of context documents.

### Claim 10 (depends on 9)

The computer-implemented method according to claim 9, further comprising:
ranking the set of context documents based on the similarity scores;
selecting at least one context document from the ranked set of context documents;
feeding a neural language model with a prompt to generate response data, wherein the prompt comprises the at least one context document and content of the search request; and
generating the search result based on the response data.

### Claim 11 (depends on 9)

The computer-implemented method according to claim 9, wherein the applying of the homomorphic decryption scheme comprises applying a secret key or a derived secret key to the identified set of encrypted embeddings to generate the set of decrypted embedding vectors, and
the secret key is based on a sampling of discrete Gaussian distributions over a polynomial ring.

### Claim 12 (depends on 1)

The computer-implemented method according to claim 1, wherein the performing of the homomorphic similarity computations comprises:
performing homomorphic dot product operations between the encrypted query embedding and the respective encrypted embedding associated with each respective candidate node of the set of candidate nodes.

### Claim 13 (depends on 12)

The computer-implemented method according to claim 12, wherein each of the homomorphic dot product operations comprises:
an element-wise homomorphic multiplication between ciphertexts of the encrypted query embedding and the ciphertexts of the respective encrypted embedding to generate multiplication results,
a re-linearization of each of the multiplication results based on evaluation keys to generate re-linearized multiplication results, and
a homomorphic addition of the re-linearized multiplication results to generate a respective similarity score of the similarity scores, and
wherein the evaluation keys are based on a sampling of discrete Gaussian distributions over a polynomial ring.

### Claim 14 (depends on 1)

The computer-implemented method according to claim 1, wherein each of the homomorphic similarity computations is performed during the traversal at a respective candidate node of the set of candidate nodes, and
the traversal is based on a priority queue of the set of candidate nodes ordered by the similarity scores.

### Claim 15 (depends on 1)

The computer-implemented method according to claim 1, wherein the identification of the set of candidate nodes is performed without a decryption of the ciphertexts of the respective encrypted embedding and ciphertexts of the encrypted query embedding.

### Claim 16

A computer system, comprising:
a processor configured to:
receive an encrypted query embedding of a query embedding vector associated with a search request;
traverse a hybrid search index structure to identify a set of candidate nodes from a plurality of nodes of the hybrid search index structure, wherein
each node of the plurality of nodes is associated with a respective encrypted embedding of a plurality of encrypted embeddings, and
the respective encrypted embedding comprises ciphertexts corresponding to elements of an embedding vector of a plurality of embedding vectors;
perform homomorphic similarity computations between the encrypted query embedding and the respective encrypted embedding associated with each candidate node of the set of candidate nodes;
generate similarity scores based on the homomorphic similarity computations; and
generate a search result corresponding to the search request based on the similarity scores.

### Claim 17 (depends on 16)

The computer system according to claim 16, wherein the processor is further configured to:
retrieve an initial plurality of embedding vectors from a vector database;
preprocess the initial plurality of embedding vectors through a normalization and transformation pipeline to obtain the plurality of embedding vectors;
encrypt each embedding vector of the plurality of embedding vectors based on a homomorphic encryption scheme to generate the plurality of encrypted embeddings,
wherein the plurality of encrypted embeddings comprises the respective encrypted embedding of each embedding vector of the plurality of embedding vectors; and
construct the hybrid search index structure comprising a Navigable Small-World Graph (NSW) graph,
wherein the NSW graph comprises the plurality of nodes and edges between the plurality of nodes, and
connectivity information for the edges is in plaintext.

### Claim 18 (depends on 16)

The computer system according to claim 16, wherein the processor is further configured to:
identify, from the plurality of encrypted embeddings, a set of encrypted embeddings similar to the encrypted query embedding based on the similarity scores;
apply a homomorphic decryption scheme to the identified set of encrypted embeddings to generate a set of decrypted embedding vectors;
query a vector database to retrieve a set of context documents associated with the set of decrypted embedding vectors; and
generate the search result further based on the set of context documents.

### Claim 19 (depends on 16)

The computer system according to claim 16, wherein the identification of the set of candidate nodes is performed without a decryption of the ciphertexts of the respective encrypted embedding and ciphertexts of the encrypted query embedding.

### Claim 20

A computer-program product, comprising:
one or more computer-readable storage media; and
program instructions stored on the one or more computer-readable storage media to perform operations comprising:
receiving an encrypted query embedding of a query embedding vector associated with a search request;
traversing a hybrid search index structure to identify a set of candidate nodes from a plurality of nodes of the hybrid search index structure, wherein
each node of the plurality of nodes is associated with a respective encrypted embedding of a plurality of encrypted embeddings, and
the respective encrypted embedding comprises ciphertexts corresponding to elements of an embedding vector of a plurality of embedding vectors;
performing homomorphic similarity computations between the encrypted query embedding and the respective encrypted embedding associated with each candidate node of the set of candidate nodes;
generating similarity scores based on the homomorphic similarity computations; and
generating a search result corresponding to the search request based on the similarity scores.
