Where people see and edit what an AI assistant remembers, grouped by category with the chats it came from. Edits, undo and pause all move smoothly.
- Kategori
- Yapay zekâ
- Kullanılan bileşenler
- 20
- Dosyalar
- 10
- Kullanım örnekleri
- 3
- Erişim
- HextaUI Pro (55 blok)
- Kaynak kod güncellendi
- Sayıldığı yer
- Bileşen kullanım çalışması
HextaUI Pro’nun parçası, 55 bloğun tamamı, $49 tek seferlik, Planları karşılaştır
Memory is the page where people see what an assistant remembers about them, fix what it got wrong and take things back. It opens with one summary: whether memory is on, paused or off, how many things the assistant remembers and a meter with one colour per category. Memories are grouped under those categories, each one sentence with the chat it came from, when it was saved and when it was last used. Long memories fold to three lines with Show more, and text in any direction lays out on its own.
Click a memory to edit it in place. The text stays exactly where it was and a field appears around it, with Enter to save and Esc to cancel. Clearing the text asks whether to delete it instead, so an empty memory is never saved. Delete folds the memory away and shows a toast with Undo for five seconds, and onDelete only runs once that window closes, so Undo needs nothing from your server. Select picks several memories for one delete behind a confirmation, and Forget everything asks for a typed word first.
Pause works like a temporary chat for everything. The summary says memory is paused and that nothing was deleted, the list stays visible but quieter, and Resume is the same button. Turning Reference saved memories off says what that means in the same place. Near the limit the meter says so calmly and offers Review least used, which lists the oldest unused memories first.
Every change moves the page smoothly. A memory, a whole category, the add form, a note or an error opens and closes with its height, so everything below slides instead of jumping, and Undo brings a memory back the same way. A memory saved in the background keeps its place when its real id arrives. With reduced motion everything changes at once.
Search covers the memory, its source and its labels. Filter narrows to a category or a project, since a memory can apply to every chat or to one project, and sorts by newest, recently used or least used. Sorting by use shows one list with each memory’s category. While a memory is being edited the list keeps its order, so it never jumps out from under the cursor. Memories that disagree, such as short answers and detailed answers, are flagged with May conflict with and a link to the other one. Long lists render 50 rows at a time and load more as you scroll.
MemoryUpdatedChip is the quiet line a chat shows when the assistant saves something, with the memory and Manage. Drop it into Chat Thread messages when your save_memory tool runs.
HextaUI Pro'yu alın
Tek bir ödeme, gelecekte eklenecekler dahil tüm blokların kilidini açar. Fiyatları görün.
Pro registry'yi components.json dosyasına ekleyin
components.json Token'ınızı ekleyin
Hesap sayfanızda bir token oluşturun ve
.env.localdosyasınaHEXTAUI_PRO_TOKENolarak ekleyin.Bloğu ekleyin
pnpm dlx shadcn@latest add @hextaui-pro/memory
Save memories from an AI SDK tool
Give the model a save_memory tool that writes to your database, and render Memory with the same rows. Every change is shown at once and rolls back with a message if your callback throws. Deletes wait out the undo window before onDelete runs.
Show Memory updated in a chat
When the save_memory tool part appears in a message, render MemoryUpdatedChip inside ChatAssistantMessage. It reads Saving to memory while the call runs and Memory updated when it’s done, and Manage opens Memory with that memory highlighted.
A compact panel in settings
variant="compact" keeps one switch, the storage meter, search and the list, for a settings section or a side panel. Pass now to pin dates on the server and in tests.
Yapı
Dıştan içe doğru birleştirdiğiniz parçalar.
| Parça | Açıklama |
|---|---|
Memory | The whole page: the summary, the switches, search and filters, the add form, the grouped list with selection, and the dialogs. |
Summary | Whether memory is on, paused or off, how many things are remembered, the storage meter by category, and the paused, off and nearly full notes. |
Category group | A heading with the category’s colour and count, above its own list of memories. Empty categories fold away. |
Memory row | The sentence, then one line with the source chat and date, last used and the project, any conflict, and a menu with Edit, Category, Used in, Open source chat and Delete. |
MemoryUpdatedChip | The line inside a chat message when a memory is saved, updated or removed, with Manage. |
MemorySkeleton | A loading placeholder shaped like the page, for SettingsSection’s skeleton prop. |
Forget everything dialog | Deletes every memory after the confirm word is typed. It can’t be undone, so it waits for onForgetAll. |
Memory
Also accepts every div prop.
| Prop | Tür | Varsayılan |
|---|---|---|
memories{ id, text, category?, scope?, source?, createdAt, lastUsedAt?, conflictsWith? }. scope is a project value, or null for every chat. source is { label, href? } for the chat it came from. conflictsWith lists ids of memories that disagree with this one. Dates take a Date, an ISO string or a timestamp. | MemoryRecord[] | – |
enabledWhether the assistant saves and uses memories. When off, the summary explains it and the list stays as it is. | boolean | – |
historyEnabledWhether the assistant may look back at past chats. | boolean | false |
pausedPauses memory. The summary says so and that nothing was deleted, and Pause becomes Resume. | boolean | false |
onToggleCalled when a switch, Pause or Resume changes. The control moves right away and goes back if this throws. | (setting: "enabled" | "history" | "paused", value: boolean) => void | Promise<void> | – |
onAddAdds Add memory. The new memory shows as Saving until you return the saved record. Throw to show Try again and Discard. | (input: { text, category?, scope? }) => Promise<MemoryRecord> | – |
onEditCalled for inline edits and for Category and Used in in the row menu. Without it memories can’t be edited. | (memory, changes: { text?, category?, scope? }) => void | Promise<void> | – |
onDeleteDelete the memory. Runs after the undo window. Throw and it comes back with a message. | (memory) => void | Promise<void> | – |
onDeleteManyDelete a selection in one call. Without it, onDelete runs for each one. | (memories) => void | Promise<void> | – |
onForgetAllAdds Forget everything. The dialog waits for it and keeps everything if it throws. | () => void | Promise<void> | – |
limitHow much memory holds, in the same unit as used. At 80% the summary says it’s nearly full and at 100% Add memory turns off. | number | 4000 |
usedHow much is used, if your server counts tokens. Defaults to the characters in every memory. | number | – |
categoriesThe categories memories are grouped by, in this order. tone is chart-1 to chart-5 and colours the group’s dot and its part of the meter. | { value, label, tone? }[] | About you, Preferences, Work, Projects |
projectsProjects a memory can be scoped to. Adds Used in to the filter, the row menu and the add form. | { value, label }[] | [] |
highlightA memory id to scroll to, focus and briefly highlight, for example after Manage in a chat. Clears search and filters so it’s visible. | string | null | – |
variantcompact keeps one switch, the meter, search and the list, without selection or Forget everything. | "full" | "compact" | "full" |
assistantThe assistant’s name in every sentence. | string | "Hexta" |
undoTimeoutHow long Undo stays, in milliseconds. 0 deletes right away. | number | 5000 |
pageSizeRows rendered at a time. More load as the end of the list scrolls into view. | number | 50 |
confirmWordThe word typed to confirm Forget everything. | string | "forget" |
nowPins the clock for dates, for tests and server rendering. | Date | – |
MemoryUpdatedChip
Also accepts every div prop.
| Prop | Tür | Varsayılan |
|---|---|---|
memoryThe memory, shown on one line with the full text on hover. | { text } | string | – |
actionSaved to memory, Memory updated or Removed from memory. | "saved" | "updated" | "deleted" | "updated" |
statussaving shimmers while the tool runs. error shows the message and Try again. | "saving" | "done" | "error" | "done" |
errorReplaces Couldn’t save to memory. | string | – |
onManageAdds Manage, usually opening Memory with highlight set to this memory. | () => void | – |
onRetryAdds Try again when status is error. | () => void | – |
| Tuş | Action |
|---|---|
| Enter | On a memory, starts editing it. While editing, saves. |
| Esc | Cancels the edit, clears the search or leaves Select. |
| F2 | Edits the memory whose row has focus. |
| Delete | Deletes the memory whose row has focus, with Undo. Backspace works too. |
| ⇧Enter | Adds a line break while editing or adding. |
- Each category is its own list, named by its heading and aware of its full length, so screen readers say “3 of 12” even while only part of it is rendered.
- Saving, deleting, restoring, pausing and failures are announced through a polite live region, such as “Memory deleted. Undo is available for a few seconds.”
- Focus never gets lost: after a delete it moves to the next memory, Undo puts it back on the restored one, and Manage focuses the highlighted memory. A row on its way out is inert.
- Status is never color alone. On, paused and off, saving, errors, conflicts and the storage meter all have their own words, and the meter reports “72% full”.
- With reduced motion, rows, groups and notes appear and disappear at once instead of folding.
- Text uses dir="auto", so a memory in Arabic or Hebrew reads right to left inside an English page.
Şunlarla geliştirildi
Memory bloğunun yapıldığı ücretsiz HextaUI bileşenleri. Her biri tek başına yüklenir.
Kod
10 dosya, components/blocks/memory konumuna eklendi.