SmokeScan / rag /__init__.py
KinetoLabs's picture
Frontend simplification (4→2 tabs) + lazy imports for HF Spaces
78caafb
raw
history blame contribute delete
932 Bytes
"""RAG (Retrieval Augmented Generation) module for FDAM AI Pipeline.
This module provides document chunking, vector storage, and retrieval
for the FDAM knowledge base.
Lazy imports to avoid chromadb dependency at module load time for local development.
"""
__all__ = [
"SemanticChunker",
"Chunk",
"ChromaVectorStore",
"FDAMRetriever",
]
def __getattr__(name):
"""Lazy import RAG modules only when accessed."""
if name == "SemanticChunker":
from .chunker import SemanticChunker
return SemanticChunker
elif name == "Chunk":
from .chunker import Chunk
return Chunk
elif name == "ChromaVectorStore":
from .vectorstore import ChromaVectorStore
return ChromaVectorStore
elif name == "FDAMRetriever":
from .retriever import FDAMRetriever
return FDAMRetriever
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")