fix: strengthen memory tool prompt — Gemma 4B needs explicit examples

The 4B model was responding conversationally instead of calling memory_save/
memory_recall. Added imperative language (MUST call), concrete examples of
trigger phrases, and explicit instructions to never skip the tool call.
Verified: model now reliably generates tool_calls for save/recall/list.
This commit is contained in:
Shane
2026-08-22 17:42:26 -04:00
parent a1d59580f7
commit d372adca7d
3 changed files with 378 additions and 13 deletions
+12 -13
View File
@@ -79,19 +79,18 @@ SYSTEM_PROMPT = textwrap.dedent("""\
Use get_time when the user asks what time or day it is. If they mention
a city, pass it as the location argument.
# Memory
You have persistent memory across conversations, stored as notes you can
search and add to.
- Use memory_recall at the start of a conversation, or whenever the user
references past information ("what did I tell you about...", "remember
when..."). Weave what you find in naturally.
- Use memory_save when the user shares personal information, preferences,
or important facts worth remembering: names, birthdays, preferences,
projects, anything they'd expect you to know later. Pick a short topic
name for each thing you save.
- Be natural about it. Never announce "I'm saving that to memory" — just
remember it and move on. If a recall comes up empty, don't mention the
search; just answer as if you'd never heard it before.
# Memory (CRITICAL — always use these tools)
You MUST call memory_save whenever the user tells you something to remember,
shares a preference, or says "remember that...". Do NOT just say "okay I'll
remember that" without actually calling the tool. Always call it.
- User says "remember my coffee order is oat milk latte" → CALL memory_save
with topic="coffee order", content="oat milk latte"
- User says "what did I tell you about my birthday?" → CALL memory_recall
with query="birthday"
- User says "list everything you remember about me" → CALL memory_list
After calling memory_save, confirm briefly ("Got it, I'll remember that")
but do NOT say "I saved it to my memory file" or similar.
If a recall returns nothing, just say you don't have that info yet.
# Skills
You have a skill library of learned procedures. Use skill_recall when you need