SuperSCC.rag.SimpleRAG.get_answer

SimpleRAG.get_answer(gene_list, query=None, hierarchy_search=True, hybrid_search=True, rerank_model=None, auto_translate=True, auto_refine_query=True, highlight_docs=True, score_docs=True)[source]

The main entry point for asking a question. It orchestrates the entire process: query refinement, retrieval, reranking, scoring, and generation.

Parameters:
  • (str) (gene_list) – A string containing a list of genes, which forms the primary basis of the query.

  • (str (rerank_model) – A specific user-provided question. If None, a default query template is generated based on the gene_list. Defaults to None.

  • optional) – A specific user-provided question. If None, a default query template is generated based on the gene_list. Defaults to None.

  • (bool (score_docs) – Enables filtered, hierarchical search within the hybrid search step. Defaults to True.

  • optional) – Enables filtered, hierarchical search within the hybrid search step. Defaults to True.

  • (bool – If True, uses a hybrid retriever (BM25 + dense). If False, uses only the dense retriever. Defaults to True.

  • optional) – If True, uses a hybrid retriever (BM25 + dense). If False, uses only the dense retriever. Defaults to True.

  • (str – The model for reranking. Note: This parameter is defined but not directly used in the method’s logic; self.rerank() is called without passing this argument. Defaults to None.

  • optional) – The model for reranking. Note: This parameter is defined but not directly used in the method’s logic; self.rerank() is called without passing this argument. Defaults to None.

  • (bool – If True, automatically translates the query from Chinese to English if needed. Defaults to True.

  • optional) – If True, automatically translates the query from Chinese to English if needed. Defaults to True.

  • (bool – If True, automatically rewrites the query to improve retrieval performance. Defaults to True.

  • optional) – If True, automatically rewrites the query to improve retrieval performance. Defaults to True.

  • (bool – If True, post-processes the answer to extract the exact source segments used. Defaults to True.

  • optional) – If True, post-processes the answer to extract the exact source segments used. Defaults to True.

  • (bool – If True, filters retrieved documents for relevance using an LLM-based scorer after reranking. Defaults to True

  • optional) – If True, filters retrieved documents for relevance using an LLM-based scorer after reranking. Defaults to True