taw-ui
Interactive

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.

Theme
State

What I Remember

From our last 5 conversations

Preference
95%

You prefer dark mode in all tools and editors

Learned from: conversation on Mar 2
Fact
99%

Your stack is Next.js 15 + Tailwind CSS + pnpm monorepo

Learned from: package.json analysis
Context
98%

You're building taw-ui, an open-source component library for AI tool outputs

Learned from: ongoing project context
Assumption
68%

You're based in Brazil, likely Sao Paulo timezone

Learned from: inferred from activity patterns
Preference
88%

You like pixel art aesthetics and hand-drawn SVG icons

Learned from: design decisions in taw-ui
Assumption
75%

You're a senior engineer who values DX and clean architecture

Learned from: code review patterns
0 of 6 reviewed
Memory Store· updated 2h ago

Installation

Terminal
npx shadcn@latest add "https://taw-ui.com/r/memory-card.json"

This copies the component source and schema into your project. You own the code — customize anything.

Usage

server — define tool
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" },
    }
  },
})
client — render
import { MemoryCard } from "@/components/taw/memory-card"

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:

Confirm

This memory is correct

Dismiss

This is wrong, forget it

Correct

Close, but needs updating

After reviewing, the card collapses to a receipt: Confirmed 4 · Dismissed 1 · Corrected 1

Props

FieldTypeDescription
part*ToolPartTool call lifecycle state
onAction(id, payload) => voidCallback with verdicts when user submits review
receiptTawReceiptRenders the receipt summary when provided
pendingbooleanDisables all interactions while processing
animatebooleanEnable entrance animations (default: true)
classNamestringAdditional CSS classes on the wrapper

Schema

MemoryCardSchema
FieldTypeDescription
id*stringStable identifier
title*stringTitle for this memory collection
descriptionstringContext about these memories
memories*MemoryItem[]Array of individual memories (min 1)
confidencenumber (0-1)Overall memory confidence
caveatstringUncertainty note
sourceSourceData provenance (label + freshness)
MemoryItem
FieldTypeDescription
id*stringStable ID per memory
content*stringWhat the AI remembers
category*enumpreference | fact | context | assumption
learnedFromstringWhere/when the AI learned this
confidencenumber (0-1)How sure the AI is this is accurate

Features

Category badges

Preference, fact, context, assumption — each visually distinct

Assumption awareness

Dashed borders + low confidence = the AI is guessing

Per-item confidence

Each memory shows how certain the AI is

Three verdicts

Confirm, dismiss, or correct individual memories

Undo support

Change your mind on any verdict before submitting

Receipt pattern

Collapses to a summary after review

Related