supermemory/apps/memory-graph-playground
Vorflux AI 1c5ef7e5ed Rewrite @supermemory/memory-graph with perf optimizations and consolidate consumers
Package changes (packages/memory-graph):
- Spatial grid nearest-neighbor: O(n^2) -> O(n*k) for doc-doc edge rendering
- Zoom-based edge culling: skip low-similarity edges at low zoom levels
- Modular canvas engine from mono repo (renderer, simulation, viewport, hit-test)
- Remove vanilla-extract CSS, use inline styles only
- Add motion/react for slide-in animations
- Export mock data generator for stress testing
- Add performance and integration tests (15/15 pass)

Web app changes (apps/web):
- Remove local graph implementation (~4400 lines deleted)
- Add thin wrapper (memory-graph-wrapper.tsx) using useGraphApi hook
- Keep app-specific graph-card.tsx and use-graph-api.ts

Playground changes (apps/memory-graph-playground):
- Add stress test buttons (50/100/200/500 docs)
- Add mock data generation via package
- Convert DocumentWithMemories to GraphApiDocument format
- Show FPS counter during stress tests

All TypeScript compiles clean. Performance tests: 15/15 pass.
2026-03-26 17:58:28 +00:00
..
public runtime styles injection + let user proxy requests for data in graph package + new playground (#588) 2025-11-22 07:04:05 +00:00
src/app Rewrite @supermemory/memory-graph with perf optimizations and consolidate consumers 2026-03-26 17:58:28 +00:00
.gitignore runtime styles injection + let user proxy requests for data in graph package + new playground (#588) 2025-11-22 07:04:05 +00:00
next-env.d.ts graph frontend (#713) 2026-02-09 07:02:20 +00:00
next.config.ts add spaces selector with search (#600) 2025-12-02 18:37:24 +00:00
package.json one more try 2026-03-05 14:30:57 -08:00
postcss.config.mjs add spaces selector with search (#600) 2025-12-02 18:37:24 +00:00
README.md runtime styles injection + let user proxy requests for data in graph package + new playground (#588) 2025-11-22 07:04:05 +00:00
tsconfig.json add spaces selector with search (#600) 2025-12-02 18:37:24 +00:00

Memory Graph Playground

A demo app showcasing the @supermemory/memory-graph package.

Getting Started

bun install
bun dev

Open http://localhost:3000 and enter your Supermemory API key.

Usage Example

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

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

  return (
    <MemoryGraph
      documents={documents}
      isLoading={false}
      isLoadingMore={false}
      error={null}
      hasMore={false}
      loadMoreDocuments={() => {}}
      totalLoaded={documents.length}
      variant="console"
      showSpacesSelector={true}
    >
      <div>No memories found</div>
    </MemoryGraph>
  )
}

Props

Prop Type Description
documents DocumentWithMemories[] Array of documents to display
isLoading boolean Initial loading state
isLoadingMore boolean Loading more documents state
error Error | null Error to display
hasMore boolean Whether more documents can be loaded
loadMoreDocuments () => void Callback to load more documents
totalLoaded number Total number of loaded documents
variant "default" | "console" Visual theme variant
showSpacesSelector boolean Show space filter dropdown