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
Diagram

Input Data

Agent: AutoRagAgent

Output Result

Constructor

ParamField Agent

No description available.

ParamField Optional[RAG]

No description available.

ParamField Optional[AutoRagConfig]

No description available.

Methods

Usage

python
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 GitHub

praisonaiagents/agents/auto_rag_agent.py at line 102


Related Documentation