haive.core.engine.retriever.providers.PineconeHybridSearchRetrieverConfig¶
from typing import Any. Pinecone Hybrid Search Retriever implementation for the Haive framework.
This module provides a configuration class for the Pinecone Hybrid Search retriever, which combines vector similarity search with keyword search using Pinecone’s hybrid search capabilities.
The PineconeHybridSearchRetriever works by: 1. Connecting to a Pinecone index 2. Performing both vector and keyword search 3. Combining results using Pinecone’s hybrid scoring
This retriever is particularly useful when: - Using Pinecone as the vector database - Need both semantic and keyword search - Want Pinecone’s optimized hybrid search performance - Building applications that benefit from combined search approaches
The implementation integrates with LangChain’s PineconeHybridSearchRetriever while providing a consistent Haive configuration interface with secure API key management.
Classes¶
Configuration for Pinecone Hybrid Search retriever in the Haive framework. |
Module Contents¶
- class haive.core.engine.retriever.providers.PineconeHybridSearchRetrieverConfig.PineconeHybridSearchRetrieverConfig[source]¶
Bases:
haive.core.common.mixins.secure_config.SecureConfigMixin
,haive.core.engine.retriever.retriever.BaseRetrieverConfig
Configuration for Pinecone Hybrid Search retriever in the Haive framework.
This retriever uses Pinecone’s hybrid search capabilities to combine vector similarity search with keyword search for better retrieval performance.
- retriever_type¶
The type of retriever (always PINECONE).
- Type:
- api_key¶
Pinecone API key (auto-resolved from PINECONE_API_KEY).
- Type:
Optional[SecretStr]
Examples
>>> from haive.core.engine.retriever import PineconeHybridSearchRetrieverConfig >>> >>> # Create the pinecone hybrid search retriever config >>> config = PineconeHybridSearchRetrieverConfig( ... name="pinecone_hybrid_retriever", ... index_name="my-hybrid-index", ... environment="us-east1-gcp", ... top_k=5, ... alpha=0.5 # Equal weight to vector and sparse search ... ) >>> >>> # Instantiate and use the retriever >>> retriever = config.instantiate() >>> docs = retriever.get_relevant_documents("machine learning algorithms")
- instantiate()[source]¶
Create a Pinecone Hybrid Search retriever from this configuration.
- Returns:
Instantiated retriever ready for hybrid search.
- Return type:
PineconeHybridSearchRetriever
- Raises:
ImportError – If required packages are not available.
ValueError – If API key or configuration is invalid.