Skip to content

feat(chat): show which stored memories informed an answer - #51

Merged
sulthannauval merged 1 commit into
mainfrom
feat/chat-recalled-memories
Aug 6, 2026
Merged

feat(chat): show which stored memories informed an answer#51
sulthannauval merged 1 commit into
mainfrom
feat/chat-recalled-memories

Conversation

@sulthannauval

Copy link
Copy Markdown
Member

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_recalled on the chat stream sets recalledMemories on the assistant
    turn.
  • Rendered as a chip row beside Sources — both answer "what informed this?".
  • Auto-saved turns are counted, not named. Their keys are
    user_msg_<uuid>; the first version rendered five of them and filled the row
    with hex while identifying nothing. Named memories are still named.

Depends on

RantAIClaw #417 (AgentEvent::MemoryRecalledmemory_recalled SSE frame).
Without it the chip row simply never appears.

Validation

npx tsc --noEmit clean, npm test — 156 passed (20 files), including new
coverage 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:

Atlas  LLAMA3
Deployments happen Friday afternoons only.
RECALLED:  ⟐ 5 from this conversation

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/chat before 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.

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.
@sulthannauval
sulthannauval merged commit c309f8e into main Aug 6, 2026
1 check passed
@sulthannauval
sulthannauval deleted the feat/chat-recalled-memories branch August 6, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant