recap.rag
Submodules
recap.rag.base
Base class for RECAP RAG to be used by the retrieval instance
recap.rag.mred
- class recap.rag.mred.MREDReviewRAG(db_path: str = './chroma')[source]
Bases:
objectThis class hanldes the data processing and RAG process for the MRED reviews dataset It handles ingestion and retrieval
- ingest_data(directory: str | Path, batch_size: int = 128, clean: bool = False) None[source]
Ingest MRED dataset from the specified directory.
- Parameters:
directory – The folder directory containing full_data_info.txt and review files
batch_size – Batch size of reviews to ingest in vector store. Defaults to 128
clean – Deletes the collection in chroma. Defaults to False
- retrieve(query: str | None = None, filter=None, k: int = 10) tuple[str, list[dict]][source]
Retrieve information to help answer a query.
- Parameters:
query – The folder directory containing full_data_info.txt and review files Defaults to None
filter – A valid chroma Where filter dictionary object. If None provided no metadata filtering will be done. Defaults to None
k – This is number of entries to return from a similarity search. It is ignored if no query provided