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

Optional rendering and document navigation

Existing icon-based document nodes and connection styling remain the defaults. Opt in to stacked squares and stronger semantic connections with appearance:
documentNodes accepts 'icons' or 'stacked'; connections accepts 'default' or 'emphasized'. Both fields are optional and also work on GraphCanvas. Stacks stay inside existing node bounds and simplify at low zoom. Use colors.edgeDocument to configure document-source ink; older custom GraphCanvas palettes without that field use textSecondary in emphasized mode. openDocumentOnEnter is off by default. With an onOpenDocument callback, MemoryGraph exposes a focused Enter action for the selected persisted document or one confirmed memory source. Typing, modifier shortcuts, repeats, composition and keys outside the graph do not open documents. Your callback retains responsibility for routing and access control; consumers without a callback receive no new opening behavior.

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

Pagination props

Display props

Controlled state props


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.