haive.core.engine.retriever.providers.MultiVectorRetrieverConfig¶
Multi-Vector Retriever implementation for the Haive framework.
This module provides a configuration class for the Multi-Vector retriever, which stores multiple vectors per document to enable more nuanced and accurate retrieval by representing different aspects or summaries of each document.
The MultiVectorRetriever works by: 1. Storing multiple vector representations for each document (summaries, chunks, etc.) 2. Retrieving documents based on these multiple vector representations 3. Supporting different indexing strategies (by summary, by chunks, by hypothetical docs) 4. Providing flexible mapping between vectors and source documents
This retriever is particularly useful when: - Documents have multiple aspects that should be searchable separately - Need to index both summaries and full content - Want to improve retrieval precision with multi-faceted representations - Building systems that need granular document understanding
The implementation integrates with LangChain’s MultiVectorRetriever while providing a consistent Haive configuration interface with flexible vector storage.
Classes¶
Configuration for Multi-Vector retriever in the Haive framework. |
Module Contents¶
- class haive.core.engine.retriever.providers.MultiVectorRetrieverConfig.MultiVectorRetrieverConfig[source]¶
Bases:
haive.core.engine.retriever.retriever.BaseRetrieverConfigConfiguration for Multi-Vector retriever in the Haive framework.
This retriever stores multiple vectors per document to enable more nuanced and accurate retrieval by representing different aspects of each document.
- retriever_type¶
The type of retriever (always MULTI_VECTOR).
- Type:
- vectorstore_config¶
Vector store for storing multiple vectors.
- Type:
- indexing_strategy¶
How to create multiple vectors (‘summary’, ‘chunks’, ‘hypothetical’).
- Type:
Examples
>>> from haive.core.engine.retriever import MultiVectorRetrieverConfig >>> from haive.core.engine.vectorstore.providers.ChromaVectorStoreConfig import ChromaVectorStoreConfig >>> >>> # Create vector store config >>> vs_config = ChromaVectorStoreConfig( ... name="multi_vector_store", ... collection_name="documents" ... ) >>> >>> # Create multi-vector retriever >>> config = MultiVectorRetrieverConfig( ... name="multi_vector_retriever", ... vectorstore_config=vs_config, ... indexing_strategy="summary", ... k=5 ... ) >>> >>> # Instantiate and use the retriever >>> retriever = config.instantiate() >>> docs = retriever.get_relevant_documents("machine learning algorithms")
- instantiate()[source]¶
Create a Multi-Vector retriever from this configuration.
- Returns:
Instantiated retriever ready for multi-vector retrieval.
- Return type:
MultiVectorRetriever
- Raises:
ImportError – If required packages are not available.
ValueError – If configuration is invalid.