Skip to content

Commit 6c3d500

Browse files
fix: add brevity style rules to dashboard agent prompts
Update DashboardAgentService.java with explicit instructions for concise replies: 1. buildChatTask() - Chat-only replies (greetings, questions): - Added: lead with the answer, no filler phrases 2. buildTask() dashboard-note instructions - Build completion notes: - Keep to 1-3 short lines - Use markdown bullets when listing multiple items - Lead with what changed, skip filler phrases - Only allow longer replies for errors or limitations - Skip phrases like 'I've created...', 'As requested...' - Never open with 'Done' or 'Great' The frontend ReactMarkdown rendering (previous commit) now has properly-structured content to display. Co-authored-by: Venkat SF <venkatesh.sakamuri@stayflexi.com>
1 parent 39d4a2f commit 6c3d500

1 file changed

Lines changed: 19 additions & 9 deletions

File tree

‎backend/src/main/java/com/dbaagent/service/DashboardAgentService.java‎

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ private String buildChatTask(String prompt) {
220220
+ "It does not read as a request to build or change a chart/dashboard — it looks like a "
221221
+ "greeting, small talk, or a question about what you can do. Reply briefly and naturally "
222222
+ "in plain text (no HTML, no code block, no tool calls, no grounding, no SQL). If it's a "
223-
+ "greeting, greet back and invite them to describe a dashboard. Keep it to 1-2 sentences.";
223+
+ "greeting, greet back and invite them to describe a dashboard.\n\n"
224+
+ "STYLE: Keep it to 1-2 short sentences. Lead with the answer. No filler phrases like "
225+
+ "\"Great question!\" or restating what they asked. Just answer directly.";
224226
}
225227

226228
// ── the task the agent runs ────────────────────────────────────────────
@@ -335,17 +337,25 @@ Output your FINAL message as ONLY fenced blocks (one ```dashboard-shell``` first
335337
outside a fence, no tool calls after the last one.
336338
Do NOT wrap the whole thing in a single ```html block — the shell and each widget are SEPARATE fences.
337339
338-
7. END with a ```dashboard-note``` fence: 1-3 sentences to the person who asked, in the same plain
340+
7. END with a ```dashboard-note``` fence: a SHORT reply to the person who asked, in the same plain
339341
business language as the two hard rules above (a note naming a table, a column, SQL, or the
340342
connection id breaks the same security requirement the dashboard itself is bound by).
341-
Say what THIS turn actually changed — not that a dashboard exists. Then, in the same note:
342-
- State anything you could NOT do, could not verify, or chose to skip, and why. A build that
343-
partly worked must say so. Never claim a number is correct because a query returned it.
343+
344+
REPLY STYLE — brevity is mandatory:
345+
- Lead with what changed or what you built. No filler, no restating their request.
346+
- Keep it to 1-3 short lines. Use markdown bullets when listing multiple items (requirements
347+
met, status updates, or next steps). Never write long paragraphs.
348+
- Skip phrases like "I've created...", "Here's what I did...", "As requested...". Just state
349+
the facts: "Added revenue chart. Date range defaults to last 30 days."
350+
- Only write more than 3 lines when explaining an error, a limitation you hit, or a breaking
351+
change — and even then stay concise.
352+
353+
Content requirements (still apply):
354+
- State anything you could NOT do, could not verify, or chose to skip, and why.
344355
- If the user was correcting or disputing something (a wrong figure, a chart that didn't load),
345-
say plainly whether it is now fixed, and what the value/behaviour is now versus what they
346-
reported. If you could not reproduce or resolve their complaint, say THAT — do not answer a
347-
correction with a description of what you built.
348-
Write it as you would to a colleague: specific and short. Never open with "Done".""");
356+
say plainly whether it is now fixed. If you could not resolve it, say THAT.
357+
- Never claim a number is correct just because a query returned it.
358+
- Never open with "Done" or "Great".""");
349359
return sb.toString();
350360
}
351361

0 commit comments

Comments
 (0)