Kanshō

Docs / Memory and context /

MemoryGraph

Graph visualization of memory nodes and their relationships.

Preview

  • Joey (user) owns kansho-ui
  • Joey (user) has Q2 launch deadline
  • Joey (user) prefers TypeScript pref
  • kansho-ui gates Q2 launch deadline
  • Joey (user) member_of Kanshō workspace
EntityEpisodic

Props

PropTypeDescription
nodes*MemoryGraphNode[]Graph nodes — entities and episodic events with pixel positions.
edges*MemoryGraphEdge[]Directed edges between nodes with an optional relationship label.
selectedIdstring | nullID of the currently selected node. Controls the detail sidebar.
onSelect(id: string) => voidCalled when the user clicks a node.
heightnumberCanvas height in pixels. Defaults to 360.
classNamestringAdditional CSS classes for the outer grid.

* required.

Usage

import { MemoryGraph } from "@/components/memory/memory-graph";

const [selectedId, setSelectedId] = React.useState<string | null>(null);

<MemoryGraph
  nodes={nodes}
  edges={edges}
  selectedId={selectedId}
  onSelect={setSelectedId}
  height={360}
/>