rag/__init__.py

PraisonAI · src/praisonai-agents/praisonaiagents/rag/__init__.py · python · MIT
ai

Lazy‑loaded RAG orchestration layer exposing models, strategies, and utilities for retrieval‑augmented generation.

# Source: https://github.com/MervinPraison/PraisonAI | License: MIT
# Provided via justclaw.it.com; keep this notice with the code.
"""
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.
"""

from typing import TYPE_CHECKING

# Lazy loadi

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key