recap.rag

Submodules

recap.rag.base

Base class for RECAP RAG to be used by the retrieval instance

class recap.rag.base.BaseRAG[source]

Bases: object

recap.rag.mred

class recap.rag.mred.MREDReviewRAG(db_path: str = './chroma')[source]

Bases: object

This 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

validate_filter(filter) str | None[source]

Module contents