@supermemory/memory-graph on npm
Check out the NPM page for more details
Installation
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 withappearance:
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. The endpoint returns each document’s memories asmemoryEntries and its type as type; MemoryGraph reads memories and documentType, so map each document before returning it:
Variants
Console Variant - Full dashboard view: themed surface with a dot grid, nodes colored by theme:Examples
With pagination
Highlighting search results
Custom empty state
Props reference
Core props
Pagination props
Display props
Data types
GraphApiDocument
GraphApiMemory
DocumentWithMemories and MemoryEntry are still exported as backward-compatible types.
Exports
Components
Hooks
Engine classes
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)