Skip to content

๐Ÿคฏ LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

14.3 KB
Raw Blame

Worked example โ€” Memory (่ฎฐๅฟ†) module audit

A real run of this skill against the Memory module, 2026-07 (LOBE-11150) โ€” a personal-AI-memory management area: a home persona dashboard + five isomorphic list surfaces (identities / contexts / preferences / experiences / activities), each with a filter bar, grid / timeline views, a right-side detail panel, and an "Analyze" flow that extracts memory from chat history. Surfaces under src/routes/(main)/memory/**, backed by src/store/userMemory/slices/{home,identity,context,preference,experience,activity,base}. Use it as a template for the output shape, not current-state truth (re-verify before citing).

Surface class: personal AI memory / personalization store โ€” benchmark against ChatGPT "Manage memories", Gemini personalization, Mem0, Personal.ai, CRM "customer 360". Layers run: L1 (static / code) โœ…. L2 / L3 โณ not run.

Headline: two axes fail. (1) The read/write error side has no handling at all โ€” one root cause (every useUserMemoryStore fetch resolves only on success, no onError) hangs list pages on a permanent skeleton, the home page as a false-empty, and detail panels as a permanent blank; the edit modal spins forever on a failed save. (2) The surface-class trust-repair / data-control axis is absent โ€” for a store of data about the user there is no way to correct a wrong memory (only blind-edit or delete), no retain-without-use (pause/exclude), no export, and no undo โ€” exactly what this product class is judged on, and exactly what a code-only read is blind to.

1 โ€” Patterns in use

Pattern (family) Where Rating Note
Overview + Detail (nav) home โ†’ 5 list tabs โ†’ right-panel detail โœ… clean drill; sidebar Nav.tsx
Empty-as-onboarding (growth) list/home empty โ†’ MemoryEmpty + MemoryAnalysis CTA โš ๏ธ activities empty has no CTA (gap X1)
Loading Skeleton (feedback) list Loading.tsx reuses card chrome; DetailLoading โœ… chrome-reusing skeleton (home uses full-page)
Failure + Retry (feedback) every fetch (5 lists + persona/tags + detail + load-more) โ€” abs. systemic root cause (gap A)
Search / filter (read) per-tab FilterBar; q โ†’ queryMemories server-side โœ… server-side search โ€” no false-empty on unfetched
Lists at scale (read) grid + timeline via Virtuoso, page-12 load-more โœ… virtualized + load-more spinner
Selection visibility (read ยง1.3) card click โ†’ ?xId= + right panel โ€” abs. no scroll-into-view, no active highlight (gap D)
Live/polling (read ยง1.7) analysis task poll (useTask.ts) โš ๏ธ failed poll not distinct from running (gap E)
Entity lifecycle โ€” delete (act) *Dropdown delete โ†’ confirmModal (danger) โš ๏ธ confirm ok; no undo, no failure toast
Entity lifecycle โ€” edit (act/edit) EditableModal โ†’ EditorModal โš ๏ธ failed save spins forever (gap B); volatile draft
Entity lifecycle โ€” correct / add โ€” โ€” abs. can't mark-wrong or add manually (gap C, X3)
Wide-blast confirm (act ยง3.7) PurgeButton (delete ALL) โš ๏ธ one-click danger, no type-to-confirm (gap C)
Provenance (source link) SourceLink.tsx โ†’ chat topic โœ… the one class-norm we ship (backward-only)
Data control (export / pause) โ€” โ€” abs. no export, no off-switch, no undo (gap C)
Cross-tab consistency (semantic) 5 list tabs โš ๏ธ activities diverges; sort vanishes on timeline

2 โ€” Strengths / good cases (don't regress)

This surface is strong on the read happy-path and on one write flow (analysis), but weak on error handling and data-control โ€” the gaps in ยง3 rank against that mixed baseline. Keep the following; don't "fix" them.

  • โœ… ไบฎ็‚น โ€” DateRangeModal submit state machine. Double-submit guard + try/catch/finally + success toast + close (MemoryAnalysis/DateRangeModal.tsx:42-60). Load-bearing: this is the exact โœ… contrast to gap B's EditorModal no-finally trap โ€” the model every memory write should copy (reset busy in finally, toast on catch). โ†’ landed as ux Feedback ยง4.2 โœ….
  • โœ… ไบฎ็‚น โ€” Server-side per-tab search. q is passed straight to queryMemories (contexts/index.tsx:57-62, mirrored per tab), so search queries the full set โ€” no client-filter false-"no results" over the loaded page. Load-bearing: search correctness at scale. โ†’ landed as ux Read ยง1.2 โœ….
  • โœ… ไบฎ็‚น โ€” SourceLink provenance. Each item links back to its source chat topic (SourceLink.tsx:16-40, rendered in every *RightPanel). Load-bearing: the one class-norm we ship on the trust axis ("why does it know this") โ€” it anchors the axis gap C says is otherwise absent, so keeping and extending it (backward source โ†’ forward "used in N chats") is the move.
  • โœ… โ€” Virtualized grid + timeline with a real load-more spinner. Virtuoso lists (features/GridView, features/TimeLineView); page-2 shows a footer skeleton (uncached SWR key โ†’ isLoading). Load-bearing: lists-at-scale โ€” the load-more path itself is sound; only its failure is silent (part of gap A).
  • โœ… โ€” Chrome-reusing list skeleton (Loading.tsx keeps card container / border / radius and swaps only text); single-item delete confirm (*Dropdown.tsx:33-44, danger confirmModal); analysis running / error Alert (Status.tsx). Solid, not standout โ€” keep.

3 โ€” Experience gaps (ranked)

๐Ÿ”ด A โ€” No onError / error state anywhere; every fetch resolves only on success. Systemic: each slice sets xSearchLoading=false / xInit=true only in onSuccess with no onError (context/action.ts:88, activity/action.ts:90, identity/action.ts:125, preference/action.ts:91, experience/action.ts:88; persona/tags home/action.ts:27,50; detail base/action.ts:238). No *Error field exists in any initialState. Consumers hang differently:

  • list permanent skeleton โ€” gate is showLoading = xSearchLoading || !xInit (contexts/index.tsx:80); on failure the flag never flips โ†’ skeleton forever, no retry.
  • home false-empty โ€” home gates on SWR isLoading (resolves after retries) then falls to MemoryEmpty when !persona && !roles.length ((home)/index.tsx:52-63) โ†’ a failed load reads as "analyze to get started", inviting redundant re-analysis.
  • detail permanent blank โ€” 5 panels read only {data, isLoading}; content is set only in the isLoading / data branches (ContextRightPanel.tsx:32-34 + 4 twins) โ†’ error and not-found both render an empty panel body.
  • load-more silent no-op โ€” a failed page-2 fetch appends nothing, footer spinner vanishes, reads as "that's all there is" (context/action.ts:44-55). โ†’ Feedback ยง4.2 + Read ยง1.1 (error before empty; error โ‰  not-found). The module's flagship โŒ.

๐Ÿ”ด B โ€” Edit save failure: the modal OK button spins forever, no error, no retry, edit discarded on close. EditorModal onOk runs setConfirmLoading(true) โ†’ await onConfirm โ†’ setConfirmLoading(false) with no try/catch/finally (src/features/EditorModal/index.tsx:35-40), and updateMemory has no .catch / failure toast (base/action.ts:157-236). A rejected write leaves OK permanently loading; closing / reloading loses the edit. โ†’ Feedback ยง4.2 (awaited write, no finally), Act ยง3.1.

๐Ÿ”ด C โ€” Surface-class trust-repair & data-control axis is absent (data about the user). For a store of what the AI believes about you, the class contract is: correct a wrong belief, keep a fact without using it, take your data out, undo a mistake. None exist:

  • No "this is wrong" / report โ€” dropdowns offer only edit + delete (*Dropdown.tsx:47-61); edit is a blind single-field overwrite, and a deleted fact can be re-extracted identically.
  • No retain-without-use โ€” the only way to stop the AI using a fact is to permanently delete it; schema has a status column but no UI on/off (no global "memory off", no per-item pause/exclude).
  • No export / download โ€” crud.ts exposes only get/update/delete/deleteAll; no export in UI.
  • No undo / soft-delete โ€” delete + purgeAllMemories (base/action.ts:54) are hard, no recovery; Purge all is a one-click danger confirmModal with no type-to-confirm (PurgeButton.tsx:34). โ†’ new ux rule (Act ยง3.9) + Act ยง3.7 (wide-blast). L1 is structurally blind to these (no file:line).

๐ŸŸ  X1 โ€” activities empty state has no CTA, and its toolbar drops Analysis. activities/features/List/index.tsx:33 renders <MemoryEmpty> with no children (siblings pass <MemoryAnalysis/>); activities/index.tsx:85 is <ActionBar showPurge> (siblings add showAnalysis). So Activities has no path to Analysis at all and an empty tab dead-ends. โ†’ Read ยง1.1, "consistency is semantic".

๐ŸŸ  D โ€” Deep-linked / restored active item isn't scrolled into view, and cards have no active highlight. grep scrollIntoView|scrollToIndex across the memory tree = 0; Virtuoso mounts at scrollTop=0 (TimeLineView/index.tsx, GridView/index.tsx); cards take no active prop. A ?contextId= below the fold = zero list feedback. โ†’ Read ยง1.3 (the no-anchor case).

๐ŸŸ  E โ€” Analysis flow: failed run has no retry, and a failed poll is indistinguishable from running. Status.tsx:49-71 shows an error Alert with no Retry; useTask.ts keeps last SWR data on a poll error so a failed refresh keeps a stale running frame. โ†’ Act ยง3.1, Read ยง1.7.

๐ŸŸ  F โ€” No global cross-layer search. Each tab searches only itself; searchMemory / retrieveMemory exist in the service (services/userMemory/index.ts) but aren't wired to any UI, so "find everything about X" means repeating the query in 5 tabs. โ†’ Read ยง1.8 (class norm).

๐ŸŸ  G โ€” Manual "Add memory" is impossible from the UI though the backend supports it. add*Memory / createIdentity exist (services/userMemory/index.ts) but no button calls them. โ†’ Act ยง3.4 (lifecycle: create entry point).

๐ŸŸ  H โ€” Sort silently vanishes on switch to timeline (4 tabs). Sort <Select> renders only in grid mode and the chosen sort is dropped on toggle with no signal (contexts/index.tsx:52,106). โ†’ "consistency is semantic".

๐ŸŸ  I โ€” Home persona is read-only and dead-ends. The persona editor + edit trigger are commented out (Persona/index.tsx:16-35, (home)/index.tsx:27,36); persona sections / role tags don't link into the detail tabs. โ†’ Grow ยง5.3, Act ยง3.4.

๐ŸŸก J โ€” Edit draft is volatile; silent discard on close. Source is in-memory editingMemoryContent; destroyOnHidden + onCancel=clearEditingMemory discards with no dirty-check (EditableModal.tsx:9,28). โ†’ Edit ยง2.1 (lighter for modals).

๐ŸŸก K โ€” Score / usage signals inconsistent. Confidence shows for experiences only; scoreImpact / scoreUrgency / scorePriority and accessedCount / lastAccessedAt are stored but never surfaced. โ†’ consistency; class norm (recency/usage signals).

๐ŸŸก L โ€” No bulk-select; only "one" or "everything". Between per-item delete and Purge-all there is no multi-select. โ†’ Act ยง3.1 (bulk โ‡„ single parity).

๐ŸŸก M โ€” No per-layer explanation / onboarding. Five tabs with only generic empty copy; users get no definition of identities vs contexts vs โ€ฆ โ†’ Grow ยง5.1.

๐ŸŸก N โ€” DateRangeModal allows an unbounded all-null range submit with no confirm of scope (DateRangeModal.tsx:42-49); the analysis trigger isn't hard-locked during an in-flight task (AnalysisTrigger.tsx:19). โ†’ friction / Act ยง3.1.

4 โ€” Skill feedback

  • New rule landed: Act ยง3.9 โ€” a surface holding data about the user (memory / personalization / profile store) owes trust-repair + data-control: correct-or-mark-wrong (not just delete), retain-without-use (pause / exclude), export, and undo / soft-delete. Memory is the โŒ example (gap C). Mirrored into the Quick review.
  • Landed as โŒ examples on existing rules (Memory is a textbook instance โ€” no other new rule):
    • Feedback ยง4.2 โ€” the whole userMemory store onSuccess-only / no-onError pattern (gap A)
      • the EditorModal onOk no-finally write trap (gap B).
    • Read ยง1.1 โ€” Memory detail panel (blank on error and not-found) + home false-empty (gap A).
    • Read ยง1.3 โ€” Memory list: no scroll-into-view + no active-card highlight (gap D).
    • Act ยง3.7 โ€” PurgeButton one-click wide-blast, no type-to-confirm (gap C).
  • Landed as โœ… examples on existing rules (the good-case half of ๅ›ž็Œ๏ผŒfrom ยง2):
    • Feedback ยง4.2 โ€” DateRangeModal's submit machine (guard + try/catch/finally + toast) is the in-repo โœ… the write-side-finally rule now cites, directly beside the gap-B โŒ.
    • Read ยง1.2 โ€” Memory per-tab server-side search is the โœ… contrast to the Pages client-filter โŒ.
  • Validated existing rules: ยง4.2 permanent-skeleton, Read ยง1.1 empty-vs-failed, Act ยง3.1 done/error, "consistency is semantic" (gaps X1/H).

5 โ€” Pending: L2 + L3

  • L2 โ€” how the permanent skeleton / blank / false-empty actually render; home full-page loader CLS; whether MemoryEmpty reads as a real page; the persona / tag-cloud layout; dark mode.
  • L3 โ€” force each fetch to fail to confirm gaps A/B/E live (permanent skeleton / blank / spinning modal / stale poll); walk analyze โ†’ running โ†’ done; deep-link a ?xId= below the fold to confirm gap D; force a delete/update failure to confirm the missing toasts.