diff --git a/ra_aid/__main__.py b/ra_aid/__main__.py index 8d211e1..36111b6 100644 --- a/ra_aid/__main__.py +++ b/ra_aid/__main__.py @@ -610,9 +610,6 @@ def main(): memory=planning_memory, config=config, ) - - # Run cleanup tasks before exiting database context - run_cleanup() except (KeyboardInterrupt, AgentInterrupt): print() @@ -621,17 +618,5 @@ def main(): sys.exit(0) -def run_cleanup(): - """Run cleanup tasks after main execution.""" - try: - # Import the key facts cleaner agent - from ra_aid.agents.key_facts_gc_agent import run_key_facts_gc_agent - - # Run the key facts garbage collection agent regardless of the number of facts - run_key_facts_gc_agent() - except Exception as e: - logger.error(f"Failed to run cleanup tasks: {str(e)}") - - if __name__ == "__main__": main() \ No newline at end of file diff --git a/ra_aid/agent_utils.py b/ra_aid/agent_utils.py index 35d5f07..650c9f9 100644 --- a/ra_aid/agent_utils.py +++ b/ra_aid/agent_utils.py @@ -419,7 +419,7 @@ def run_research_agent( project_info=formatted_project_info, new_project_hints=NEW_PROJECT_HINTS if project_info.is_new else "", ) - + config = _global_memory.get("config", {}) if not config else config recursion_limit = config.get("recursion_limit", DEFAULT_RECURSION_LIMIT) run_config = { diff --git a/ra_aid/model_formatters/key_facts_formatter.py b/ra_aid/model_formatters/key_facts_formatter.py index 5411c08..8fec010 100644 --- a/ra_aid/model_formatters/key_facts_formatter.py +++ b/ra_aid/model_formatters/key_facts_formatter.py @@ -21,12 +21,12 @@ def format_key_fact(fact_id: int, content: str) -> str: Example: >>> format_key_fact(1, "This is an important fact") - '## 🔑 Key Fact #1\n\nThis is an important fact' + '## 🔑 Key Fact\n\nID: 1\n\nThis is an important fact' """ if not content: return "" - return f"## 🔑 Key Fact #{fact_id}\n\n{content}" + return f"## 🔑 Key Fact\n\nID: {fact_id}\n\n{content}" def format_key_facts_dict(facts_dict: Dict[int, str]) -> str: diff --git a/ra_aid/prompts/research_prompts.py b/ra_aid/prompts/research_prompts.py index 88e0af2..843acf6 100644 --- a/ra_aid/prompts/research_prompts.py +++ b/ra_aid/prompts/research_prompts.py @@ -58,6 +58,7 @@ You must: You can use fuzzy file search to quickly find relevant files matching a search pattern. Use ripgrep_search extensively to do *exhaustive* searches for all references to anything that might be changed as part of the base level task. Prefer to use ripgrep_search with context params rather than reading whole files in order to preserve context tokens. + Call emit_key_facts on key information you discover about this project during your research. This is information you will be writing down to be able to efficiently complete work in the future, so be on the lookout for these and make it count. You must not: