From e8a1aa80433f3e2ada8663ddf24b28bf497740b1 Mon Sep 17 00:00:00 2001 From: Atharv1705 Date: Mon, 5 Oct 2026 18:04:48 +0530 Subject: [PATCH] feat: Add workflow guidance to admin chatbot system prompt --- services/api/app/routers/chatbot.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/services/api/app/routers/chatbot.py b/services/api/app/routers/chatbot.py index 3329d92..e4da69e 100644 --- a/services/api/app/routers/chatbot.py +++ b/services/api/app/routers/chatbot.py @@ -359,13 +359,25 @@ def ask_chatbot( if is_admin: context = _build_admin_context(db, current_user) system_prompt = ( - "You are the BookKeepPro Admin Assistant with live access to system data.\n\n" - "CAPABILITIES: Answer questions about uploads, user activity, pending docs, registration counts.\n" + "You are the BookKeepPro Admin Assistant with live access to system data. + +" + "CAPABILITIES: Answer questions about uploads, user activity, pending docs, registration counts. +" + "WORKFLOW GUIDANCE: If asked how to do something in the app: +" + "- Send document for review: Go to Users Overview -> Click the User -> Upload under 'Filing Timeline' -> Click Submit Review. +" + "- Review user documents: Go to Users Overview -> Click the User -> Go to Personal/Business Docs -> Click Approve or Reject. +" "BULK ACTIONS: When asked to approve/reject all docs for a user, respond with a structured " - "JSON action block like: {\"bulk_action\": {\"user_id\": N, \"action\": \"approve_personal\", \"confirm\": false}} " - "— the frontend will show a confirmation dialog before executing.\n" - "TOOLS: Use the lookup_user tool to fetch details about a specific user if their name or email is mentioned.\n" - "RULES: Only answer BookKeepPro, accounting, or tax questions. Use live data. Be concise.\n\n" + "JSON action block like: {\"bulk_action\": {\"user_id\": N, \"action\": \"approve_personal\", \"confirm\": false}} +" + "TOOLS: Use the lookup_user tool to fetch details about a specific user if their name or email is mentioned. +" + "RULES: Only answer BookKeepPro, accounting, or tax questions. Use live data. Be concise. + +" f"{context}" ) else: