mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-16 23:41:12 +00:00
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. |
||
|---|---|---|
| .. | ||
| public | ||
| src/app | ||
| .gitignore | ||
| next-env.d.ts | ||
| next.config.ts | ||
| package.json | ||
| postcss.config.mjs | ||
| README.md | ||
| tsconfig.json | ||
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 |