Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKGet startedIntroductionInstallationQuickstartLangChain Expression LanguageInterfaceHow toCookbookLangChain Expression Language (LCEL)Why use LCEL?ModulesModel I/‚ÄãORetrievalDocument loadersDocument transformersText embedding modelsVector storesRetrieversMultiQueryRetrieverContextual compressionEnsemble RetrieverMultiVector RetrieverParent Document RetrieverSelf-queryingTime-weighted vector store retrieverVector store-backed retrieverWebResearchRetrieverIndexingChainsMemoryAgentsCallbacksModulesSecurityGuidesMoreModulesRetrievalRetrieversMultiVector RetrieverOn this pageMultiVector RetrieverIt can often be beneficial to store multiple vectors per document. There are multiple use cases where this is beneficial. LangChain has a base MultiVectorRetriever which makes querying this type of setup easy. A lot of the complexity lies in how to create the multiple vectors per document. This notebook covers some of the common ways to create those vectors and use the MultiVectorRetriever.The methods to create multiple vectors per document include:Smaller chunks: split a document into smaller chunks, and embed those (this is ParentDocumentRetriever).Summary: create a summary for each document, embed that along with (or instead of) the document.Hypothetical questions: create hypothetical questions that each document would be appropriate to answer, embed those along with (or instead of) the document.Note that this also enables another method of adding embeddings - manually. This is great because you can explicitly add questions or queries that should lead to a document being recovered, giving you more control.from langchain.retrievers.multi_vector import MultiVectorRetrieverfrom langchain.vectorstores import Chromafrom langchain.embeddings import OpenAIEmbeddingsfrom langchain.text_splitter import RecursiveCharacterTextSplitterfrom langchain.storage import
It can often be beneficial to store multiple vectors per document. There are multiple use cases where this is beneficial. LangChain has a base MultiVectorRetriever which makes querying this type of setup easy. A lot of the complexity lies in how to create the multiple vectors per document. This notebook covers some of the common ways to create those vectors and use the MultiVectorRetriever.
It can often be beneficial to store multiple vectors per document. There are multiple use cases where this is beneficial. LangChain has a base MultiVectorRetriever which makes querying this type of setup easy. A lot of the complexity lies in how to create the multiple vectors per document. This notebook covers some of the common ways to create those vectors and use the MultiVectorRetriever. ->: Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKGet startedIntroductionInstallationQuickstartLangChain Expression LanguageInterfaceHow toCookbookLangChain Expression Language (LCEL)Why use LCEL?ModulesModel I/‚ÄãORetrievalDocument loadersDocument transformersText embedding modelsVector storesRetrieversMultiQueryRetrieverContextual compressionEnsemble RetrieverMultiVector RetrieverParent Document RetrieverSelf-queryingTime-weighted vector store retrieverVector store-backed retrieverWebResearchRetrieverIndexingChainsMemoryAgentsCallbacksModulesSecurityGuidesMoreModulesRetrievalRetrieversMultiVector RetrieverOn this pageMultiVector RetrieverIt can often be beneficial to store multiple vectors per document. There are multiple use cases where this is beneficial. LangChain has a base MultiVectorRetriever which makes querying this type of setup easy. A lot of the complexity lies in how to create the multiple vectors per document. This notebook covers some of the common ways to create those vectors and use the MultiVectorRetriever.The methods to create multiple vectors per document include:Smaller chunks: split a document into smaller chunks, and embed those (this is ParentDocumentRetriever).Summary: create a summary for each document, embed that along with (or instead of) the document.Hypothetical questions: create hypothetical questions that each document would be appropriate to answer, embed those along with (or instead of) the document.Note that this also enables another method of adding embeddings - manually. This is great because you can explicitly add questions or queries that should lead to a document being recovered, giving you more control.from langchain.retrievers.multi_vector import MultiVectorRetrieverfrom langchain.vectorstores import Chromafrom langchain.embeddings import OpenAIEmbeddingsfrom langchain.text_splitter import RecursiveCharacterTextSplitterfrom langchain.storage import