mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-30 01:51:28 +00:00
apps/docs/integrations/memory-graph.mdx and apps/memory-graph-playground/README.md
documented an older version of the @supermemory/memory-graph public API. Following
the Quick Start, Props Reference, or Exports section as written produced code that
either fails to type-check or silently drops props the component no longer has.
Verified against packages/memory-graph/src/{index.tsx,types.ts,api-types.ts,mock-data.ts,
constants.ts} and cross-checked the API normalization logic against two independent
real call sites: apps/web/components/memory-graph/hooks/use-graph-api.ts and
apps/memory-graph-playground/src/app/page.tsx.
- Exports section listed Legend, NodeDetailPanel, SpacesDropdown, useGraphInteractions,
colors, LAYOUT_CONSTANTS - none of these are actually exported. Corrected to the
real exports and added the previously-undocumented ./mock-data subpath.
- All examples used loadMoreDocuments/totalLoaded/selectedSpace/onSpaceChange/
showSpacesSelector, none of which exist on MemoryGraphProps. Corrected to
onLoadMore/totalCount and removed the Controlled Space Selection example
(that feature no longer exists on the component).
- documents was typed as DocumentWithMemories[] with a fabricated shape; the real
prop type is GraphApiDocument[]. Added a toGraphDocument mapping example grounded
in the real production code that talks to /v3/documents/documents.
- Rewrote Props Reference and Data Types to match the real MemoryGraphProps and
GraphApiDocument/GraphApiMemory interfaces field-for-field, including several
real props that weren't documented at all before.
- Removed the false 'space selector visible/hidden' claim from the Variants section
(no such component exists anywhere in packages/memory-graph/src); kept the 0.8x/0.5x
zoom figures, which checked out against constants.ts.
- Made the Pages Router and Express tabs in Backend API Route self-contained (each
defines its own toGraphDocument mapping) instead of depending on code shown only
in the App Router tab, since CodeGroup tabs are alternatives a reader copies
individually.
- Applied the identical corrections to apps/memory-graph-playground/README.md,
which had the same drift independently.
Address Graphite automated review feedback:
- Set the content field in all three toGraphDocument mappings (was a valid but
unpopulated field on GraphApiMemory). Confirmed via use-graph-data.ts that it's
inert for rendering (always overwritten with mem.memory before draw), so this
wasn't visible data loss, but it's a free fix that matches the type exactly.
- Replaced the (data.documents as RawDocument[]) cast with a proper
RawDocumentsResponse type annotation on data in the App Router and Pages Router
tabs, per the custom TypeScript style rule Graphite flagged. Implemented what
the comment's prose described rather than its literal suggested diff, which
would have just deleted the cast and left data as any.
Docs-only change, no .ts/.tsx files touched. This repo's biome.json has no
Markdown/MDX support configured, so format-lint doesn't apply here; checked
fence and MDX-component balance by hand instead (34 fence lines, all CodeGroup/
Note/Warning/Card tags balanced 1:1).
|
||
|---|---|---|
| .. | ||
| browser-extension | ||
| docs | ||
| mcp | ||
| memory-graph-playground | ||
| raycast-extension | ||
| web | ||