A vector store stores embedded data and performs similarity search.

Install dependencies

npm i @langchain/openai

Add environment variables

OPENAI_API_KEY=your-api-key

Instantiate the model

import { OpenAIEmbeddings } from "@langchain/openai";

const embeddings = new OpenAIEmbeddings({
  model: "text-embedding-3-large"
});

Install dependencies

npm i langchain
import { MemoryVectorStore } from "langchain/vectorstores/memory";

const vectorStore = new MemoryVectorStore(embeddings);
LangChain.js integrates with a variety of vector stores. You can check out a full list below:

All vector stores