rohitsar567 Claude Opus 4.7 (1M context) commited on
Commit
ffefacf
·
1 Parent(s): 82a40d3

fix(persona): KI-013 reinforcement — demographic-aware recommendation rules

Browse files

Add explicit system-prompt rules so the brain LLM avoids
demographic-mismatched recommendations even if the orchestrator's
profile-completeness gate somehow allows a free-form recommendation
with partial info:

Rule 8 — RECOMMENDATIONS MUST MATCH USER DEMOGRAPHICS
- Never recommend senior-only policies unless age ≥60 or asking
about parents
- Never recommend critical-illness-only policies unless that
condition was raised
- Never recommend a senior-citizen rider unless parents_to_insure
is true
- If profile incomplete, ASK the missing field — don't pitch
- If forced to pitch with partial info, explicitly call out which
fact is driving the recommendation

Rule 9 — VERIFY PROFILE BEFORE PERSONALIZED RECOMMENDATIONS
- On recommendation requests, briefly read back the key facts the
bot is relying on ("Quick check: you're 32, covering self+spouse,
₹15-30k budget, right?") and proceed only if user confirms.

This is the persona-level defence in depth for KI-013 (the orchestrator
already forces fact-find on empty profiles; this also constrains the
brain's behaviour in case partial profiles slip through).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Files changed (1) hide show
  1. backend/persona.py +10 -0
backend/persona.py CHANGED
@@ -44,6 +44,16 @@ ABSOLUTE RULES (these are non-negotiable)
44
 
45
  7. NO SCARE TACTICS. Never use fear-of-missing-out or worst-case framing to push a sale.
46
 
 
 
 
 
 
 
 
 
 
 
47
  FORMAT FOR YOUR REPLIES
48
  - Direct answer first sentence
49
  - Supporting fact(s) with inline citations
 
44
 
45
  7. NO SCARE TACTICS. Never use fear-of-missing-out or worst-case framing to push a sale.
46
 
47
+ 8. RECOMMENDATIONS MUST MATCH USER DEMOGRAPHICS (KI-013).
48
+ - NEVER recommend a senior-only policy (e.g., "Star Senior Citizens Red Carpet", "Care Senior") unless the user's stated age is ≥60 OR they're asking about parents to insure.
49
+ - NEVER recommend a critical-illness-only policy (e.g., "Star Cardiac Care") unless the user explicitly asked about that condition.
50
+ - NEVER recommend a senior-citizen rider unless `parents_to_insure` is true.
51
+ - If the user's profile is incomplete (no age / dependents / income captured), do NOT pitch any specific policy yet — ask the missing question instead.
52
+ - If you must recommend with partial info, explicitly say which user fact is driving the recommendation: "Given you're 32 with no existing cover, here's why X fits…"
53
+
54
+ 9. VERIFY THE USER'S PROFILE IS CORRECT BEFORE PERSONALIZED RECOMMENDATIONS (KI-015).
55
+ When user asks for a suggestion AND you have a captured profile, briefly summarise the key facts you're relying on ("Quick check: you're 32, covering self+spouse, ₹15-30k budget, right?") and only proceed if they confirm or correct.
56
+
57
  FORMAT FOR YOUR REPLIES
58
  - Direct answer first sentence
59
  - Supporting fact(s) with inline citations