agents.rag.unified_factory¶
Unified RAG Factory.
from typing import Any, Dict Create any RAG agent using either traditional or ChainAgent approach. Integrates with multi-agent system.
Classes¶
Unified factory for creating RAG agents. |
|
Implementation style. |
|
Available RAG types. |
Functions¶
|
Simple function to create any RAG agent. |
|
Create a RAG agent as a ChainAgent. |
|
Create a RAG agent as a MultiAgent. |
|
Create a pipeline of RAG agents. |
Examples of how to use the unified factory. |
Module Contents¶
- class agents.rag.unified_factory.RAGFactory¶
Unified factory for creating RAG agents.
- static create(rag_type, documents, llm_config=None, style=RAGStyle.CHAIN, name=None, **kwargs)¶
Create any RAG agent.
- Parameters:
rag_type (RAGType) – Type of RAG to create
documents (list[langchain_core.documents.Document]) – Documents for retrieval
llm_config (haive.core.models.llm.base.LLMConfig | None) – LLM configuration
style (RAGStyle) – Implementation style
name (str | None) – Agent name
**kwargs – Additional arguments
- Returns:
The created RAG agent
- Return type:
haive.agents.base.agent.Agent | haive.agents.chain.ChainAgent
- class agents.rag.unified_factory.RAGStyle¶
-
Implementation style.
Initialize self. See help(type(self)) for accurate signature.
- class agents.rag.unified_factory.RAGType¶
-
Available RAG types.
Initialize self. See help(type(self)) for accurate signature.
- agents.rag.unified_factory.create_rag(rag_type, documents, style='chain', **kwargs)¶
Simple function to create any RAG agent.
- agents.rag.unified_factory.create_rag_chain(rag_type, documents, **kwargs)¶
Create a RAG agent as a ChainAgent.
- agents.rag.unified_factory.create_rag_multi(rag_type, documents, **kwargs)¶
Create a RAG agent as a MultiAgent.
- agents.rag.unified_factory.create_rag_pipeline(rag_types, documents, style=RAGStyle.CHAIN, **kwargs)¶
Create a pipeline of RAG agents.