You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: improve tip generation prompt with richer guidance (#124)
* feat: improve tip generation prompt with richer guidance
Restructures the prompt to produce more specific, actionable tips by
adding explicit categories (strategy/recovery/optimization), step
instructions, trigger conditions, and domain-specific pattern hints
(API discovery, pagination, auth, error handling).
* fix: add optional implementation_steps to Tip model and prompt
Aligns the Tip schema with the generate_tips prompt which already
instructed the LLM to produce implementation steps. Field is optional
(default empty list) for backward compatibility with existing stored
entities and consumers.
* feat: propagate implementation_steps through tip storage and clustering
Store implementation_steps in entity metadata across all three storage
paths (phoenix sync, MCP save_trajectory, consolidation). Pass it
through combine_cluster so the LLM sees prior steps when consolidating,
and update combine_tips.jinja2 to render and emit the field.
* fix: normalize implementation_steps to list[str] in combine_cluster
Handles legacy entities where implementation_steps may be None, a
bare string, or a non-list type stored in metadata.
* fix: clarify task status context in tip generation prompt
Replace placeholder 'Status: UNKNOWN' with an accurate description of
the evaluation context — no ground truth or user feedback, only the
agent's self-evaluation in the trajectory. Soften success/failure
conditionals to reflect this uncertainty.
---------
Co-authored-by: JAYARAM RADHAKRISHNAN <jayaramkr@us.ibm.com>
You are analyzing an AI agent's execution trajectory to extract actionable tips.
1
+
Extract actionable, relevant tips from this trajectory that would help an AI agent perform similar tasks better in the future.
2
2
3
3
# Task Information
4
4
**Task:** {{task_instruction}}
5
-
**Status:** UNKNOWN
5
+
**Task Status:** There is no evaluation of the task's trajectory or output against any ground truth. There is also no user feedback to the AI agent. But the trajectory may contain the agent's self-evaluation of whether the task succeeded or failed.
6
6
**Steps Taken:** {{num_steps}}
7
7
8
8
# Agent Trajectory
9
9
{{trajectory_summary}}
10
10
11
-
# Your Task
12
-
Extract 3-5 actionable tips from this trajectory that would help AI agents perform similar tasks better.
11
+
**IMPORTANT TO REMEMBER:**
12
+
1. Only generate tips if they are truly relevant and actionable
13
+
2. Tips should be specific to patterns observed in this trajectory
14
+
3. Include both positive patterns (what worked) and negative patterns (what to avoid)
15
+
4. Each tip should have:
16
+
- A clear, concise description (content)
17
+
- The purpose/benefit of following it
18
+
- The category: "strategy", "recovery", or "optimization"
19
+
- Specific steps to implement the tip
20
+
- A trigger condition (when to apply this tip)
13
21
14
-
**Guidelines:**
15
-
1. Focus on patterns that worked or mistakes that were made
16
-
2. Be specific to what you observed in this trajectory
17
-
3. Each tip should have:
18
-
- Clear description of what to do (or avoid)
19
-
- Why it matters
20
-
- When to apply it
22
+
5. If the task seems to have succeeded, focus on the successful strategies used
23
+
6. If the task seems to have failed, focus on what went wrong and how to prevent/recover from it
24
+
7. Do not generate generic tips - be specific to this task execution
25
+
8. Look for patterns in how the agent:
26
+
- Discovered and used APIs
27
+
- Handled authentication and credentials
28
+
- Iterated through results (pagination)
29
+
- Structured its approach to the problem
30
+
- Handled errors or unexpected responses
21
31
22
32
{%ifnotconstrained_decoding_supported%}
23
33
**Output Format (JSON):**
@@ -28,11 +38,15 @@ Extract 3-5 actionable tips from this trajectory that would help AI agents perfo
28
38
"content": "Clear, actionable tip",
29
39
"rationale": "Why this tip helps",
30
40
"category": "strategy|recovery|optimization",
31
-
"trigger": "When to apply this tip"
41
+
"trigger": "When to apply this tip",
42
+
"implementation_steps": ["step 1", "step 2"]
32
43
}
33
44
]
34
45
}
35
46
```
36
47
37
48
Generate tips now. Return ONLY the JSON, no other text.
0 commit comments