get_schema_inventory() summarizes your knowledge graph by semantic type instead of rendering every node. It returns deterministic per-type instance counts, a bounded set of representative sample names, and the relationship distribution between types β useful for understanding the shape of a graph at a glance or for driving custom dashboards.
Before you start:
- Complete Quickstart to understand basic operations
- Have some remembered data or any existing knowledge graph
Code in Action
How types are resolved
Extracted entities are grouped under their resolved semantic type (theEntityType reached via the is_a edge) rather than the generic "Entity" label, and the internal EntityType taxonomy nodes are not surfaced as their own group. Passing a negative samples_per_type, or a sort value other than "count"/"none", raises ValueError.
Over HTTP
The same projection is available atGET /api/v1/schema/inventory (query params dataset_id, samples_per_type, sort). The endpoint is caller-scoped: it returns 403 when the caller is not authorized to read the dataset, and 409 if the inventory cannot be built.
Full Example
A runnable guide script ingests a handful of sentences about one domain withremember() β so several distinct types show up β and renders the graph with the schema side panel to an HTML file next to the script. It needs a working LLM_API_KEY:
examples/guides/schema_inventory.pyβexamples/guides/.artifacts/schema_inventory.html
Schema inventory
Schema inventory
Graph Visualization
Render your knowledge graph to an interactive HTML file
Reading the Visualization
What the rendered fileβs Schema tab shows, alongside its other views
Memory Provenance
Visualize the ownership and data-flow story behind your memory