fix(kb): pin /kb/ask prompt to Israeli National Insurance context
The KB UI's ask mode was hijacking into generic Israeli law. Asked "מתי אפשר לבקש דיון מחדש לפי תקנה 37?" Shira answered with תקנה 37 of תקנות סדר הדין האזרחי (civil procedure) instead of תקנה 37 to the National Insurance regulations — even though search_insurance_kb has the correct source. Append a short context block to the system prompt telling Shira that every question from the KB UI is about ביטוח לאומי, that she must call search_insurance_kb first and cite section_ref, and that she must say so explicitly if no KB section matches. Refs Task Master #2 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -145,6 +145,17 @@ async def ask(body: AskRequest, request: Request):
|
|||||||
user_profile="",
|
user_profile="",
|
||||||
available_skills=list_skills(),
|
available_skills=list_skills(),
|
||||||
)
|
)
|
||||||
|
# Pin the question to the insurance KB context so generic-law answers
|
||||||
|
# (e.g. "תקנה 37 לתקנות סדר הדין האזרחי") don't hijack the response.
|
||||||
|
system_prompt += (
|
||||||
|
"\n\nContext: The user is asking from the Knowledge Base UI of the "
|
||||||
|
"Israeli National Insurance firm. Every question should be answered "
|
||||||
|
"from the KB of חוק/תקנות/חוזרי הביטוח הלאומי. Before answering, "
|
||||||
|
"call search_insurance_kb to retrieve the relevant sections, and "
|
||||||
|
"cite them explicitly with section_ref (ס' N, תקנה N, or חוזר N/YYYY). "
|
||||||
|
"Never answer from generic legal training if the KB has a matching "
|
||||||
|
"section — if no KB section matches, say so explicitly."
|
||||||
|
)
|
||||||
|
|
||||||
messages: list[dict] = []
|
messages: list[dict] = []
|
||||||
for m in (body.conversation_history or []):
|
for m in (body.conversation_history or []):
|
||||||
|
|||||||
Reference in New Issue
Block a user