agents.rag.hyde.agent_v2¶
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¶
HyDE RAG using hypothetical document generation for better retrieval. |
|
Custom retriever that uses hypothetical document for enhanced retrieval. |
Functions¶
Build custom graph for HyDE workflows. |
|
|
Transform hypothesis to query format. |
Module Contents¶
- class agents.rag.hyde.agent_v2.HyDERAGAgentV2¶
Bases:
haive.agents.multi.enhanced_sequential_agent.SequentialAgent
HyDE RAG using hypothetical document generation for better retrieval.
This version properly uses the hypothetical document as the basis for retrieval.
- classmethod from_documents(documents, llm_config=None, embedding_model=None, **kwargs)¶
Create HyDE RAG from documents.
- Parameters:
- Returns:
HyDERAGAgentV2 instance
- class agents.rag.hyde.agent_v2.HyDERetrieverAgent¶
Bases:
haive.agents.base.agent.Agent
Custom retriever that uses hypothetical document for enhanced retrieval.
- build_graph()¶
Build graph that passes hypothetical doc as query.
- Return type:
haive.core.graph.state_graph.base_graph2.BaseGraph
- agents.rag.hyde.agent_v2.build_graph()¶
Build custom graph for HyDE workflows.
- Returns:
Graph configuration or None for default behavior
- Return type:
Any