Include known context in research prompt.

This commit is contained in:
user 2024-12-21 20:20:00 -05:00
parent 5be2792612
commit c41fac82b7
2 changed files with 19 additions and 1 deletions

View File

@ -105,12 +105,20 @@ def run_research_agent(
expert_section = EXPERT_PROMPT_SECTION_RESEARCH if expert_enabled else ""
human_section = HUMAN_PROMPT_SECTION_RESEARCH if hil else ""
# Get research context from memory
key_facts = _global_memory.get("key_facts", "")
code_snippets = _global_memory.get("code_snippets", "")
related_files = _global_memory.get("related_files", "")
# Build prompt
prompt = RESEARCH_PROMPT.format(
base_task=base_task_or_query,
research_only_note='' if research_only else ' Only request implementation if the user explicitly asked for changes to be made.',
expert_section=expert_section,
human_section=human_section
human_section=human_section,
key_facts=key_facts,
code_snippets=code_snippets,
related_files=related_files
)
# Set up configuration

View File

@ -70,6 +70,16 @@ Human Interaction:
# Research stage prompt - guides initial codebase analysis
RESEARCH_PROMPT = """User query: {base_task} --keep it simple
Context from Previous Research (if available):
Key Facts:
{key_facts}
Relevant Code Snippets:
{code_snippets}
Related Files:
{related_files}
Be very thorough in your research and emit lots of snippets, key facts. If you take more than a few steps, be eager to emit research subtasks.{research_only_note}
Objective