haive.agents.rag.hyde.agent_v2 ============================== .. py:module:: haive.agents.rag.hyde.agent_v2 .. autoapi-nested-parse:: HyDE (Hypothetical Document Embeddings) RAG Agent V2. Bridges query-document semantic gap by generating hypothetical documents. This version properly embeds the hypothetical document for retrieval. Classes ------- .. autoapisummary:: haive.agents.rag.hyde.agent_v2.HyDERAGAgentV2 haive.agents.rag.hyde.agent_v2.HyDERetrieverAgent Functions --------- .. autoapisummary:: haive.agents.rag.hyde.agent_v2.build_graph haive.agents.rag.hyde.agent_v2.transform_to_query Module Contents --------------- .. py:class:: HyDERAGAgentV2 Bases: :py:obj:`haive.agents.multi.base.SequentialAgent` HyDE RAG using hypothetical document generation for better retrieval. This version properly uses the hypothetical document as the basis for retrieval. .. py:method:: from_documents(documents, llm_config = None, embedding_model = None, **kwargs) :classmethod: Create HyDE RAG from documents. :param documents: Documents to index :param llm_config: Optional LLM configuration :param embedding_model: Optional embedding model for vector store :param \*\*kwargs: Additional arguments :returns: HyDERAGAgentV2 instance .. py:class:: HyDERetrieverAgent Bases: :py:obj:`haive.agents.base.agent.Agent` Custom retriever that uses hypothetical document for enhanced retrieval. .. py:method:: build_graph() Build graph that passes hypothetical doc as query. .. py:function:: build_graph() Build custom graph for HyDE workflows. :returns: Graph configuration or None for default behavior .. py:function:: transform_to_query(hypothesis) Transform hypothesis to query format. :param hypothesis: Generated hypothesis text :returns: Formatted query string