supermemory/packages/memory-graph
Vorflux AI 429c7e97ad refactor: simplify graph API - remove backend computation, use client-side layout
- Remove x/y from GraphApiDocument (client computes via force simulation)
- Remove similarity from GraphApiEdge, add edgeType enum
- Replace viewport/bounds/stats API calls with single paginated documents endpoint
- Derive edges client-side from document structure (doc-memory, version, same-space)
- Update MCP client/server to use documents endpoint
- Update MCP UI app for new type shapes
- Update all tests for new API contract
- Progressive loading via useInfiniteQuery (100 docs/page)
2026-03-28 06:04:11 +00:00
..
scripts Fix Cloudflare Workers build: use source exports for workspace, dist for npm publish 2026-03-27 00:30:47 +00:00
src refactor: simplify graph API - remove backend computation, use client-side layout 2026-03-28 06:04:11 +00:00
.gitignore package the graph (#563) 2025-11-19 18:57:56 +00:00
.npmignore package the graph (#563) 2025-11-19 18:57:56 +00:00
CHANGELOG.md MemoryGraph - revamped (#627) 2025-12-29 00:32:26 +05:30
package.json Use prepack/postpack instead of prepublishOnly/postpublish for export swap 2026-03-27 00:33:54 +00:00
README.md add docs for graph package (#603) 2025-12-04 18:56:40 +00:00
tsconfig.json Fix biome lint/format errors: aria-hidden on SVGs, Infinity -> Number.POSITIVE_INFINITY, line length formatting 2026-03-27 00:12:50 +00:00
vite.config.ts Add comprehensive unit tests for memory-graph package 2026-03-27 00:06:21 +00:00

@supermemory/memory-graph

Interactive graph visualization for documents and their memory connections.

npm version License: MIT

Installation

npm install @supermemory/memory-graph
# or
bun add @supermemory/memory-graph
# or
pnpm add @supermemory/memory-graph

Quick Start

import { MemoryGraph } from '@supermemory/memory-graph';
import type { DocumentWithMemories } from '@supermemory/memory-graph';

function App() {
  const [documents, setDocuments] = useState<DocumentWithMemories[]>([]);
  const [isLoading, setIsLoading] = useState(true);

  useEffect(() => {
    fetch('/api/graph')
      .then(res => res.json())
      .then(data => {
        setDocuments(data.documents);
        setIsLoading(false);
      });
  }, []);

  return (
    <div style={{ height: '100vh' }}>
      <MemoryGraph
        documents={documents}
        isLoading={isLoading}
        variant="console"
      />
    </div>
  );
}

Features

  • Interactive canvas visualization - Pan, zoom, and drag nodes using Canvas 2D rendering
  • Document and memory nodes - Documents as rectangles, memories as hexagons
  • Relationship visualization - Edges show document similarity and memory version chains
  • Space filtering - Filter by workspace or view all memories
  • Two variants - Full-featured console mode or embedded consumer mode
  • Pagination support - Load more documents on demand
  • TypeScript support - Full type definitions included

Essential Props

Prop Type Description
documents DocumentWithMemories[] Array of documents with their memory entries
isLoading boolean Show loading state
variant "console" | "consumer" Display mode (default: "console")
error Error | null Error to display
loadMoreDocuments () => Promise<void> Function to load more data
highlightDocumentIds string[] IDs of documents to highlight

Documentation

Full documentation available at docs.supermemory.ai:

Requirements

  • React 18+
  • Modern browser

License

MIT