Skip to content

Storage

Storage in vectorstores works automatically once you’ve configured your vector stores.

Per default a local directory is used for storage. Depending on the storage type (i.e. doc stores or vector stores), you can configure a different persistence layer. Most commonly a vector database is used as vector store.

You can use persistDir to define where to store the data locally.

import { Document, VectorStoreIndex } from "@vectorstores/core";
const document = new Document({ text: "Test Text" });
const index = await VectorStoreIndex.fromDocuments([document], {
persistDir: "./storage",
});