AddToVectorDatabase

AddToVectorDatabase[db,{vec1,}]

adds a list of vectors veci to the VectorDatabaseObject[] db.

AddToVectorDatabase[db,{vec1,}{val1,}]

adds vector and metadata to the database.

Details

  • AddToVectorDatabase extends an existing VectorDatabaseObject with additional data, expanding the databases storage and search capabilities.
  • Possible values for the data to be added include:
  • {vec1,}a list of vectors
    {vec1val1,}a list of vectors and associated values
    {vec1,}{val1,}a rule between vectors and values
  • Accepted forms of vali include:
  • "string"string labels
    <|"tag1"v1,|>an association of tags and metadata values

Examples

open allclose all

Basic Examples  (1)

Create an empty vector database:

Add vectors to the database:

Scope  (4)

Add a list of vectors to an empty database:

Add a new vector to an existing database:

Add vectors together with simple labels:

Add vectors together with labels in an Association:

Possible Issues  (1)

Vectors added to a database must match the existing dimension:

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

Text

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

CMS

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

APA

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

BibTeX

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

BibLaTeX

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