upsert() function:
Array2D in C++, see the API Reference.
Adding Items with Contents
It’s also possible to store item contents alongside vectors. To do this, includecontents to the upsert() call.
For Python, the contents field accepts both strings and bytes. For C++, the contents field only accepts bytes. All contents are encoded to bytes and encrypted before storage using the index key, and will be returned as bytes when retrieved with get().
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
This feature is only available in Python. To use it, use
pip install cyborgdb-core[embeddings]embedding_model during index creation, you can automatically generate embeddings for items by providing contents to the upsert() call:
Python
embedding_model will automatically generate embeddings for the contents field. Note that contents must be a string. It will also be converted to bytes for encrypted item storage.
This feature uses sentence-transformers for embedding generation. You can use any model from the HuggingFace Model Hub that is compatible with sentence-transformers.