@mastra/core
Version:
Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.
22 lines (13 loc) • 717 B
Markdown
# 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
```typescript
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.
## Related
- [Vector stores overview](https://mastra.ai/docs/rag/vector-databases)
- [RAG overview](https://mastra.ai/docs/rag/overview)