\nAZURE_OPENAI_API_VERSION="2024-02-01"`,
+ dependencies: "@langchain/openai",
+ },
+ aws: {
+ value: "aws",
+ label: "AWS",
+ default: false,
+ text: `import { BedrockEmbeddings } from "@langchain/aws";\n\nconst ${embeddingsVarName} = new BedrockEmbeddings(${awsParams});`,
+ envs: `BEDROCK_AWS_REGION=your-region`,
+ dependencies: "@langchain/aws",
+ },
+ vertex: {
+ value: "vertex",
+ label: "VertexAI",
+ default: false,
+ text: `import { VertexAIEmbeddings } from "@langchain/google-vertexai";\n\nconst ${embeddingsVarName} = new VertexAIEmbeddings(${vertexParams});`,
+ envs: `GOOGLE_APPLICATION_CREDENTIALS=credentials.json`,
+ dependencies: "@langchain/google-vertexai",
+ },
+ mistral: {
+ value: "mistral",
+ label: "MistralAI",
+ default: false,
+ text: `import { MistralAIEmbeddings } from "@langchain/mistralai";\n\nconst ${embeddingsVarName} = new MistralAIEmbeddings(${mistralParams});`,
+ envs: `MISTRAL_API_KEY=your-api-key`,
+ dependencies: "@langchain/mistralai",
+ },
+ cohere: {
+ value: "cohereParams",
+ label: "Cohere",
+ default: false,
+ text: `import { CohereEmbeddings } from "@langchain/cohere";\n\nconst ${embeddingsVarName} = new CohereEmbeddings(${cohereParams});`,
+ envs: `COHERE_API_KEY=your-api-key`,
+ dependencies: "@langchain/cohere",
+ },
+ };
+
+ const displayedTabs = providers.map((provider) => tabs[provider]);
+
+ return (
+
+
Pick your embedding model:
+
+ {displayedTabs.map((tab) => (
+
+ Install dependencies
+ {tab.dependencies}
+ {tab.envs}
+ {tab.text}
+
+ ))}
+
+
+ );
+}
diff --git a/docs/core_docs/src/theme/VectorStoreTabs.js b/docs/core_docs/src/theme/VectorStoreTabs.js
new file mode 100644
index 000000000000..a8ff549e70db
--- /dev/null
+++ b/docs/core_docs/src/theme/VectorStoreTabs.js
@@ -0,0 +1,105 @@
+import React from "react";
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+import CodeBlock from "@theme-original/CodeBlock";
+import Npm2Yarn from "@theme/Npm2Yarn";
+
+export default function VectorStoreTabs(props) {
+ const { customVarName } = props;
+
+ const vectorStoreVarName = customVarName ?? "vectorStore";
+
+ const tabItems = [
+ {
+ value: "Memory",
+ label: "Memory",
+ text: `import { MemoryVectorStore } from "langchain/vectorstores/memory";\n\nconst ${vectorStoreVarName} = new MemoryVectorStore(embeddings);`,
+ dependencies: "langchain",
+ default: true,
+ },
+ {
+ value: "Chroma",
+ label: "Chroma",
+ text: `import { Chroma } from "@langchain/community/vectorstores/chroma";\n\nconst ${vectorStoreVarName} = new Chroma(embeddings, {\n collectionName: "a-test-collection",\n});`,
+ dependencies: "@langchain/community",
+ default: true,
+ },
+ {
+ value: "FAISS",
+ label: "FAISS",
+ text: `import { FaissStore } from "@langchain/community/vectorstores/faiss";\n\nconst ${vectorStoreVarName} = new FaissStore(embeddings, {});`,
+ dependencies: "@langchain/community",
+ default: false,
+ },
+ {
+ value: "MongoDB",
+ label: "MongoDB",
+ text: `import { MongoDBAtlasVectorSearch } from "@langchain/mongodb"
+import { MongoClient } from "mongodb";
+
+const client = new MongoClient(process.env.MONGODB_ATLAS_URI || "");
+const collection = client
+ .db(process.env.MONGODB_ATLAS_DB_NAME)
+ .collection(process.env.MONGODB_ATLAS_COLLECTION_NAME);
+
+const ${vectorStoreVarName} = new MongoDBAtlasVectorSearch(embeddings, {
+ collection: collection,
+ indexName: "vector_index",
+ textKey: "text",
+ embeddingKey: "embedding",
+});`,
+ dependencies: "@langchain/mongodb",
+ default: false,
+ },
+ {
+ value: "PGVector",
+ label: "PGVector",
+ text: `import PGVectorStore from "@langchain/community/vectorstores/pgvector";
+
+const ${vectorStoreVarName} = await PGVectorStore.initialize(embeddings, {})`,
+ dependencies: "@langchain/community",
+ default: false,
+ },
+ {
+ value: "Pinecone",
+ label: "Pinecone",
+ text: `import { PineconeStore } from "@langchain/pinecone";
+import { Pinecone as PineconeClient } from "@pinecone-database/pinecone";
+
+const pinecone = new PineconeClient();
+const ${vectorStoreVarName} = new PineconeStore(embeddings, {
+ pineconeIndex,
+ maxConcurrency: 5,
+});`,
+ dependencies: "@langchain/pinecone",
+ default: false,
+ },
+ {
+ value: "Qdrant",
+ label: "Qdrant",
+ text: `import { QdrantVectorStore } from "@langchain/qdrant";
+
+const ${vectorStoreVarName} = await QdrantVectorStore.fromExistingCollection(embeddings, {
+ url: process.env.QDRANT_URL,
+ collectionName: "langchainjs-testing",
+});`,
+ dependencies: "@langchain/qdrant",
+ default: false,
+ },
+ ];
+
+ return (
+
+
Pick your vector store:
+
+ {tabItems.map((tab) => (
+
+ Install dependencies
+ {tab.dependencies}
+ {tab.text}
+
+ ))}
+
+
+ );
+}