> ## 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

> PraisonAI RAG - Retrieval Augmented Generation Module.

# rag

AI Agent

PraisonAI RAG - Retrieval Augmented Generation Module.

This module provides a thin orchestration layer over Knowledge for RAG workflows.
Knowledge handles indexing/retrieval; RAG adds answer generation with citations.

Usage:

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents.rag import RAG, RAGConfig, RAGResult, Citation

# With existing Knowledge
rag = RAG(knowledge=my_knowledge)
result = rag.query("What is the main finding?")
print(result.answer)
for citation in result.citations:
    print(f"  [{citation.id}] {citation.source}")
```

All imports are lazy to avoid performance impact when RAG is not used.

## Import

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import rag
```

### Constants

| Name | Value |
| - | - |
| `_LAZY_IMPORTS` | `{'Citation': ('praisonaiagents.rag.models', 'Citation'), 'ContextPack': ('praisonaiagents.rag.models', 'ContextPack'), 'RAGResult': ('praisonaiagents.rag.models', 'RAGResult'), 'RAGConfig': ('praisona...` |

***

## Related Documentation

> [card] [RAG Concept](https://praison.ai/docs/docs/concepts/rag)

> [card] [RAG Overview](https://praison.ai/docs/docs/rag/overview)

> [card] [Chunking Strategies](https://praison.ai/docs/docs/rag/strategies/overview)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.