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:
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
from praisonaiagents import ragConstants
| Name | Value |
|---|---|
_LAZY_IMPORTS | {'Citation': ('praisonaiagents.rag.models', 'Citation'), 'ContextPack': ('praisonaiagents.rag.models', 'ContextPack'), 'RAGResult': ('praisonaiagents.rag.models', 'RAGResult'), 'RAGConfig': ('praisona... |