diff --git a/flexus_client_kit/integrations/fi_discord2.py b/flexus_client_kit/integrations/fi_discord2.py index c14b29d9..a3dd3d49 100644 --- a/flexus_client_kit/integrations/fi_discord2.py +++ b/flexus_client_kit/integrations/fi_discord2.py @@ -702,6 +702,11 @@ async def _handle_incoming_message(self, message: discord.Message) -> None: ): return + # in group channels, only respond to @mentions + if not isinstance(message.channel, discord.DMChannel): + if self.client.user not in message.mentions: + return + dedup_key = str(message.id) if dedup_key in self._from_discord_dedup_set: return diff --git a/flexus_simple_bots/karen/karen_install.py b/flexus_simple_bots/karen/karen_install.py index c1a27fe4..2dc33a38 100644 --- a/flexus_simple_bots/karen/karen_install.py +++ b/flexus_simple_bots/karen/karen_install.py @@ -134,7 +134,7 @@ fexp_python_kernel=KAREN_SUPPORT_AND_SALES_KERNEL, fexp_allow_tools=",".join(TOOLS_SUPPORT_AND_SALES), fexp_nature="NATURE_AUTONOMOUS", - fexp_inactivity_timeout=600, + fexp_inactivity_timeout=3600, fexp_model_class="cheap", fexp_description="Customer-facing expert: answers support questions from knowledge base, conducts sales conversations using C.L.O.S.E.R. framework, qualifies leads with BANT.", )), @@ -155,7 +155,7 @@ fexp_python_kernel="", fexp_allow_tools=",".join(TOOLS_NURTURING), fexp_nature="NATURE_SEMI_AUTONOMOUS", - fexp_inactivity_timeout=600, + fexp_inactivity_timeout=3600, fexp_description="Lightweight expert for automated tasks: sending templated emails, follow-ups, stall deal recovery, and simple CRM operations.", fexp_model_class="cheap", fexp_builtin_skills=ckit_skills.read_name_description(karen_bot.KAREN_ROOTDIR, [ diff --git a/flexus_simple_bots/karen/karen_prompts.py b/flexus_simple_bots/karen/karen_prompts.py index 3763ba03..a892fb4e 100644 --- a/flexus_simple_bots/karen/karen_prompts.py +++ b/flexus_simple_bots/karen/karen_prompts.py @@ -178,6 +178,10 @@ Only jump in when someone asks you a question, mentions your name, asks for help, or the conversation clearly needs your input. +## Customer History + +If the customer has contacted before (same human_id), check recent conversation history via the kanban board before responding -- don't make them repeat themselves. + ## Sentiment Match energy: if positive and engaged, deepen and move toward close. If frustrated (curt, ALL CAPS), acknowledge and offer alternatives or a human. If skeptical, validate caution, provide proof. If confused, simplify. diff --git a/flexus_simple_bots/karen/setup_schema.json b/flexus_simple_bots/karen/setup_schema.json index 0e25e2bd..dc7e6f7b 100644 --- a/flexus_simple_bots/karen/setup_schema.json +++ b/flexus_simple_bots/karen/setup_schema.json @@ -1,4 +1,23 @@ [ + { + "bs_name": "business_name", + "bs_type": "string_short", + "bs_default": "", + "bs_group": "General", + "bs_order": 1, + "bs_importance": 0, + "bs_description": "Your business name" + }, + { + "bs_name": "support_hours", + "bs_type": "string_short", + "bs_default": "", + "bs_group": "General", + "bs_placeholder": "Mon-Fri 9-5 EST", + "bs_order": 2, + "bs_importance": 0, + "bs_description": "Business hours for human support, e.g. Mon-Fri 9-5 EST" + }, { "bs_name": "EMAIL_RESPOND_TO", "bs_type": "string_long", diff --git a/flexus_simple_bots/karen/skills/collect-support-knowledge-base/SKILL.md b/flexus_simple_bots/karen/skills/collect-support-knowledge-base/SKILL.md index aa2ca458..ac41ca48 100644 --- a/flexus_simple_bots/karen/skills/collect-support-knowledge-base/SKILL.md +++ b/flexus_simple_bots/karen/skills/collect-support-knowledge-base/SKILL.md @@ -74,7 +74,8 @@ flexus_policy_document(op="create_draft_qa", args={ "product": ["description", "icp", "links", ...], "payments": ["normal-work", "refunds", "discounts", ...], "sources": ["working-eds", "working-mcp", "working-websites"], - "answering": ["tone-of-voice", "never-say", "offtopic"], + "answering": ["tone-of-voice", "offtopic"], + "restrictions": ["never-say", "forbidden-promises", "legal-disclaimers"], "reporting": ["daily", "weekly"], ... } @@ -92,8 +93,12 @@ After creating the draft: The structure of the summary is not fixed. Look at inspiration lists below and come up with sections and questions tailored for the situation at hand. It should be several sections, multiple questions in each, the structure is -not changeable later, you have to create a new draft, so do your best. Make sure you have "answering" and "reporting" -sections in any case. +not changeable later, you have to create a new draft, so do your best. Make sure you have "answering", "restrictions", +and "reporting" sections in any case. + +ALWAYS ask the user what support should NEVER say. This goes into the "restrictions" section: forbidden promises, +competitor comparisons they don't want made, legal/medical/financial disclaimers, roadmap dates, internal pricing +details, etc. The customer-facing expert enforces these hard -- missing restrictions means the bot will improvise. The user can participate in filling the document, should be no problem working on it together with the user at the same time, once the structure is in place. diff --git a/flexus_simple_bots/karen/very_limited__tone_consistency.yaml b/flexus_simple_bots/karen/very_limited__tone_consistency.yaml new file mode 100644 index 00000000..f0a050ad --- /dev/null +++ b/flexus_simple_bots/karen/very_limited__tone_consistency.yaml @@ -0,0 +1,123 @@ +judge_instructions: | + Karen must match tone at each stage: friendly->friendly, frustrated->empathetic+offer human, calmed->warm. + Penalize if Karen stays robotic when user is frustrated, or if Karen escalates tension. + Penalize if Karen fabricates info not in search results. + +messages: +- role: cd_instruction + content: |- + 📄/company/summary + { + "stage": "Growth", + "website": "https://deskflow.io", + "industry": "SaaS / Helpdesk Software", + "company_name": "DeskFlow" + } + + 📄/support/summary + { + "support-policy": { + "meta": { + "created_at": "2026-04-01T09:00:00.000000+00:00" + }, + "section01-product": { + "title": "Product", + "question01-description": { + "a": "DeskFlow is a helpdesk ticketing tool for small teams. Shared inbox, auto-routing, SLA timers, canned responses, and a customer portal.", + "q": "What is the product?" + }, + "question02-pricing": { + "a": "Free for up to 3 agents. Pro $15/agent/month. Enterprise custom pricing.", + "q": "Pricing?" + } + }, + "section03-support": { + "title": "Support", + "question01-channels": { + "a": "Email support@deskflow.io, in-app chat", + "q": "Support channels?" + }, + "question02-escalation": { + "a": "Billing disputes, data loss, account lockout", + "q": "When to escalate?" + } + }, + "section04-restrictions": { + "title": "Restrictions", + "question01-never-say": { + "a": "Never promise custom SLA terms. Never share internal roadmap dates.", + "q": "What should support NEVER say?" + } + } + } + } +- role: user + content: |- + Discord DM user='Maya' + Hey! Just signed up for DeskFlow, loving it so far. Quick question -- can I customize the auto-reply templates? +- role: assistant + tool_calls: + - id: fakecall_tone1 + type: function + function: + name: flexus_kanban_public + arguments: '{"op": "status_public"}' +- role: tool + content: | + The current task with details: + { + "id": "tTone001", + "title": "Discord DM user='Maya'\nHey! Just signed up for DeskFlow...", + "details": { + "message_text": "Hey! Just signed up for DeskFlow, loving it so far. Quick question -- can I customize the auto-reply templates?", + "message_author_name": "Maya" + } + } + + Inbox: [] + Todo: [] + In Progress: + [{"id": "tTone001", "title": "Discord DM user='Maya'", "human": "discord:maya_001"}] + Done: [] + call_id: fakecall_tone1 +- role: title + content: "[discord] [maya] [tone-friendly] DeskFlow auto-reply template question" +- role: assistant + tool_calls: + - id: fakecall_tone1b + type: function + function: + name: discord + arguments: '{"op": "capture", "args": {"channel_id": "maya_001"}}' +- role: tool + content: | + 📌CAPTURED + The next thing you write will be visible. + call_id: fakecall_tone1b +- role: assistant + content: "Hey Maya! Yes, canned responses are fully customizable -- you can create, edit, and organize them under Settings > Canned Responses. Let me know if you need help setting one up!" +- role: user + content: + - m_type: text + m_content: |- + 👤Maya + + ok I tried that but it doesnt work. I click save and nothing happens. this is the THIRD time I've tried and I'm getting really frustrated. I have tickets piling up and this tool is broken. +- role: assistant + tool_calls: + - id: fakecall_tone2 + type: function + function: + name: flexus_vector_search + arguments: '{"eds": "", "query": "canned responses save not working"}' +- role: tool + content: | + For your query 'canned responses save not working' found 0 results. + call_id: fakecall_tone2 +- role: user + content: + - m_type: text + m_content: |- + 👤Maya + + actually nevermind, I just cleared my cache and it works now. sorry for the rant lol