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 richer demo builds a representative graph in code — so it runs without an LLM or a graph database — and writes a standalone HTML file with the schema side panel to your home directory:examples/demos/schema_inventory_demo.py→~/cognee_schema_demo.html
Schema inventory
Schema inventory
Graph Visualization
Render your knowledge graph to an interactive HTML file
Memory Provenance
Visualize the ownership and data-flow story behind your memory