-
Notifications
You must be signed in to change notification settings - Fork 5
feat: improve tip generation prompt with richer guidance #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| You are analyzing an AI agent's execution trajectory to extract actionable tips. | ||
| Extract actionable, relevant tips from this trajectory that would help an AI agent perform similar tasks better in the future. | ||
|
|
||
| # Task Information | ||
| **Task:** {{task_instruction}} | ||
|
|
@@ -8,16 +8,26 @@ You are analyzing an AI agent's execution trajectory to extract actionable tips. | |
| # Agent Trajectory | ||
| {{trajectory_summary}} | ||
|
|
||
| # Your Task | ||
| Extract 3-5 actionable tips from this trajectory that would help AI agents perform similar tasks better. | ||
| **IMPORTANT TO REMEMBER:** | ||
| 1. Only generate tips if they are truly relevant and actionable | ||
| 2. Tips should be specific to patterns observed in this trajectory | ||
| 3. Include both positive patterns (what worked) and negative patterns (what to avoid) | ||
| 4. Each tip should have: | ||
| - A clear, concise description (content) | ||
| - The purpose/benefit of following it | ||
| - The category: "strategy", "recovery", or "optimization" | ||
| - Specific steps to implement the tip | ||
| - A trigger condition (when to apply this tip) | ||
|
|
||
| **Guidelines:** | ||
| 1. Focus on patterns that worked or mistakes that were made | ||
| 2. Be specific to what you observed in this trajectory | ||
| 3. Each tip should have: | ||
| - Clear description of what to do (or avoid) | ||
| - Why it matters | ||
| - When to apply it | ||
| 5. If the task succeeded, focus on the successful strategies used | ||
| 6. If the task failed, focus on what went wrong and how to prevent/recover from it | ||
|
Comment on lines
+22
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guidance references task success/failure, but status is always "UNKNOWN". Lines 22-23 instruct the LLM to focus on successful strategies if the task succeeded, or on failure modes if it failed. However, line 5 shows The LLM cannot follow this conditional guidance without knowing the actual outcome. Either:
🤖 Prompt for AI Agents |
||
| 7. Do not generate generic tips - be specific to this task execution | ||
| 8. Look for patterns in how the agent: | ||
| - Discovered and used APIs | ||
| - Handled authentication and credentials | ||
| - Iterated through results (pagination) | ||
| - Structured its approach to the problem | ||
| - Handled errors or unexpected responses | ||
|
|
||
| {% if not constrained_decoding_supported %} | ||
| **Output Format (JSON):** | ||
|
|
@@ -35,4 +45,7 @@ Extract 3-5 actionable tips from this trajectory that would help AI agents perfo | |
| ``` | ||
|
|
||
| Generate tips now. Return ONLY the JSON, no other text. | ||
| {% endif %} | ||
| {% endif %} | ||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Schema mismatch:
implementation_stepsfield does not exist in the Tip model.The instructions ask the LLM to include "Specific steps to implement the tip" (line 19), but the
TipPydantic model inevolve/schema/tips.pyonly defines 4 fields:content,rationale,category, andtrigger. If the LLM emits animplementation_stepsfield, it will either cause aValidationError(returning an empty tips list perevolve/llm/tips/tips.py:154-162) or be silently discarded.Either remove the instruction for implementation steps, or update the
Tipschema to include the new field.Option A: Remove the mismatched instruction
4. Each tip should have: - A clear, concise description (content) - The purpose/benefit of following it - The category: "strategy", "recovery", or "optimization" - - Specific steps to implement the tip - A trigger condition (when to apply this tip)Option B: Update the Tip schema (in evolve/schema/tips.py)
If you choose Option B, also update the JSON example in this template (lines 35-44) and the clustering code in
evolve/llm/tips/clustering.py.📝 Committable suggestion
🤖 Prompt for AI Agents