> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# RAG • AI Agent SDK

> rag: Lazy load RAG from agent if not provided.

# rag

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**AutoRagAgent**](../classes/AutoRagAgent) class in the [**auto\_rag\_agent**](../modules/auto_rag_agent) module.

Lazy load RAG from agent if not provided.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def rag() -> Optional['RAG']
```

### Returns

<ResponseField name="Returns" type="Optional['RAG']">
  The result of the operation.
</ResponseField>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/agents/auto_rag_agent.py#L184">
  `praisonaiagents/agents/auto_rag_agent.py` at line 184
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="RAG Concept" icon="magnifying-glass" href="/docs/concepts/rag" />

  <Card title="RAG Overview" icon="database" href="/docs/rag/overview" />

  <Card title="Chunking Strategies" icon="scissors" href="/docs/rag/strategies/overview" />
</CardGroup>
