fix(memory): normalize auto-recall query for /new startup prompts#1228
Conversation
PR ReviewThis PR refactors the auto-recall query normalization logic into a dedicated 此 PR 将 auto-recall 查询的清洗逻辑重构为独立的
|
|
Hey @Naluko! Thanks for the contribution — already merged your PR, thanks for putting this together! 🚀 Btw if you enjoyed contributing and want to stay connected with the project, we run a Discord server for contributors, a chill space to discuss features, ask questions, or pick up new issues 👉🏻 MemOS Discord Server (Contributor Exclusive) Thanks again for shipping this, and happy MemOSing 🧠✨ |
Summary
Fix auto-recall failures caused by
/newand/resetstartup prompts being used as the recall query.Problem
When a new session starts, the runtime may prepend a long startup prompt such as:
A new session was started via /new or /reset...The auto-recall pipeline was trimming some transport metadata, but it could still treat this injected startup text as the search query. That made retrieval noisy or caused it to miss relevant memories entirely.
Root Cause
Auto-recall query extraction only handled a subset of wrapper metadata inline at the call site. It did not normalize session-start prompt text introduced during
/newor/reset, so the retrieval query could become the whole startup prompt instead of the user's actual message.Fix
normalizeAutoRecallQuery(rawPrompt)/newand/resetstartup prompt textResult
Auto-recall now searches with the user's real message content instead of the session-start boilerplate, improving retrieval accuracy in fresh sessions.