Mastra.getVector()
The .getVector()
method is used to retrieve a vector store by its name. The method accepts a single string
parameter for the vector store’s name.
Usage example
mastra.getVector("testVectorStore");
Parameters
name:
TVectorName extends keyof TVectors
The name of the vector store to retrieve. Must be a valid vector store name that exists in the Mastra configuration.
Returns
vector:
TVectors[TVectorName]
The vector store instance with the specified name. Throws an error if the vector store is not found.