CreateVectorDatabase

CreateVectorDatabase[]

creates a new empty vector database.

CreateVectorDatabase[{vec1,}]

initializes the database with the collection of vectors veci.

CreateVectorDatabase[{vec1,}{val1,}]

associates the value vali to the vector veci.

CreateVectorDatabase[data,name]

gives the vector database the specified name.

Details and Options

Examples

open allclose all

Basic Examples  (2)

Create an empty vector database:

Create a database with a specific name and initialize it with a list of vectors:

Scope  (5)

Create an empty vector database:

Create a database with a specific name:

Initialize a new vector database with a list of vectors:

Initialize the database with both vectors and metadata:

Specify the metadata as a separate list:

Specify the metadata as an Association:

Options  (10)

DistanceFunction  (1)

Specify a custom distance function for the database:

By default, EuclideanDistance is used:

FeatureExtractor  (1)

Only vectors can be stored in the database; specify a FeatureExtractor that can extract image features:

Search for the closest image to a given one:

GeneratedAssetLocation  (3)

Specify a custom location to store the database:

Retrieve the location:

By default, the database is stored in a local object:

Store the vector database in a file:

Retrieve the location:

Recreate the database from the file reference:

OverwriteTarget  (3)

The database's automatic location is determined by its name:

With default OverwriteTargetAutomatic, a new database name is generated to avoid collisions:

Use OverwriteTargetFalse to perform a strict check:

OverwriteTargetFalse will also prevent reusing the same database name in a different location:

Create a file:

By default, existing files are not overwritten:

Use OverwriteTargetTrue to overwrite the existing file:

Create a database at a specific location:

When generating a database with the same name in a new location, the name will always be updated:

Delete the original database to free the name:

Now the name is available again:

WorkingPrecision  (2)

Specify a custom working precision for the distance computation:

By default, the precision is inferred from the input data:

Specify a precision for an empty database:

Newly added vectors are clipped and/or rounded to fit into the given precision:

Possible Issues  (1)

Only one-dimensional arrays can be stored in the database:

Wolfram Research (2024), CreateVectorDatabase, Wolfram Language function, https://reference.wolfram.com/language/ref/CreateVectorDatabase.html.

Text

Wolfram Research (2024), CreateVectorDatabase, Wolfram Language function, https://reference.wolfram.com/language/ref/CreateVectorDatabase.html.

CMS

Wolfram Language. 2024. "CreateVectorDatabase." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CreateVectorDatabase.html.

APA

Wolfram Language. (2024). CreateVectorDatabase. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CreateVectorDatabase.html

BibTeX

@misc{reference.wolfram_2024_createvectordatabase, author="Wolfram Research", title="{CreateVectorDatabase}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/CreateVectorDatabase.html}", note=[Accessed: 04-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_createvectordatabase, organization={Wolfram Research}, title={CreateVectorDatabase}, year={2024}, url={https://reference.wolfram.com/language/ref/CreateVectorDatabase.html}, note=[Accessed: 04-November-2024 ]}