> Discover all available pages from the documentation index: https://mastra.zisheng.pro/llms.txt # Mastra.getVector() `.getVector()` 方法用于按名称获取 vector store。此方法接受一个 `string` 参数,用于指定 vector store 名称。 ## 使用示例 ```typescript mastra.getVector('testVectorStore') ``` ## 参数 **name** (`TVectorName extends keyof TVectors`): 要获取的 vector store 名称。必须是 Mastra 配置中存在的有效 vector store 名称。 ## 返回值 **vector** (`TVectors[TVectorName]`): 具有指定名称的 vector store 实例。如果未找到该 vector store,则抛出错误。 ## 相关内容 - [Vector store 概览](https://mastra.zisheng.pro/guides/rag/vector-databases) - [RAG 概览](https://mastra.zisheng.pro/guides/rag/overview)