KGLite¶
An embedded Cypher dialect for LLM-agent workloads. A knowledge
graph that runs inside your Python process — load data, query with
Cypher, hand the graph to an agent via the bundled MCP server. No
server to run, no infrastructure to manage, one .kgl file to ship.
The engine is a pure-Rust crate (kglite); the wheel
(pip install kglite) is a PyO3 wrapper around it. Bolt and MCP
protocol servers are standalone Rust binaries that wrap the same
engine. The .kgl file format is portable across all bindings.
Cypher first
Cypher is the primary query surface — agents already know it, and
the engine targets an explicitly documented openCypher-compatible subset
(including three-valued NULL logic), checked with independently authored local
contracts and optional Neo4j differential runs. DataFrame
loaders add_nodes() / add_connections() exist to get bulk data
in; once it’s in, you query with Cypher.
Embedded, in-process |
No server, no network; |
LLM-agent surface |
Bundled MCP server + |
Cypher subset, honest semantics |
Querying + mutations + |
In-memory by default |
Mapped + disk modes for Wikidata-scale; in-memory is the design centre |
Label model |
One primary type + optional secondary labels — see multi-label rationale |
One-file persistence |
|
Rust-embeddable |
Pure-Rust core; embed without PyO3 — see Rust track |
Ecosystem
kglite is the engine. Two companion projects build graphs it serves — each released and versioned on its own cadence:
kglite — the embedded Cypher knowledge-graph engine (this project): graph + Cypher + fluent API + bundled MCP server.
codingest — parses codebases into code graphs (14 languages, web-framework route detection). Build with it, query the
.kglhere. Requires kglite ≥ 0.14.kglite-datasets — fetch-build-cache loaders for public registries (SEC EDGAR, Wikidata, Sodir).
sonagram — turns a local music library into a kglite knowledge graph via sonara audio analysis (tempo, energy, mood, key); AI agents curate playlists over it through a simple bundled skill and CLI (
pip install sonagram).
Coming from 0.13? The code-graph builder and dataset loaders moved out of
the wheel in 0.14 — see the 0.13 → 0.14 migration guide.
Pin back anytime with pip install "kglite<0.14".
Pick your track
Python guide —
pip install kglite, thenimport kglite. The headline track; covers data loading, Cypher, the MCP server, agents.Rust guide — embed the engine in a Rust binary (
cargo add kglite). For graph-as-a-library use cases without the Python wheel.Operators — running the Bolt server (Neo4j wire compat for cluster-aware drivers).
Reference — Cypher subset reference + fluent API reference + auto-generated Python API.
Concepts — architecture + design decisions + contributor docs.