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¶

MultiVectorRetrieverConfig

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.BaseRetrieverConfig

Configuration 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:

RetrieverType

vectorstore_config¶

Vector store for storing multiple vectors.

Type:

VectorStoreConfig

docstore_type¶

Type of document store (‘in_memory’, ‘file_system’).

Type:

str

indexing_strategy¶

How to create multiple vectors (‘summary’, ‘chunks’, ‘hypothetical’).

Type:

str

k¶

Number of documents to return.

Type:

int

search_kwargs¶

Additional search parameters for the vector store.

Type:

dict

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")
get_input_fields()[source]¶

Return input field definitions for Multi-Vector retriever.

Return type:

dict[str, tuple[type, Any]]

get_output_fields()[source]¶

Return output field definitions for Multi-Vector retriever.

Return type:

dict[str, tuple[type, Any]]

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.

classmethod validate_docstore_path(v)[source]¶

Validate docstore path is provided when needed.

classmethod validate_docstore_type(v)[source]¶

Validate document store type.

classmethod validate_indexing_strategy(v)[source]¶

Validate indexing strategy.

classmethod validate_search_type(v)[source]¶

Validate search type.