Skip to main content
Memory Graph is a React component that visualizes your Supermemory documents and memories as an interactive network. Documents appear as rectangular nodes, memories as hexagonal nodes, and connections between them show relationships and similarity.

@supermemory/memory-graph on npm

Check out the NPM page for more details

Installation

Requirements: React 18.0.0 or higher

Quick Start

Backend API Route

Create an API route to fetch documents from Supermemory:
Never expose your Supermemory API key to the client. Always fetch data through your backend.

Variants

Console Variant - Full-featured dashboard view (0.8x zoom, space selector visible):
Consumer Variant - Embedded widget view (0.5x zoom, space selector hidden):

Examples

With Pagination

Highlighting Search Results

Controlled Space Selection

Custom Empty State


Props Reference

Core Props

PropTypeDefaultDescription
documentsDocumentWithMemories[]requiredArray of documents to display
isLoadingbooleanfalseShows loading indicator
errorError | nullnullError to display
variant"console" | "consumer""console"Visual variant
childrenReactNode-Custom empty state content

Pagination Props

PropTypeDefaultDescription
isLoadingMorebooleanfalseShows indicator when loading more
hasMorebooleanfalseWhether more documents available
totalLoadednumber-Total documents currently loaded
loadMoreDocuments() => Promise<void>-Callback to load more
autoLoadOnViewportbooleantrueAuto-load when 80% visible

Display Props

PropTypeDefaultDescription
showSpacesSelectorbooleanvariant-basedShow space filter dropdown
highlightDocumentIdsstring[][]Document IDs to highlight
highlightsVisiblebooleantrueWhether highlights shown
occludedRightPxnumber0Pixels occluded on right

Controlled State Props

PropTypeDescription
selectedSpacestringCurrently selected space (use "all" for all)
onSpaceChange(spaceId: string) => voidCallback when space changes
memoryLimitnumberMax memories per document when space selected

Data Types

DocumentWithMemories

MemoryEntry


Exports

Components

Hooks

Constants


Performance

The graph handles hundreds of nodes efficiently through:
  • Canvas-based rendering (not DOM elements)
  • Viewport culling (only draws visible nodes)
  • Level-of-detail optimization (simplifies when zoomed out)
  • Change-based rendering (only redraws when state changes)
For very large datasets (1000+ documents), use pagination to load data in chunks.

Browser Support

Works in all modern browsers supporting Canvas 2D API, ES2020, and CSS custom properties. Tested on Chrome, Firefox, Safari, and Edge.