haive.agents.rag.hyde.agent¶

HyDE (Hypothetical Document Embeddings) RAG Agent.

from typing import Any Bridges query-document semantic gap by generating hypothetical documents. Implements architecture from rag-architectures-flows.md: Query -> Generate Hypothetical Doc -> Embed -> Retrieve Real Docs -> Generate

Classes¶

HyDERAGAgent

HyDE RAG using hypothetical document generation for better retrieval.

Module Contents¶

class haive.agents.rag.hyde.agent.HyDERAGAgent¶

Bases: haive.agents.multi.MultiAgent

HyDE RAG using hypothetical document generation for better retrieval.

classmethod from_documents(documents, llm_config=None, **kwargs)¶

Create HyDE RAG from documents.

Parameters:
  • documents (list[langchain_core.documents.Document]) – Documents to index

  • llm_config (haive.core.models.llm.base.LLMConfig | None) – Optional LLM configuration

  • **kwargs – Additional arguments

Returns:

HyDERAGAgent instance