feat: enhance timeout management and knowledge base handling in CoSTEER components (#1130)

* feat: enhance timeout management and knowledge base handling in CoSTEER components

* fix a little bug

* fix small bug

* fix a small bug

* Update rdagent/scenarios/data_science/loop.py

Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>

* add scale check

* fix a small bug

* fix CI

* use dynamic chat_token_limit & remove repeated lines

* fix CI

* remove useless comment

* fix small bug

* update draft appendix

* fix prompt

* add code correctness as top priority

---------

Co-authored-by: you-n-g <you-n-g@users.noreply.github.com>
This commit is contained in:
Xu Yang
2025-07-31 13:06:28 +08:00
committed by GitHub
parent ce25bafbf7
commit 1aa5cc2535
26 changed files with 337 additions and 131 deletions
+21 -2
View File
@@ -77,8 +77,16 @@ class EvolvingStrategy(ABC):
class RAGStrategy(ABC):
"""Retrieval Augmentation Generation Strategy"""
def __init__(self, knowledgebase: EvolvingKnowledgeBase) -> None:
self.knowledgebase: EvolvingKnowledgeBase = knowledgebase
def __init__(self, *args: Any, **kwargs: Any) -> None:
self.knowledgebase: EvolvingKnowledgeBase = self.load_or_init_knowledge_base(*args, **kwargs)
@abstractmethod
def load_or_init_knowledge_base(
self,
*args: Any,
**kwargs: Any,
) -> EvolvingKnowledgeBase:
pass
@abstractmethod
def query(
@@ -102,3 +110,14 @@ class RAGStrategy(ABC):
RAGStrategy should maintain the new knowledge all by itself.
"""
@abstractmethod
def dump_knowledge_base(self, *args: Any, **kwargs: Any) -> None:
pass
@abstractmethod
def load_dumped_knowledge_base(self, *args: Any, **kwargs: Any) -> None:
"""This is to load the dumped knowledge base.
It's mainly used in parallel coding of which several coder shares the same knowledge base.
Then the agent should load the knowledge base from others before updating it.
"""