Auto RAG Agent • AI Agent SDK
AutoRagAgent: Agent wrapper with automatic RAG retrieval decision.
AutoRagAgent
Defined in the Auto RAG Agent module.
AI Agent
Agent wrapper with automatic RAG retrieval decision.
Decides when to perform retrieval based on policy and heuristics, then composes RAG context with Agent chat.
This follows the same pattern as AutoAgents but for RAG:
- AutoAgents: auto-generates agent configs from instructions
- AutoRagAgent: auto-decides when to retrieve context
Constructor
ParamField
AgentNo description available.
ParamField
Optional[RAG]No description available.
ParamField
Optional[AutoRagConfig]No description available.
Methods
rag()
Lazy load RAG from agent if not provided.
name()Delegate name to wrapped agent.
chat()Chat with automatic RAG retrieval decision.
achat()Async version of chat.
Usage
from praisonaiagents import Agent, AutoRagAgent
agent = Agent(
name="Research Assistant",
knowledge=["docs/manual.pdf"],
)
auto_rag = AutoRagAgent(agent=agent)
# Auto mode - decides based on query
result = auto_rag.chat("What are the key findings?")
# Force retrieval
result = auto_rag.chat("Hello", force_retrieval=True)
# Skip retrieval
result = auto_rag.chat("What is 2+2?", skip_retrieval=True)Source
View on GitHubpraisonaiagents/agents/auto_rag_agent.py at line 102