Skip to main content

praisonaiagents.rag

Core SDK 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.

Overview

This module provides components for rag.

Constants

NameValue
_LAZY_IMPORTS{'Citation': ('praisonaiagents.rag.models', 'Citation'), 'ContextPack': ('praisonaiagents.rag.models', 'ContextPack'), 'RAGResult': ('praisonaiagents.rag.models', 'RAGResult'), 'RAGConfig': ('praisona...