haive.core.engine.retriever.providers.RemoteLangChainRetrieverConfig¶

Remote LangChain Retriever implementation for the Haive framework.

This module provides a configuration class for the Remote LangChain retriever, which enables retrieval from remote LangChain services and endpoints, allowing distributed and federated retrieval architectures.

The RemoteLangChainRetriever works by: 1. Connecting to remote LangChain retrieval endpoints 2. Sending queries to distributed retrieval services 3. Receiving and processing results from remote systems 4. Providing unified access to distributed retrieval infrastructure

This retriever is particularly useful when: - Building distributed retrieval architectures - Need to access remote LangChain services - Implementing federated search across multiple systems - Building microservice-based retrieval infrastructures

The implementation integrates with LangChain Community’s RemoteLangChainRetriever while providing a consistent Haive configuration interface with secure endpoint management.

Classes¶

RemoteLangChainRetrieverConfig

Configuration for Remote LangChain retriever in the Haive framework.

Module Contents¶

class haive.core.engine.retriever.providers.RemoteLangChainRetrieverConfig.RemoteLangChainRetrieverConfig[source]¶

Bases: haive.core.common.mixins.secure_config.SecureConfigMixin, haive.core.engine.retriever.retriever.BaseRetrieverConfig

Configuration for Remote LangChain retriever in the Haive framework.

This retriever enables retrieval from remote LangChain services and endpoints, allowing distributed and federated retrieval architectures.

retriever_type¶

The type of retriever (always REMOTE_LANGCHAIN).

Type:

RetrieverType

endpoint_url¶

URL of the remote LangChain retrieval endpoint.

Type:

str

api_key¶

API key for authentication (auto-resolved).

Type:

Optional[SecretStr]

k¶

Number of documents to return.

Type:

int

timeout¶

Request timeout in seconds.

Type:

int

Examples

>>> from haive.core.engine.retriever import RemoteLangChainRetrieverConfig
>>>
>>> # Create remote LangChain retriever
>>> config = RemoteLangChainRetrieverConfig(
...     name="remote_retriever",
...     endpoint_url="https://api.example.com/retrieve",
...     k=5,
...     timeout=30
... )
>>>
>>> # Instantiate and use the retriever
>>> retriever = config.instantiate()
>>> docs = retriever.get_relevant_documents("distributed systems architecture")
get_input_fields()[source]¶

Return input field definitions for Remote LangChain retriever.

Return type:

dict[str, tuple[type, Any]]

get_output_fields()[source]¶

Return output field definitions for Remote LangChain retriever.

Return type:

dict[str, tuple[type, Any]]

instantiate()[source]¶

Create a Remote LangChain retriever from this configuration.

Returns:

Instantiated retriever ready for remote retrieval.

Return type:

RemoteLangChainRetriever

Raises:
  • ImportError – If required packages are not available.

  • ValueError – If configuration is invalid.

classmethod validate_auth_method(v)[source]¶

Validate authentication method.

classmethod validate_endpoint_url(v)[source]¶

Validate endpoint URL format.