From 8f1e072e20224a1ff8aa6fd8749da4094f0f90a7 Mon Sep 17 00:00:00 2001 From: AI Christianson Date: Sat, 8 Mar 2025 14:23:35 -0500 Subject: [PATCH] improve reasoning assistance --- .gitignore | 2 +- ra_aid/agent_utils.py | 11 +++++++++-- ra_aid/prompts/implementation_prompts.py | 6 ++++++ ra_aid/prompts/reasoning_assist_prompt.py | 6 ++++-- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 0493b37..cc08b96 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,4 @@ __pycache__/ /htmlcov .envrc appmap.log - +*.swp diff --git a/ra_aid/agent_utils.py b/ra_aid/agent_utils.py index d8a5054..821ccc9 100644 --- a/ra_aid/agent_utils.py +++ b/ra_aid/agent_utils.py @@ -842,8 +842,6 @@ def run_planning_agent( expert_guidance_section = "" if expert_guidance: expert_guidance_section = f""" -Expert model has analyzed this task and provided the following guidance: - {expert_guidance} """ @@ -969,6 +967,14 @@ def run_task_implementation_agent( logger.error(f"Failed to access research note repository: {str(e)}") formatted_research_notes = "" + # Get latest project info + try: + project_info = get_project_info(".") + formatted_project_info = format_project_info(project_info) + except Exception as e: + logger.warning("Failed to get project info: %s", str(e)) + formatted_project_info = "Project info unavailable" + # Get environment inventory information prompt = IMPLEMENTATION_PROMPT.format( @@ -995,6 +1001,7 @@ def run_task_implementation_agent( else "" ), env_inv=get_env_inv(), + project_info=formatted_project_info, ) config = get_config_repository().get_all() if not config else config diff --git a/ra_aid/prompts/implementation_prompts.py b/ra_aid/prompts/implementation_prompts.py index eb71548..af739ed 100644 --- a/ra_aid/prompts/implementation_prompts.py +++ b/ra_aid/prompts/implementation_prompts.py @@ -13,6 +13,10 @@ from ra_aid.prompts.web_research_prompts import WEB_RESEARCH_PROMPT_SECTION_IMPL IMPLEMENTATION_PROMPT = """Current Date: {current_date} Working Directory: {working_directory} + +{project_info} + + {key_facts} @@ -86,5 +90,7 @@ FOLLOW TEST DRIVEN DEVELOPMENT (TDD) PRACTICES WHERE POSSIBE. E.G. COMPILE CODE IF YOU CAN SEE THE CODE WRITTEN/CHANGED BY THE PROGRAMMER, TRUST IT. YOU DO NOT NEED TO RE-READ EVERY FILE WITH EVERY SMALL EDIT. +YOU MUST READ FILES BEFORE WRITING OR CHANGING THEM. + NEVER ANNOUNCE WHAT YOU ARE DOING, JUST DO IT! """ diff --git a/ra_aid/prompts/reasoning_assist_prompt.py b/ra_aid/prompts/reasoning_assist_prompt.py index 7e690af..1611962 100644 --- a/ra_aid/prompts/reasoning_assist_prompt.py +++ b/ra_aid/prompts/reasoning_assist_prompt.py @@ -45,10 +45,12 @@ Focus on strategic thinking rather than implementation details. Your guidance wi Please be concise, practical, and specific to this task. Avoid generic advice. -Include beautiful, human-readable pseudo-code of tools you would call and branches in that flowchart to show contingency/conditional paths. -Use an outline/pseudo code format to communicate the approach. Remember I am an agent and will use this logic to guide my actions. +Your sole output is a beautiful outline/pseudo code format to communicate the approach. Remember I am an agent and will use this logic to guide my actions. It should be the most beautiful, elegant, simple logic ever. +YOUR OUTPUT MUST BE MARKDOWN. + + WE ARE IN THE **PLANNING** STAGE RIGHT NOW. NO CODE SHOULD BE WRITTEN. WE SHOULD BE THINKING LOGICALLY ABOUT HOW TO APPROACH THE PROBLEM, PLANNING OUT WHICH TASKS TO REQUEST IMPLEMENTATION OF, ETC. """