kgviz
v0.2.2
Published
3D knowledge graph & embedding maps — build standalone HTML, serve demos, cluster agent sessions (npx CLI)
Maintainers
Readme
kgviz (npm)
CLI for the kgviz 3D graph viewer — no Python required for HTML export and session maps.
Install: npmjs.com/package/kgviz
npx kgviz help # run once, no install
npm install -g kgviz # then: kgviz helpCommands
kgviz build — graph from JSON
npx kgviz build graph.json -o graph.html
npx kgviz build graph.json --map --color-by type
npx kgviz build --nodes nodes.json --edges edges.json -o out.htmlgraph.json shape:
{
"nodes": [
{ "id": "A", "label": "Alpha", "color": "#ff6b6b", "size": 8 }
],
"edges": [
{ "source": "A", "target": "B" }
],
"show_legend": true,
"map_mode": false,
"default_view": "3d"
}Nodes with x, y (and optional z) use fixed coordinates (use_coordinates).
kgviz sessions — AI coding session maps
Cluster Cortex Code, Cursor IDE, or Claude Code transcripts into one interactive map.
npx kgviz sessions --per-session -o sessions.html
npx kgviz sessions --source all --color-by topic --topic-model lda
npx kgviz sessions --source claude --color-by project --topic-model rules
npx kgviz sessions --source cortex --method pca --n-topics 12| Flag | Description |
|------|-------------|
| --source | cortex | cursor | claude | all |
| --per-session | One node per chat (not per message) |
| --topic-model | lda (default) | rules | none — how to label topics when --color-by topic |
| --n-topics | LDA topic count (0 = auto, typically 4–20) |
| --cortex-dir | Default ~/.snowflake/cortex/conversations |
| --cursor-dir | Default ~/.cursor/projects (agent-transcripts) |
| --claude-dir | Default ~/.claude/projects (Claude Code CLI) |
| --method | tsne | pca (layouts are 3D embeddings; default 2D view, toggle 3D in the toolbar) |
kgviz serve — local preview
npx kgviz serve graph.html --port 8765Python package
For Jupyter, Streamlit, full t-SNE/UMAP on 10k+ points, and NetworkX integration:
pip install "kgviz[maps]"Publish
From repo root (after cd viewer && npm run build):
cd packages/kgviz && npm install && npm run prepare-viewer && npm publish --access publicLicense
MIT
