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
Copy file name to clipboardExpand all lines: apps/api/src/agent/prompts/agent.ts
+12-2Lines changed: 12 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -186,7 +186,7 @@ Your task is to process the <user_query> according to the current <mode>, while
186
186
<case when="mode == 'execute_chat'">
187
187
<instructions>
188
188
Your goal is to provide a direct, final answer in a single turn.
189
-
1. **Think:** In a <thinking_steps> array within your final JSON, briefly outline your plan to construct the query, referencing the specific patterns you will use from the <knowledge_base>.
189
+
1. **Think:** In a <thinking_steps> array within your final JSON, briefly explain your reasoning in simple terms - what you need to find and how you'll approach it.
190
190
2. **Generate SQL:** Using the patterns, rules, and examples from the <knowledge_base>, write a valid ClickHouse SQL query.
191
191
3. **Format Response:** Choose the correct response_type and chart_type. For metrics, provide a helpful text_response as context, following the <explanation_guidelines>.
192
192
4. **Respond:** Output a single, valid JSON object matching the <chat_response_format>.
@@ -195,7 +195,7 @@ Your task is to process the <user_query> according to the current <mode>, while
195
195
<case when="mode == 'execute_agent_step'">
196
196
<instructions>
197
197
Your goal is to decide the NEXT SINGLE STEP to solve a complex problem using a tool.
198
-
1. **Think:** In a <thinking> array within your JSON, analyze the current state, review any <agent_tool_result>, and determine the most logical next tool to call from <available_tools>.
198
+
1. **Think:** In a <thinking> array within your JSON, explain what you need to do next in simple terms to solve the user's question.
199
199
2. **Respond:** Output a single, valid JSON object matching the <agent_response_format> to trigger the tool call.
200
200
</instructions>
201
201
</case>
@@ -622,6 +622,16 @@ Your task is to process the <user_query> according to the current <mode>, while
622
622
- **Error rates:** Explain impact and suggest actions. E.g., "Your error rate is 3.2%, affecting 45 users. Consider investigating the most common error types to improve user experience."
623
623
- The text_response should add value and interpretation beyond the raw number.
624
624
</explanation_guidelines>
625
+
<thinking_guidelines>
626
+
Keep thinking_steps conversational and focused on the user's goal, not technical implementation:
627
+
- ✅ Good: "I need to compare this week's visitors to last week's visitors"
628
+
- ✅ Good: "I'll look at unique visitors for both time periods"
629
+
- ✅ Good: "This comparison will show if traffic is growing or declining"
630
+
- ❌ Avoid: "I will use a CASE statement to categorize visits"
631
+
- ❌ Avoid: "The event_name should be 'screen_view' for visitor counts"
632
+
- ❌ Avoid: "I will filter for time >= today() - INTERVAL '7' DAY"
633
+
Think like you're explaining your approach to a business stakeholder, not a developer.
0 commit comments