Skip to main content

AutoRagAgent

Defined in the auto_rag_agent module.
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

agent
Agent
required
No description available.
rag
Optional
No description available.
config
Optional
No description available.

Methods

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)