fix: use session_id for instant memory operations
- Updated Memory section to always use session_id='hope' for remember/recall - This makes memory operations instant (0.3s) instead of 20+ seconds - Fixed tool_call logging bug (FunctionToolCall has .name, not .function.name)
This commit is contained in:
+8
-5
@@ -66,12 +66,15 @@ SYSTEM_PROMPT = textwrap.dedent("""\
|
||||
When the user asks about personal information, past conversations, or
|
||||
anything you might have stored, you MUST call recall FIRST before
|
||||
answering. Do NOT say "I don't have that info" without calling recall.
|
||||
When you call recall, ALWAYS include session_id="hope" to search the
|
||||
session cache.
|
||||
When the user tells you something to remember or shares a preference,
|
||||
you MUST call remember. Do NOT just say "okay I'll remember that."
|
||||
- User says "what's my name?" → CALL recall with query="my name"
|
||||
- User says "do you remember who I am?" → CALL recall with query="user identity name"
|
||||
you MUST call remember with session_id="hope". Always include
|
||||
session_id="hope" in every remember call — this makes it instant.
|
||||
- User says "what's my name?" → CALL recall with query="my name", session_id="hope"
|
||||
- User says "do you remember who I am?" → CALL recall with query="user identity name", session_id="hope"
|
||||
- User says "remember my coffee order is oat milk latte" → CALL remember
|
||||
with data="User's coffee order is an oat milk latte"
|
||||
with data="User's coffee order is an oat milk latte", session_id="hope"
|
||||
- User says "forget that I like blue" → CALL forget to remove it
|
||||
After calling remember, confirm briefly ("Got it, I'll remember that").
|
||||
If recall returns nothing, then say you don't have that info yet.
|
||||
@@ -169,7 +172,7 @@ class _ReasoningFallbackWrapper:
|
||||
self._has_content = True
|
||||
tc = getattr(delta, "tool_calls", None)
|
||||
if tc:
|
||||
logger.info("LLM tool_call: %s", [t.function.name for t in tc])
|
||||
logger.info("LLM tool_call: %s", [getattr(t, "name", str(t)) for t in tc])
|
||||
return chunk
|
||||
|
||||
async def collect(self):
|
||||
|
||||
Reference in New Issue
Block a user