diff --git a/rdagent/app/kaggle/conf.py b/rdagent/app/kaggle/conf.py index b0797643..115ae4de 100644 --- a/rdagent/app/kaggle/conf.py +++ b/rdagent/app/kaggle/conf.py @@ -66,5 +66,7 @@ class KaggleBasePropSetting(BasePropSetting): auto_submit: bool = True + dsagent: bool = False + KAGGLE_IMPLEMENT_SETTING = KaggleBasePropSetting() diff --git a/rdagent/components/proposal/model_proposal.py b/rdagent/components/proposal/model_proposal.py index 409c37d2..c1862961 100644 --- a/rdagent/components/proposal/model_proposal.py +++ b/rdagent/components/proposal/model_proposal.py @@ -50,7 +50,6 @@ class ModelHypothesisGen(HypothesisGen): .from_string(ModelHypothesisGen.prompts["hypothesis_gen"]["user_prompt"]) .render( targets="feature engineering and model building", - hypothesis_and_feedback=context_dict["hypothesis_and_feedback"], RAG=context_dict["RAG"], ) ) diff --git a/rdagent/components/proposal/prompts.yaml b/rdagent/components/proposal/prompts.yaml index 24c3a048..d8ef844a 100644 --- a/rdagent/components/proposal/prompts.yaml +++ b/rdagent/components/proposal/prompts.yaml @@ -12,14 +12,9 @@ hypothesis_gen: {{ hypothesis_output_format }} user_prompt: |- - {% if hypothesis_and_feedback|length == 0 %}It is the first round of hypothesis generation. The user has no hypothesis on this scenario yet. - {% else %}It is not the first round, the user has made several hypothesis on this scenario and did several evaluation on them. - The former hypothesis and the corresponding feedbacks are as follows (focus on the last one & the new hypothesis that it provides and reasoning to see if you agree): - {{ hypothesis_and_feedback }} - {% endif %} {% if RAG %}To help you generate new {{targets}}, we have prepared the following information for you: {{ RAG }}{% endif %} - Please generate the new hypothesis based on the information above. Also generate the relevant keys for the reasoning and the distilled knowledge that follows. For those keys, in particular for knowledge, explain in the context of the specific scenario to build up domain knowledge in the specific field rather than general knowledge. + Also generate the relevant keys for the reasoning and the distilled knowledge that follows. For those keys, in particular for knowledge, explain in the context of the specific scenario to build up domain knowledge in the specific field rather than general knowledge. hypothesis2experiment: system_prompt: |- diff --git a/rdagent/scenarios/kaggle/proposal/proposal.py b/rdagent/scenarios/kaggle/proposal/proposal.py index eb670a09..c7bdf6b6 100644 --- a/rdagent/scenarios/kaggle/proposal/proposal.py +++ b/rdagent/scenarios/kaggle/proposal/proposal.py @@ -91,7 +91,10 @@ class KGHypothesisGen(ModelHypothesisGen): def generate_RAG_content(self, trace: Trace, hypothesis_and_feedback: str) -> str: if self.scen.if_using_vector_rag: - rag_results, _ = self.scen.vector_base.search_experience(hypothesis_and_feedback, topk_k=5) + if self.scen.dsagent: + rag_results, _ = self.scen.dsagent.vector_base.search_experience(hypothesis_and_feedback, topk_k=1) + else: + rag_results, _ = self.scen.vector_base.search_experience(hypothesis_and_feedback, topk_k=5) return "\n".join([doc.content for doc in rag_results]) if self.scen.if_using_graph_rag is False or trace.knowledge_base is None: return None