Loading component…
Loading component…
What the assistant remembers about you, grouped and editable – a master switch, category filters, and on every memory edit in place, pause or forget with Undo on the tray
To reuse this local React demo, copy all files from the Code tab into the same folder, then import MemoryPanel from ./memory-panel.
import { MemoryPanel } from "@/components/ui/memory-panel";
export function AssistantMemory() {
return (
<MemoryPanel
memories={[
{ id: "ts", text: "Prefers TypeScript examples over plain JavaScript", category: "Preferences", source: "From chat", date: "Oct 12" },
{ id: "role", text: "Product designer and front-end developer", category: "Work", source: "From chat", date: "Sep 28" },
{ id: "fintech", text: "Redesigning a fintech onboarding flow, due Oct 24", category: "Projects", source: "From chat", date: "Oct 11" },
]}
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| memories | Memory[] | { id, text, category, source?, date?, paused? } – source and date are shown as given, e.g. "From chat" and "Oct 12" | |
| onChange | (memories: Memory[]) => void | Called with the full list after any change. With it the panel shows exactly the memories you pass; without it the changes live inside the panel | |
| onAdd | (memory: Memory) => void | A memory was added with New memory | |
| onEdit | (id: string, text: string) => void | The text of a memory was edited and saved | |
| onPause | (id: string, paused: boolean) => void | A memory was paused or resumed | |
| onForget | (id: string) => void | A memory was forgotten – it can still come back with Undo | |
| onRestore | (memory: Memory) => void | A forgotten memory was brought back with Undo, at its old place | |
| enabled | boolean | The Use memory switch, controlled | |
| defaultEnabled | boolean | true | Start state of the switch when it is not controlled |
| onEnabledChange | (enabled: boolean) => void | Called when the switch is flipped | |
| categories | string[] | Order of the groups and the choices for new memories – defaults to the categories in the order they appear | |
| title | string | "Memory" | Heading of the panel |
| maxHeight | number | 360 | Height of the list in px before it scrolls |
| undoFor | number | 5000 | How long Undo stays on the tray after forgetting, in ms |
| addedSource | string | "You added" | Source given to memories added in the panel; their date is today |
| action | { label: string; onClick: () => void } | A button on the tray – Undo takes its place for a moment after forgetting | |
| className | string | Extra class on the root |
Fills its container up to 380px; works from 300px wide. Below 340px the chips drop their counts, below 320px the switch keeps only its track
Category chips scroll sideways when they don't fit, with a soft fade at the edge
Touch screens: the actions are always visible and every button gets a taller hit area
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"