kglite-visual: see a knowledge graph, and let an agent drive it
kglite-visual is an interactive viewer, a headless renderer and an agent
interface for .kgl knowledge-graph files produced by
KGLite. One command opens a browser on a
localhost server; the same binary draws an image without one; and while the
server runs it speaks the Model Context Protocol, so an agent can drive the
window you are looking at.
The Python wheel has no required runtime dependencies: the graph engine, the HTTP server and the WebGL frontend bundle are all inside one compiled extension. No Node, no separate server process, no database service.
Quick Start
pip install kglite-visual
kglite-visual graph.kgl # opens a browser on localhost
What you land on is not the graph. .kgl files reach 100M+ nodes and no
browser renders that, so the entry screen is the type-level meta-graph —
the labels and relationship types with their counts, always small whatever sits
underneath — and you drill in from there with Cypher and bounded neighbourhood
expansion.
Above: kglite-visual render graph.kgl --cypher "MATCH (f:Field) RETURN f" --layout geo. No tiles, no network — the coastline ships in the binary.
Two more commands, no server and no browser in either:
kglite-visual render graph.kgl --meta -o schema.svg # one image, one JSON line
kglite-visual export graph.kgl --format gexf -o out.gexf # one file for somebody else's tool
Then hand the running server to an agent. The MCP endpoint is on the same port, and its URL is printed on the same stdout line as everything else:
{"url":"http://127.0.0.1:54137/","port":54137,"pid":69850,"graph":"graph.kgl","mcp":"http://127.0.0.1:54137/mcp"}
→ Getting started · Agents and MCP.
What makes it different
Three things this does that a graph viewer normally does not.
An agent drives the window you are watching. The running server speaks MCP
at /mcp — no second process to start, no discovery file, nothing to install:
attaching an agent is pointing it at a URL. Thirteen tools act on one shared
view, last writer wins: read what is on screen, put a Cypher result into it,
expand or collapse, highlight, zoom, recolour, re-lay-out, export it, draw a
picture of it, and run the queries you saved under the names you chose.
Whoever changes the view — you, the agent, a curl — every connected window
sees the change immediately. Watching an agent expand a type and zoom to what
it found is the feature, not a side effect of it.
→ Agents and MCP.
The honesty model: truncation is drawn into the picture. A graph viewer is
a machine for showing you less than there is, and the design position here is
that the subset must name itself. The response bound lives in core, not in
the UI — a guarantee the client implements is not a guarantee — so a curl, an
agent and a second tab all hit the same ceiling. Every bounded answer carries
{returned, total, truncated}; a slice carries two of those, because nodes
and links share one byte budget and a complete node list can sit beside an
incomplete link list. And because an image travels without its response, the
banner is drawn into the image, beside three more counts for the other ways
a picture can be less than its input: types_shown (a canvas too small for the
schema draws the largest types and says top 24 of 98), names_shown (labels
that lost their cell keep their circle and lose their name), and folded (a
fan too big to read is one wedge saying how big it is).
→ The honesty model.
Layouts chosen from the graph's own structure — including a real map. A
force layout is the right tool for a graph with no discoverable shape and the
wrong one for a star, a bipartite result or a schema with disconnected
families, which is most of what a real graph hands it. So a neighbourhood is
drawn as hop rings, a community-structured graph as packed islands with a quiet
boundary round each, and unattached nodes as one labelled grid. And where the
nodes carry coordinates there is --layout geo: an equirectangular projection
whose longitudes are corrected by the cosine of the data's mid-latitude — so a
shelf at 68°N comes out its own shape rather than 2.7× too wide — over the
world's real coastline at three scales chosen by how much of the world the
frame covers, so a North Sea crop gets the fjords and a world map does not
carry 400,000 points nothing can resolve. Nodes with no coordinate go in a
labelled tray with a count, never dropped.
→ Layouts.
From Python, and from a notebook
import kglite_visual as kv
view = kv.show("graph.kgl") # the same server, in-process
view.url # 'http://127.0.0.1:54137/'
view.launch_info # {'url', 'port', 'pid', 'graph', 'mcp'}
view.close() # stops it, frees the port
# Or hand over an in-memory kglite graph — through to_bytes(), never the disk.
import kglite
view = kv.show(kglite.load("graph.kgl"))
In a notebook the returned object renders itself in the cell: a proxy-prefixed
iframe where jupyter-server-proxy can reach the port, and no iframe at
all — the URL plus an ssh -N -L hint — where the kernel looks remote,
because a localhost iframe from a remote kernel is a silently blank frame.
show(path) is the large-graph answer: handing over an in-memory graph costs
about 2× the graph's size at the moment of the call.
→ Python API.
Render and export
# an image: --meta, --cypher "…" or --expand type=T rel=R dir=out
kglite-visual render graph.kgl --meta -o schema.svg
kglite-visual render graph.kgl --cypher "MATCH (f:Field) RETURN f" --layout geo --format png
# a file: graphml | gexf | csv | csv-edges | json
kglite-visual export graph.kgl --format gexf -o graph.gexf
kglite-visual export graph.kgl --format csv --cypher "MATCH (n:Field) RETURN n"
The render's layout is seeded and deterministic — the same request produces
the same bytes, forever — so --seed is how you get a different arrangement
of the same data, and an exact golden baseline is possible at all. Each command
writes its file and prints one JSON line describing it; nothing else ever
touches stdout.
→ Render ·
Export.
Requirements
CPython 3.10+ (one abi3 wheel serves every version from 3.10 up) on macOS,
Linux and Windows, plus a .kgl file written by a matching KGLite release —
this version pins kglite 0.16.22. Building from source additionally needs a
Rust toolchain; the published wheels and the source distribution both carry a
prebuilt frontend, so neither needs Node at install time.
Documentation
Full docs at kglite-visual.readthedocs.io.
- Getting started — install, first launch, the entry screen, the first drill-in,
show()in a notebook. - The viewer — the app in full:
the honesty model ·
layouts ·
query surfaces (editor, saved queries, generated tables, the path builder,
PROFILE/EXPLAIN) · appearance and filtering. - Agents and MCP — the launch contract, the JSON twin, the thirteen tools,
window.__kglv, and what an agent may claim about a screen it cannot see. - Python API · CLI reference · Render · Export.
- Concepts — bounds in core · the protocol · storage · memory.
Rendering is cosmos.gl (MIT, OpenJS Foundation): a WebGL GPU force layout, fed over a binary protocol — typed-array buffers for topology and positions, JSON for metadata.
Stability
Alpha, pre-1.0. The launch contract (one JSON line: url, port, pid,
graph, mcp), the render and export summary lines, and the MCP tool names
are the surfaces to depend on; everything else may move.
CHANGELOG.md
records what a user can see change.
License
MIT — see LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kglite_visual-0.1.7.tar.gz.
File metadata
- Download URL: kglite_visual-0.1.7.tar.gz
- Upload date:
- Size: 2.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48ebc252ed9324b49e408cdf94f338dae82085df2d65b73c11f8d91ed31c1771
|
|
| MD5 |
08382807e5fba9dca990d416b50c896b
|
|
| BLAKE2b-256 |
eeae6035db82e2028f5705a9b2fe2bcaf1b86f884cad54f210bd2942bd57b698
|
Provenance
The following attestation bundles were made for kglite_visual-0.1.7.tar.gz:
Publisher:
release.yml on kkollsga/kglite-visual
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kglite_visual-0.1.7.tar.gz -
Subject digest:
48ebc252ed9324b49e408cdf94f338dae82085df2d65b73c11f8d91ed31c1771 - Sigstore transparency entry: 2697891930
- Sigstore integration time:
-
Permalink:
kkollsga/kglite-visual@799067a7de6fd3e6e73993a4c9a07ff5210c3753 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kkollsga
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@799067a7de6fd3e6e73993a4c9a07ff5210c3753 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kglite_visual-0.1.7-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: kglite_visual-0.1.7-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 10.0 MB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
192d8226e6c9fb297ee5dba3ceb70cb1f285eb4028e398c02672bdb2e21e8651
|
|
| MD5 |
9e82244e6e3ce8de89252ccc1e1976a6
|
|
| BLAKE2b-256 |
04e8466e3dbe58fe3fe105d717eba11922c7f733135ecd2e90de4e2693f3993f
|
Provenance
The following attestation bundles were made for kglite_visual-0.1.7-cp310-abi3-win_amd64.whl:
Publisher:
release.yml on kkollsga/kglite-visual
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kglite_visual-0.1.7-cp310-abi3-win_amd64.whl -
Subject digest:
192d8226e6c9fb297ee5dba3ceb70cb1f285eb4028e398c02672bdb2e21e8651 - Sigstore transparency entry: 2697892522
- Sigstore integration time:
-
Permalink:
kkollsga/kglite-visual@799067a7de6fd3e6e73993a4c9a07ff5210c3753 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kkollsga
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@799067a7de6fd3e6e73993a4c9a07ff5210c3753 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kglite_visual-0.1.7-cp310-abi3-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: kglite_visual-0.1.7-cp310-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 10.1 MB
- Tags: CPython 3.10+, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
982711e283c32bf63aa37583a8ece516d8d0c18e25451595cc201cf0c3ea4098
|
|
| MD5 |
a0076e55160101245678a6b5968b2ba1
|
|
| BLAKE2b-256 |
2263692f91b9538ad511b8602733bf60f858960577e5b1515a5652be3348b307
|
Provenance
The following attestation bundles were made for kglite_visual-0.1.7-cp310-abi3-musllinux_1_2_x86_64.whl:
Publisher:
release.yml on kkollsga/kglite-visual
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kglite_visual-0.1.7-cp310-abi3-musllinux_1_2_x86_64.whl -
Subject digest:
982711e283c32bf63aa37583a8ece516d8d0c18e25451595cc201cf0c3ea4098 - Sigstore transparency entry: 2697892306
- Sigstore integration time:
-
Permalink:
kkollsga/kglite-visual@799067a7de6fd3e6e73993a4c9a07ff5210c3753 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kkollsga
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@799067a7de6fd3e6e73993a4c9a07ff5210c3753 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kglite_visual-0.1.7-cp310-abi3-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: kglite_visual-0.1.7-cp310-abi3-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 9.5 MB
- Tags: CPython 3.10+, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33b7bae4d3290b83377b2d895c167d4c29156526271f0988fc0af67c1c490b3e
|
|
| MD5 |
045bd1835226339c01091e10e8218d6c
|
|
| BLAKE2b-256 |
431487bb4e0acce94101aa1e9046efb6f81940fb6b2cc365c11532d7839e4b49
|
Provenance
The following attestation bundles were made for kglite_visual-0.1.7-cp310-abi3-musllinux_1_2_aarch64.whl:
Publisher:
release.yml on kkollsga/kglite-visual
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kglite_visual-0.1.7-cp310-abi3-musllinux_1_2_aarch64.whl -
Subject digest:
33b7bae4d3290b83377b2d895c167d4c29156526271f0988fc0af67c1c490b3e - Sigstore transparency entry: 2697892051
- Sigstore integration time:
-
Permalink:
kkollsga/kglite-visual@799067a7de6fd3e6e73993a4c9a07ff5210c3753 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kkollsga
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@799067a7de6fd3e6e73993a4c9a07ff5210c3753 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kglite_visual-0.1.7-cp310-abi3-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: kglite_visual-0.1.7-cp310-abi3-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 9.3 MB
- Tags: CPython 3.10+, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f00e27ac3d24c983305b39b073b781901b3b474726321030330ef232eeab8dd8
|
|
| MD5 |
430c12949e5627fa7043619698241fba
|
|
| BLAKE2b-256 |
d0ebcd9dbd5c01f29bdb51cf9c2aeaa822797a608d65d9eeaa72d04bc9fc92af
|
Provenance
The following attestation bundles were made for kglite_visual-0.1.7-cp310-abi3-manylinux_2_28_aarch64.whl:
Publisher:
release.yml on kkollsga/kglite-visual
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kglite_visual-0.1.7-cp310-abi3-manylinux_2_28_aarch64.whl -
Subject digest:
f00e27ac3d24c983305b39b073b781901b3b474726321030330ef232eeab8dd8 - Sigstore transparency entry: 2697892260
- Sigstore integration time:
-
Permalink:
kkollsga/kglite-visual@799067a7de6fd3e6e73993a4c9a07ff5210c3753 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kkollsga
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@799067a7de6fd3e6e73993a4c9a07ff5210c3753 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kglite_visual-0.1.7-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: kglite_visual-0.1.7-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 9.9 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b9f6a4266a8efe34a79cedecd43944ea518f05c6a54a2761df9e2d07f0d618a
|
|
| MD5 |
bf96fb19208f94933f158aa5273debc3
|
|
| BLAKE2b-256 |
1a96dfdb22a05bfc2c59933b48562fab4910feef713ae6ae819b264471d303ff
|
Provenance
The following attestation bundles were made for kglite_visual-0.1.7-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on kkollsga/kglite-visual
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kglite_visual-0.1.7-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
4b9f6a4266a8efe34a79cedecd43944ea518f05c6a54a2761df9e2d07f0d618a - Sigstore transparency entry: 2697892402
- Sigstore integration time:
-
Permalink:
kkollsga/kglite-visual@799067a7de6fd3e6e73993a4c9a07ff5210c3753 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kkollsga
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@799067a7de6fd3e6e73993a4c9a07ff5210c3753 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kglite_visual-0.1.7-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: kglite_visual-0.1.7-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 9.0 MB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
329ef62e357a324f8913fe1b6e5e859a843358a36aa168290016d504542254ba
|
|
| MD5 |
10c856cb65ac6a03fc514e1f10fff213
|
|
| BLAKE2b-256 |
32dc49da8ec9678d4c03f1013ecce149b05eb20e8ecf254ac8e6f3c4d1377608
|
Provenance
The following attestation bundles were made for kglite_visual-0.1.7-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on kkollsga/kglite-visual
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kglite_visual-0.1.7-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
329ef62e357a324f8913fe1b6e5e859a843358a36aa168290016d504542254ba - Sigstore transparency entry: 2697892145
- Sigstore integration time:
-
Permalink:
kkollsga/kglite-visual@799067a7de6fd3e6e73993a4c9a07ff5210c3753 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kkollsga
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@799067a7de6fd3e6e73993a4c9a07ff5210c3753 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kglite_visual-0.1.7-cp310-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: kglite_visual-0.1.7-cp310-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 9.5 MB
- Tags: CPython 3.10+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c14a9229d2e85a41a46fc1a630d0365674e1208757e1c620a8ec217d22b9ec0
|
|
| MD5 |
b202d9a94ad6360ec4e060c2fe528f1e
|
|
| BLAKE2b-256 |
57c5273daf11c903d5e159098047f6ea7d7d0c45ee5cf8cd13a8da5bd75eea82
|
Provenance
The following attestation bundles were made for kglite_visual-0.1.7-cp310-abi3-macosx_10_12_x86_64.whl:
Publisher:
release.yml on kkollsga/kglite-visual
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kglite_visual-0.1.7-cp310-abi3-macosx_10_12_x86_64.whl -
Subject digest:
7c14a9229d2e85a41a46fc1a630d0365674e1208757e1c620a8ec217d22b9ec0 - Sigstore transparency entry: 2697892646
- Sigstore integration time:
-
Permalink:
kkollsga/kglite-visual@799067a7de6fd3e6e73993a4c9a07ff5210c3753 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kkollsga
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@799067a7de6fd3e6e73993a4c9a07ff5210c3753 -
Trigger Event:
push
-
Statement type: