WOLFRAM

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.

gives the vector database the specified name.

Details and Options

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

Create an empty VectorDatabaseObject:

Out[2]=2

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

Out[1]=1

Search the database by similarity:

Out[2]=2

Scope  (5)Survey of the scope of standard use cases

Data Sources  (3)

Create an empty vector database:

Out[1]=1

Create a database with a specific name:

Out[1]=1

Initialize a new vector database with a list of vectors:

Out[1]=1

Metadata  (2)

Initialize the database with both vectors and metadata:

Out[1]=1

Specify the metadata as a separate list:

Out[2]=2

Specify the metadata with tags as an Association:

Out[1]=1

Specify data and metadata separately:

Out[2]=2

Options  (10)Common values & functionality for each option

DistanceFunction  (1)

Specify a custom distance function for the database:

Out[1]=1

By default, EuclideanDistance is used:

Out[1]=1

FeatureExtractor  (1)

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

Out[1]=1

Search for the closest image to a given one:

Out[4]=4

GeneratedAssetLocation  (3)

Specify a custom location to store the database:

Out[1]=1

Retrieve the location:

Out[2]=2

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

Out[1]=1

Store the vector database in a file:

Out[1]=1
Out[2]=2

Retrieve the location:

Out[3]=3

Recreate the database from the file reference:

Out[4]=4

OverwriteTarget  (2)

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

Out[8]=8

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

Out[9]=9

To force overwriting, use OverwriteTargetTrue:

Out[10]=10

Use OverwriteTargetFalse to perform a strict check:

Out[11]=11

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

Out[12]=12

Create a file:

Out[1]=1

By default, existing files are not overwritten:

Out[2]=2

Use OverwriteTargetTrue to overwrite the existing file:

Out[3]=3

WorkingPrecision  (3)

Specify a custom working precision for the distance computation:

Out[5]=5

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

Out[1]=1

Specify a precision for an empty database:

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

Out[2]=2

An empty database is created without an explicit working precision:

Out[1]=1

The value is resolved when data is added to the database:

Out[2]=2

Properties & Relations  (1)Properties of the function, and connections to other functions

A list of scalars is interpreted as a list of one-dimensional vectors:

Out[3]=3

Use an outer list to indicate that the input is a single vector:

Out[4]=4

Possible Issues  (4)Common pitfalls and unexpected behavior

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

Out[1]=1

All arrays in the database should have the same size:

Out[1]=1

The database name is unique:

Out[1]=1

A new database with the same name specification will be created with an incrementing suffix:

Out[2]=2

Use DeleteObject to remove an incorrectly generated VectorDatabaseObject:

Now the name is available again:

Out[4]=4

Alternatively, use the option OverwriteTargetTrue to overwrite the old database:

Out[5]=5

OverwriteTarget -> False will issue an error rather than adding an incrementing number:

Out[6]=6

Create a database at a specific location:

Out[1]=1

A database with the same name in a new location will be created with an incrementing suffix:

Out[2]=2

Delete the original database to free the name:

Now the name is available again:

Out[4]=4
Out[5]=5
Out[6]=6
Out[7]=7
Wolfram Research (2024), CreateVectorDatabase, Wolfram Language function, https://reference.wolfram.com/language/ref/CreateVectorDatabase.html.
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.

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.

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

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

BibTeX

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

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

BibLaTeX

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

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