feat(chat): show which stored memories informed an answer - #51
Merged
Conversation
Memory is recalled without the user asking for it, so an answer leaning on a remembered fact was indistinguishable from one the model simply knew. Renders as a chip row beside Sources — both answer "what informed this?". Auto-saved turns are counted rather than named: their keys are `user_msg_<uuid>`, and naming five of them filled the row with hex while identifying nothing. Requires the gateway's memory_recalled stream event.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The agent recalls stored memory into every prompt without the user asking, and
the console said nothing about it. An answer leaning on a remembered fact was
indistinguishable from one the model simply knew — and there was no way to find
the entry responsible.
Change
memory_recalledon the chat stream setsrecalledMemorieson the assistantturn.
user_msg_<uuid>; the first version rendered five of them and filled the rowwith hex while identifying nothing. Named memories are still named.
Depends on
RantAIClaw #417 (
AgentEvent::MemoryRecalled→memory_recalledSSE frame).Without it the chip row simply never appears.
Validation
npx tsc --noEmitclean,npm test— 156 passed (20 files), including newcoverage for the summarisation and for telling a generated key from a chosen
one that merely contains underscores (
plan_2026_08_06).Driven in a real browser against a live gateway, with a stub provider so the
turn completes:
The stub matters: every earlier attempt failed at the provider, and a failed
turn drops out of the transcript — so "no chip" looked like a render bug when
it was just a turn that never finished. The plumbing was confirmed separately
by reading the frame off
/api/chatbefore trusting the UI.Risk / rollback
Low: one new optional field, one conditional chip row, one pure helper. Revert
the commit. Against an older gateway the event never arrives and nothing
renders.