feat: openkb visualize — interactive knowledge graph (3D · mind-map · radial) - #103
Merged
Conversation
KylinMountain
force-pushed
the
feat/visualize
branch
from
June 22, 2026 10:32
192a1ea to
963fd10
Compare
Collaborator
Author
…enkb-deck-neon #101 made openkb-deck-neon the default deck skill (creator.py DEFAULT_DECK_SKILL) but left this test asserting the old openkb-deck-editorial, so it was red on main. Unrelated to visualize.
… HTML build_graph(wiki_dir) walks summaries/concepts/entities, collects nodes (id/label/type/description/sources + in/out degree), resolves [[wikilinks]] to edges (reusing lint._extract_wikilinks/_normalize_target and frontmatter.parse; dirs from schema.PAGE_CONTENT_DIRS), and drops broken/self/duplicate links. render_html injects the graph as JSON into the template (escaping </ so it can't break out of <script>).
Thin read-only command mirroring the other commands' decorators + KB lock: resolve KB -> build_graph -> render_html -> write output/visualize/graph.html. Opens in the browser by default (--no-open for headless), resolve()s the path for a valid file URI, and degrades with a hint if no browser launches.
…-map / radial) One offline HTML page (canvas + DOM, no CDN/network) with three switchable views of the same KB: a 3D force 'nebula' (default; glow, degree-sized nodes, flow particles, idle auto-rotation), an OpenKB-rooted horizontal mind-map (collapsible provenance tree), and a radial OpenKB-centred circle with faint cross-references. Shared: glass inspector panel, search, legend type-filter, spacing slider, reset, smooth auto-fit. Neon-on-dark aurora.
build_graph (nodes/edges/types, broken-link drop, orphan, degree, provenance sources incl. summary full_text); render_html self-contained (canvas, JSON embedded, no http(s), unicode round-trip); CLI writes output/visualize/ graph.html, opens by default, --no-open suppresses, empty wiki writes nothing.
KylinMountain
force-pushed
the
feat/visualize
branch
3 times, most recently
from
June 22, 2026 10:43
c1ae1e7 to
6fdf257
Compare
Add it to the Layer 2 generators table and a '(iii) Visualize' subsection matching the existing (i)/(ii) generator sections: a self-contained interactive knowledge graph (3D / mind-map / radial) written to output/visualize/graph.html.
KylinMountain
force-pushed
the
feat/visualize
branch
from
June 22, 2026 10:47
6fdf257 to
e7e4b3e
Compare
|
@KylinMountain can you trigger a new release? 🙏 |
Collaborator
Author
|
@woutervanranst Thanks for the nudge! It’s actually already out. You can grab it via: Full changelog: https://github.com/VectifyAI/OpenKB/releases/tag/v0.4.2-rc1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
New read-only
openkb visualizecommand that renders the wiki's[[wikilink]]graph as a self-contained, offline, interactive HTML page — pure data + a templated render, no LLM, deterministic.It ships three views of the same knowledge base, switchable from a tab bar (no network, no CDN, works offline):
type, sized by connectivity, soft glow, ambient flow particles, gentle idle auto-rotation; drag to orbit, scroll to zoom, drag a node to pull it out & pin.+/−), centred in the viewport.Shared across all views: a glass inspector panel (type, description, sources, in/out links — each clickable to jump), search, a legend type-filter, a spacing slider, reset, and a smooth auto-fit that frames the graph to the viewport. Opens in the browser by default (
--no-openfor headless); writesoutput/visualize/graph.htmleach run (a shareable snapshot).Why a tree/hierarchy, not just the force graph
A dense wiki (here 71 nodes / 800 edges, avg degree ~22) is a hairball as a raw force graph — intrinsic to the data, not the layout. The mind-map and radial views use the provenance hierarchy that already lives in the frontmatter (each summary's origin document via
full_text; each concept/entity's source summaries viasources), which is a genuinely readable tree.Architecture
openkb/visualize.py—build_graph(wiki_dir)collects nodes/edges/types (reuseslint._extract_wikilinks/_normalize_target,frontmatter.parse,schema.PAGE_CONTENT_DIRS);render_html(graph)injects the JSON into the template (escaped so it can't break out of<script>).openkb/templates/graph.html— the self-contained canvas + DOM template (ships via hatchling's default packaging).openkb/cli.py— thinvisualizecommand (mirrors the other read commands' decorators/lock).Also folds in a one-line fix to a deck-skill test that was already red on
main(unrelated to visualize — #101 changed the default deck skill without updating the test).Test plan
pytest— 810 passedruffclean on new files/code-reviewpasses (incl. an xhigh-effort run after the view churn); findings fixed