upsert() function:
Adding Items with Contents
It’s also possible to store item contents alongside vectors. To do this, includecontents in the upsert() call.
The contents field accepts both strings and bytes. Bytes are automatically base64-encoded before encryption, while strings are passed as-is. All contents are encrypted before storage using the index key. In Python, contents are returned in their original format (string or bytes) when retrieved with get(). In JavaScript/TypeScript, contents are returned as Buffer. In Go, contents are returned as []byte.
Adding Items with Metadata
CyborgDB also supports metadata storage, retrieval and filtering. To add metadata to an item, includemetadata in the upsert() call.
All metadata fields will be encrypted using the index key.
Automatic Embedding Generation
To use automatic embedding generation, use the Docker Service or install with
pip install cyborgdb-service[embeddings]embedding_model during index creation, you can automatically generate embeddings for items by providing contents to the upsert() call:
embedding_model will automatically generate embeddings for the contents field. The contents will also be stored alongside the generated embeddings.
This feature uses various embedding models available through the service. You can use any model supported by the CyborgDB service, including models from the HuggingFace Model Hub.