SuperSCC.rag.SimpleRAG.run_rag

SimpleRAG.run_rag(qdrant_location, text_embedding_model, llm_model, llm_api_key, llm_base_url, qdrant_host=None, qdrant_api_key=None, qdrant_url=None, metadata_columns=None, chunk_size=1000, chunk_overlap=200, text_model_kwargs={'device': 'cpu'}, text_encode_kwargs={'normalize_embeddings': True}, qdrant_collection_name='SimpleRAG', qdrant_search_kwargs={'k': 10}, vectors_config=VectorParams(size=1024, distance=<Distance.COSINE: 'Cosine'>, hnsw_config=None, quantization_config=None, on_disk=None, datatype=None, multivector_config=None))[source]

Executes the entire RAG pipeline from scratch: loading, splitting, encoding, and creating the chain.

Parameters:
  • (str) (llm_base_url) – The location for the Qdrant client.

  • (str) – The name/path of the Hugging Face embedding model.

  • (str) – The name of the ChatOpenAI model for generation.

  • (str) – The API key for the LLM service.

  • (str) – The base URL for the LLM API endpoint.

  • (str (qdrant_collection_name) – The hostname of the Qdrant server. Defaults to None.

  • optional) – The hostname of the Qdrant server. Defaults to None.

  • (str – The API key for Qdrant. Defaults to None.

  • optional) – The API key for Qdrant. Defaults to None.

  • (str – The URL of the Qdrant server. Defaults to None.

  • optional) – The URL of the Qdrant server. Defaults to None.

  • (List[str] (metadata_columns) – Column names to use as metadata when loading CSV files. Defaults to None.

  • optional) – Column names to use as metadata when loading CSV files. Defaults to None.

  • (int (chunk_overlap) – Chunk size for text splitting. Defaults to 1000.

  • optional) – Chunk size for text splitting. Defaults to 1000.

  • (int – Chunk overlap for text splitting. Defaults to 200.

  • optional) – Chunk overlap for text splitting. Defaults to 200.

  • (dict (qdrant_search_kwargs) – Keyword arguments for the embedding model. Defaults to {“device”: “cpu”}.

  • optional) – Keyword arguments for the embedding model. Defaults to {“device”: “cpu”}.

  • (dict – Keyword arguments for the encoding process. Defaults to {“normalize_embeddings”: True}.

  • optional) – Keyword arguments for the encoding process. Defaults to {“normalize_embeddings”: True}.

  • (str – The name for the Qdrant collection. Defaults to “SimpleRAG”.

  • optional) – The name for the Qdrant collection. Defaults to “SimpleRAG”.

  • (dict – Keyword arguments for the retriever’s search. Defaults to {“k”: 10}.

  • optional) – Keyword arguments for the retriever’s search. Defaults to {“k”: 10}.

  • (VectorParams (vectors_config) – Configuration for the vectors in Qdrant. Defaults to VectorParams(size=1024, distance=Distance.COSINE).

  • optional) – Configuration for the vectors in Qdrant. Defaults to VectorParams(size=1024, distance=Distance.COSINE).