improve prompts

This commit is contained in:
AI Christianson 2025-03-10 15:30:22 -04:00
parent c98c107ce3
commit e81421a95a
3 changed files with 37 additions and 6 deletions

View File

@ -333,7 +333,9 @@ def run_research_agent(
if expert_guidance:
expert_guidance_section = f"""<expert guidance>
{expert_guidance}
</expert guidance>"""
</expert guidance>
YOU MUST FOLLOW THE EXPERT'S GUIDANCE OR ELSE BE TERMINATED!
"""
# Format research notes if available
# We get research notes earlier for reasoning assistance

View File

@ -48,6 +48,19 @@ Given the available information, tools, and base task, write a couple paragraphs
The agent has a tendency to do the same work/functin calls over and over again.
Answer quickly and confidently with five sentences at most.
DO NOT WRITE CODE
WRITE AT LEAST ONE SENTENCE
WRITE NO MORE THAN FIVE PARAGRAPHS.
WRITE ABOUT HOW THE AGENT WILL USE THE TOOLS AVAILABLE TO EFFICIENTLY ACCOMPLISH THE GOAL.
REFERENCE ACTUAL TOOL NAMES IN YOUR WRITING, BUT KEEP THE WRITING PLAIN LOGICAL ENGLISH.
BE DETAILED AND INCLUDE LOGIC BRANCHES FOR WHAT TO DO IF DIFFERENT TOOLS RETURN DIFFERENT THINGS.
THINK OF IT AS A FLOW CHART BUT IN NATURAL ENGLISH.
REMEMBER THE ULTIMATE GOAL AT THIS STAGE IS TO BREAK THINGS DOWN INTO DISCRETE TASKS AND CALL request_task_implementation FOR EACH TASK.
PROPOSE THE TASK BREAKDOWN TO THE AGENT. INCLUDE THIS AS A BULLETED LIST IN YOUR GUIDANCE.
WE ARE NOT WRITING ANY CODE AT THIS STAGE.
THE AGENT IS VERY FORGETFUL AND YOUR WRITING MUST INCLUDE REMARKS ABOUT HOW IT SHOULD USE *ALL* AVAILABLE TOOLS, INCLUDING AND ESPECIALLY ask_expert.
THE AGENT IS DUMB AND NEEDS REALLY DETAILED GUIDANCE LIKE LITERALLY REMINDING IT TO CALL request_task_implementation FOR EACH TASK IN YOUR BULLETED LIST.
"""
REASONING_ASSIST_PROMPT_IMPLEMENTATION = """Current Date: {current_date}
@ -93,6 +106,14 @@ IF ANYTHING AT ALL GOES WRONG, CALL ask_expert.
Given the available information, tools, and base task, write a couple paragraphs about how an agentic system might use the available tools to implement the given task definition. The agent will be writing code and making changes at this point.
Answer quickly and confidently with a few sentences at most.
WRITE AT LEAST ONE SENTENCE
WRITE NO MORE THAN FIVE PARAGRAPHS.
WRITE ABOUT HOW THE AGENT WILL USE THE TOOLS AVAILABLE TO EFFICIENTLY ACCOMPLISH THE GOAL.
REFERENCE ACTUAL TOOL NAMES IN YOUR WRITING, BUT KEEP THE WRITING PLAIN LOGICAL ENGLISH.
BE DETAILED AND INCLUDE LOGIC BRANCHES FOR WHAT TO DO IF DIFFERENT TOOLS RETURN DIFFERENT THINGS.
THE AGENT IS VERY FORGETFUL AND YOUR WRITING MUST INCLUDE REMARKS ABOUT HOW IT SHOULD USE *ALL* AVAILABLE TOOLS, INCLUDING AND ESPECIALLY ask_expert.
THINK OF IT AS A FLOW CHART BUT IN NATURAL ENGLISH.
"""
REASONING_ASSIST_PROMPT_RESEARCH = """Current Date: {current_date}
@ -136,4 +157,13 @@ IF INFORMATION IS TOO COMPLEX TO UNDERSTAND, THE AGENT SHOULD USE ask_expert.
Given the available information, tools, and base task or query, write a couple paragraphs about how an agentic system might use the available tools to research the codebase, identify important components, gather key information, and emit key facts and snippets. The focus is on thorough investigation and understanding before any implementation. Remember, the research agent generally should emit research notes at the end of its execution, right before it calls request_implementation if a change or new work is required.
Answer quickly and confidently with five sentences at most.
DO NOT WRITE CODE
WRITE AT LEAST ONE SENTENCE
WRITE NO MORE THAN FIVE PARAGRAPHS.
WRITE ABOUT HOW THE AGENT WILL USE THE TOOLS AVAILABLE TO EFFICIENTLY ACCOMPLISH THE GOAL.
REFERENCE ACTUAL TOOL NAMES IN YOUR WRITING, BUT KEEP THE WRITING PLAIN LOGICAL ENGLISH.
BE DETAILED AND INCLUDE LOGIC BRANCHES FOR WHAT TO DO IF DIFFERENT TOOLS RETURN DIFFERENT THINGS.
THINK OF IT AS A FLOW CHART BUT IN NATURAL ENGLISH.
THE AGENT IS VERY FORGETFUL AND YOUR WRITING MUST INCLUDE REMARKS ABOUT HOW IT SHOULD USE *ALL* AVAILABLE TOOLS, INCLUDING AND ESPECIALLY ask_expert.
"""

View File

@ -123,7 +123,6 @@ If you find this is an empty directory, you can stop research immediately and as
{expert_section}
{human_section}
{web_research_section}
{expert_guidance_section}
You have often been criticized for:
- Needlessly requesting more research tasks, especially for general background knowledge which you already know.
@ -180,12 +179,12 @@ If this is a top-level README.md or docs folder, start there.
If the user explicitly requests implementation, that means you should first perform all the background research for that task, then call request_implementation where the implementation will be carried out.
{expert_guidance_section}
<user query>
{base_task}
</user query>
{expert_guidance_section}
USER QUERY *ALWAYS* TAKES PRECEDENCE OVER EVERYTHING IN PREVIOUS RESEARCH.
KEEP IT SIMPLE
@ -207,12 +206,12 @@ You have been spawned by a higher level research agent, so only spawn more resea
When you emit research notes, keep it extremely concise and relevant only to the specific research subquery you've been assigned.
{expert_guidance_section}
<user query>
{base_task}
</user query>
{expert_guidance_section}
USER QUERY *ALWAYS* TAKES PRECEDENCE OVER EVERYTHING IN PREVIOUS RESEARCH.
KEEP IT SIMPLE