Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions flexus_client_kit/integrations/fi_discord2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions flexus_simple_bots/karen/karen_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
)),
Expand All @@ -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, [
Expand Down
4 changes: 4 additions & 0 deletions flexus_simple_bots/karen/karen_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
19 changes: 19 additions & 0 deletions flexus_simple_bots/karen/setup_schema.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
...
}
Expand All @@ -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.
Expand Down
123 changes: 123 additions & 0 deletions flexus_simple_bots/karen/very_limited__tone_consistency.yaml
Original file line number Diff line number Diff line change
@@ -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