CyborgDB supports metadata tagging and filtering, enabling fine-grained search filters in addition to encrypted vector search. Metadata, like vectors, is encrypted in use. The backing store holds only ciphertext.
Supported Metadata
The following metadata types are supported:
Boolean
String
List of strings
Numbers (will be stored as fp64)
Adding Items with Metadata
To add items with metadata tags, you can pass a dictionary of key-value pairs to the metadata field during upsert:
# Example datadata = [ {"id": "item_1", "vector": [0.1, 0.1, 0.1, 0.1], "metadata": {"category": "dog"}}, {"id": "item_2", "vector": [0.2, 0.2, 0.2, 0.2], "metadata": {"category": "cat"}}]# Upsert data with metadataindex.upsert(data)
// Example dataconst data = [ {id: "item_1", vector: [0.1, 0.1, 0.1, 0.1], metadata: {category: "dog"}}, {id: "item_2", vector: [0.2, 0.2, 0.2, 0.2], metadata: {category: "cat"}}];// Upsert data with metadataawait index.upsert({ items: data });
import { VectorItem } from 'cyborgdb';// Example dataconst data: VectorItem[] = [ {id: "item_1", vector: [0.1, 0.1, 0.1, 0.1], metadata: {category: "dog"}}, {id: "item_2", vector: [0.2, 0.2, 0.2, 0.2], metadata: {category: "cat"}}];// Upsert data with metadataawait index.upsert({ items: data });
All metadata fields are indexed using encrypted indexing. This allows CyborgDB to securely exclude clusters which don’t match the provided metadata filters. As a result, searches with metadata filter should be as fast or faster than those without.