agents.rag.multi_agent_rag.complete_rag_workflows¶
Complete RAG Workflows Implementation.
Implements all RAG architectures from rag-architectures-flows.md including: - Corrective RAG with web search fallback - Self-RAG with reflection tokens - Adaptive RAG with complexity routing - Multi-Query RAG and RAG Fusion - HYDE and Step-Back prompting - Hallucination detection and requerying
Classes¶
Adaptive RAG with complexity-based routing. |
|
Full Corrective RAG implementation with web search fallback. |
|
Enhanced HYDE RAG with hypothesis generation. |
|
Quality assessment for retrieved documents. |
|
Self-RAG reflection tokens. |
|
Self-RAG with reflection tokens and adaptive retrieval. |
Functions¶
|
CRAG relevance checking with three-way classification. |
|
Factory for creating complete RAG workflows. |
|
Detect hallucination in generated response. |
|
Web search fallback for when documents are insufficient. |
Module Contents¶
- class agents.rag.multi_agent_rag.complete_rag_workflows.AdaptiveRAGAgent(documents=None, **kwargs)¶
Bases:
haive.agents.multi.base.ConditionalAgent
Adaptive RAG with complexity-based routing.
Init .
- Parameters:
documents (list[langchain_core.documents.Document] | None) – [TODO: Add description]
- class agents.rag.multi_agent_rag.complete_rag_workflows.CorrectiveRAGAgent(documents=None, **kwargs)¶
Bases:
haive.agents.multi.base.ConditionalAgent
Full Corrective RAG implementation with web search fallback.
Init .
- Parameters:
documents (list[langchain_core.documents.Document] | None) – [TODO: Add description]
- class agents.rag.multi_agent_rag.complete_rag_workflows.HYDERAGAgent(documents=None, **kwargs)¶
Bases:
haive.agents.multi.base.SequentialAgent
Enhanced HYDE RAG with hypothesis generation.
Init .
- Parameters:
documents (list[langchain_core.documents.Document] | None) – [TODO: Add description]
- class agents.rag.multi_agent_rag.complete_rag_workflows.RAGQuality¶
-
Quality assessment for retrieved documents.
Initialize self. See help(type(self)) for accurate signature.
- class agents.rag.multi_agent_rag.complete_rag_workflows.ReflectionToken¶
-
Self-RAG reflection tokens.
Initialize self. See help(type(self)) for accurate signature.
- class agents.rag.multi_agent_rag.complete_rag_workflows.SelfRAGAgent(documents=None, **kwargs)¶
Bases:
haive.agents.multi.base.ConditionalAgent
Self-RAG with reflection tokens and adaptive retrieval.
Init .
- Parameters:
documents (list[langchain_core.documents.Document] | None) – [TODO: Add description]
- agents.rag.multi_agent_rag.complete_rag_workflows.crag_relevance_check(input_data)¶
CRAG relevance checking with three-way classification.
- agents.rag.multi_agent_rag.complete_rag_workflows.create_complete_rag_workflow(workflow_type, documents=None, **kwargs)¶
Factory for creating complete RAG workflows.
Available types: - ‘crag’: Corrective RAG with web search - ‘self_rag’: Self-RAG with reflection tokens - ‘adaptive’: Adaptive RAG with complexity routing - ‘hyde’: HYDE RAG with hypothesis generation - ‘multi_query’: Multi-Query RAG with query variations
- agents.rag.multi_agent_rag.complete_rag_workflows.hallucination_detection(input_data)¶
Detect hallucination in generated response.