Files
loki/packages/knowledge-map/README.md

1.7 KiB

@bitbaum/knowledge-map

The shared graph contract and React constellation used by Loki's Memory page.

The root export provides the versioned snapshot types, graph queries, layout and project handoff formatter. Import the renderer from @bitbaum/knowledge-map/react and load @bitbaum/knowledge-map/styles.css after your theme's CSS imports.

  • Authorize the complete snapshot on the server before giving it to the renderer. Use stable IDs and source references. Only include edges whose two endpoints are visible to the caller. Set visibility to describe that projection and use scopeLabel if the host has a more specific audience label.
  • Supply the existing search input, segmented selector, list, list row and link through controls. The renderer owns search ranking and traversal.
  • Use lenses to choose the categories people browse in your app. Use selectedActions for actions on a record, such as opening a review. Enforce action permissions at the host endpoint as well as at rendering time.
  • Enable downloads explicitly per surface. A download contains a copy and can outlive the access that originally allowed it.

Styles use the host's semantic surface, text, border, accent, radius and shadow tokens. Loki's adapter in src/components/memory/KnowledgeMap.tsx shows how to connect the controls to those styles and use ChatKit dictation.

For an evaluation in another app, pack the workspace from the Loki root with pnpm --filter @bitbaum/knowledge-map pack --pack-destination /path/to/output and install that tarball. Configure the consuming bundler to transpile the package's TypeScript and JSX. Use a versioned registry release for ongoing cross-repository updates.