MemoryCard
Transparent AI memory viewer. Shows what the AI remembers about the user with per-item confidence, categories, and the ability to confirm, dismiss, or correct each memory. Trust through radical transparency.
What I Remember
From our last 5 conversations
You're based in Brazil, likely Sao Paulo timezone
Learned from: inferred from activity patternsYou're a senior engineer who values DX and clean architecture
Learned from: code review patternsYou're building taw-ui, an open-source component library for AI tool outputs
Learned from: ongoing project contextYou prefer dark mode in all tools and editors
Learned from: conversation on Mar 2You like pixel art aesthetics and hand-drawn SVG icons
Learned from: design decisions in taw-uiYour stack is Next.js 15 + Tailwind CSS + pnpm monorepo
Learned from: package.json analysisInstallation
npx taw-ui add memory-cardThis copies the component source and schema into your project. You own the code — customize anything.
Usage
import { tool } from "ai"
import { MemoryCardSchema } from "@/components/taw/memory-card"
export const getMemories = tool({
description: "Show what you remember about the user",
parameters: z.object({ scope: z.string().optional() }),
outputSchema: MemoryCardSchema,
execute: async ({ scope }) => {
const memories = await memoryStore.getAll(userId, scope)
return {
id: "user-memory",
title: "What I Remember",
description: `From our last ${memories.count} conversations`,
memories: memories.items.map(m => ({
id: m.id,
content: m.content,
category: m.category,
learnedFrom: m.source,
confidence: m.confidence,
})),
confidence: memories.overallConfidence,
source: { label: "Memory Store" },
}
},
})import { MemoryCard } from "@/components/taw/memory-card"
import { createReceipt } from "taw-ui"
function ToolOutput({ part }) {
const [receipt, setReceipt] = useState()
const handleAction = (id, payload) => {
if (payload.receipt) setReceipt(payload.receipt)
// Send verdicts to your memory store
await updateMemories(payload.verdicts)
}
return (
<MemoryCard
part={part}
onAction={handleAction}
receipt={receipt}
/>
)
}Interaction Pattern
Each memory can be individually reviewed with three verdicts:
This memory is correct
This is wrong, forget it
Close, but needs updating
After reviewing, the card collapses to a receipt: Confirmed 4 · Dismissed 1 · Corrected 1
Props
| Field | Type | Description |
|---|---|---|
| part* | TawToolPart | Tool call lifecycle state |
| onAction | (id, payload) => void | Callback with verdicts when user submits review |
| receipt | TawReceipt | Renders the receipt summary when provided |
| pending | boolean | Disables all interactions while processing |
| animate | boolean | Enable entrance animations (default: true) |
| className | string | Additional CSS classes on the wrapper |
Schema
| Field | Type | Description |
|---|---|---|
| id* | string | Stable identifier |
| title* | string | Title for this memory collection |
| description | string | Context about these memories |
| memories* | MemoryItem[] | Array of individual memories (min 1) |
| confidence | number (0-1) | Overall memory confidence |
| caveat | string | Uncertainty note |
| source | Source | Data provenance (label + freshness) |
| Field | Type | Description |
|---|---|---|
| id* | string | Stable ID per memory |
| content* | string | What the AI remembers |
| category* | enum | preference | fact | context | assumption |
| learnedFrom | string | Where/when the AI learned this |
| confidence | number (0-1) | How sure the AI is this is accurate |
Features
Preference, fact, context, assumption — each visually distinct
Dashed borders + low confidence = the AI is guessing
Each memory shows how certain the AI is
Confirm, dismiss, or correct individual memories
Change your mind on any verdict before submitting
Collapses to a summary after review