Include known context in research prompt.
This commit is contained in:
parent
5be2792612
commit
c41fac82b7
|
|
@ -105,12 +105,20 @@ def run_research_agent(
|
||||||
expert_section = EXPERT_PROMPT_SECTION_RESEARCH if expert_enabled else ""
|
expert_section = EXPERT_PROMPT_SECTION_RESEARCH if expert_enabled else ""
|
||||||
human_section = HUMAN_PROMPT_SECTION_RESEARCH if hil 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
|
# Build prompt
|
||||||
prompt = RESEARCH_PROMPT.format(
|
prompt = RESEARCH_PROMPT.format(
|
||||||
base_task=base_task_or_query,
|
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.',
|
research_only_note='' if research_only else ' Only request implementation if the user explicitly asked for changes to be made.',
|
||||||
expert_section=expert_section,
|
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
|
# Set up configuration
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,16 @@ Human Interaction:
|
||||||
# Research stage prompt - guides initial codebase analysis
|
# Research stage prompt - guides initial codebase analysis
|
||||||
RESEARCH_PROMPT = """User query: {base_task} --keep it simple
|
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}
|
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
|
Objective
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue