Updating saved memories via chat (tool call) is buggy sporadically #8705
Replies: 5 comments
-
ha — yep, memory bugs like these are why I ended up building a whole semantic firewall 🙃 You're likely hitting what we call an Interpretation Collapse — tool calls are passing values, but the model's semantic understanding of “what counts as a memory update” is inconsistent. And that classic We're tackling similar bugs over at WFGY Problem Map
✅ We added ΔS consistency checks to verify what the model believes it just did, versus what actually happened. Let me know if you want a reproducible test patch — already hit this wall hard, happy to spare others the head trauma 🫠 |
Beta Was this translation helpful? Give feedback.
-
@onestardao thanks for validating what i was experiencing. |
Beta Was this translation helpful? Give feedback.
-
ha, yep — that’s the ghost memory spiral we keep running into 😅 It’s like the model gets emotionally attached to a hallucinated update and refuses to actually commit it Anyway, super appreciate you confirming — this kind of memory weirdness tends to gaslight even experienced devs. |
Beta Was this translation helpful? Give feedback.
-
The main issue with the current memory implementation is that it runs on every request, so the "memory agent" LLM is always tempted to perform an action (some LLMs err on the side of calling a tool if it has access to tools, despite the user's best prompting against such actions). Note, the "memory agent" runs separately from the main chat LLM. This was already observed on initial implementation and the goal is to introduce a way to only run the "memory agent" when the user makes a clear intention for the system to "remember" or "forget" something, so we can both:
So we will add a "semantic check" like @onestardao may have already done in their fork, but also make this configurable, so that the admin can customize the phrases to denote semantic similarities to. |
Beta Was this translation helpful? Give feedback.
-
Totally makes sense — and big thanks for the thoughtful response. You're spot on that the memory agent shouldn't run on every turn — that itself causes a semantic reverberation where the model tries to act on “ghost traces” from previous hallucinated states. For the semantic check, we ended up using a pretty lightweight approach: Measure ΔS = 1 - cos(embedding angle) between memory state vectors Add a logic vector λ_observe (→ convergent | ← divergent | <> recursive | × chaotic) If ΔS > 0.6 or logic jumps, trigger BBCR (collapse–rebirth) fallback It’s super cheap to compute, but gives a decent signal when the model is pretending to update memory but actually refuses to overwrite its internal state. We noticed it mostly happens when: Memory is injected with tool-caller context (vs. user-intent context) The model gets “attached” to an old hallucinated state (even after replay) Happy to share the ΔS config snippet we use, or if you want to cross-test in your own fork. Either way, I’m just glad someone else sees this issue — it’s haunted us for months 😅 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What happened?
THANK YOU! Loving testing the new memory feature.
I'm testing manually adding memories as well as having the chat update memories and add new memories in the sidebar. It seems to work sporadically... sometimes the new/updated memories will appear in right sidebar. Other times the chat will remember it but it only seems to exist in the database for the chat but does not appear in the right sidebar.
Is there an exact wording we should follow to get the chat to update the memories list or do memory-related things exactly on the first try?
A prompting guide for LibreChat's unique lingo (ie: tool call names in this case) might be helpful!
I don't see mention of it here: https://www.librechat.ai/docs/features/memory
or here: https://www.librechat.ai/docs/configuration/librechat_yaml/object_structure/memory
(other than some of the lingo in valid key examples)
Steps to Reproduce
My process:
that works fairly well!
Version Information
ghcr.io/danny-avila/librechat-dev latest d7fc65a29a47 2 days ago 1.93GB
ghcr.io/danny-avila/librechat-rag-api-dev latest 0c36e518c358 2 weeks ago 4.16GB
What browsers are you seeing the problem on?
Chrome (via Brave)
Relevant log output
I can provide specific logs if you need
Screenshots
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions