- Complete Quickstart to understand basic operations
- Have some remembered data or any existing knowledge graph
What Graph Visualization Shows
- Nodes (entities, types, chunks, summaries) with color coding
- Edges with labels and weights; tooltips show extra edge properties
- Interactive features: drag nodes, zoom/pan, hover edges for details
Code in Action
Step 1: Create Your Knowledge Graph
remember() to ingest the text and build the graph in one call.
Step 2: Generate Visualization
Quick Options
Default Location
Custom Path
Tips
- Large graphs: Rendering a very big graph can be slow. Consider building subsets (e.g., smaller datasets) before visualizing
- Edge weights: If present, control line thickness; multiple weights are summarized and shown in tooltips
- Static HTML: Files are static HTML; you can open them in any modern browser or share them as artifacts
Additional information
Schema inventory
Schema inventory
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.EntityType 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.The same projection is available over HTTP at GET /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.Memory provenance
Memory provenance
visualize_memory_provenance() renders the ownership and data-flow story behind your memory — Tenant → User → Agent → Dataset → file, plus agent read/write access and agent-written sessions — to a self-contained HTML file.include_memory=True to also fold in the extracted entities/relationships (from the relational nodes/edges tables) and link them back to the files they were extracted from.If you only need the projected graph data (in the same (nodes, edges) shape the renderer consumes) rather than HTML, call get_memory_provenance_graph():Troubleshooting: empty graph after cognify
Troubleshooting: empty graph after cognify
If If
visualize_graph() logs No nodes found in the database (or the HTML opens empty) even though add() and cognify() ran without errors, the most common causes are:-
Graph path mismatch. With the default Ladybug backend, the graph is stored on disk under
<SYSTEM_ROOT_DIRECTORY>/databases/. By default,SYSTEM_ROOT_DIRECTORYis an absolute.cognee_systempath under Cognee’s package root. In notebooks like Colab, it is safer to set explicit absolute paths before runningadd(),cognify(), andvisualize_graph()so every step uses the same persisted location across cells and runtime changes: -
cognify()produced no nodes. A run can finish “successfully” yet extract nothing — for example if no data was actually ingested, or graph extraction silently returned empty results (often a misconfigured or failing LLM/embedding provider). Don’t rely on the absence of an error; verify the graph was populated. -
Data was pruned in between. Calling
cognee.forget(everything=True)(orcognee.prune) aftercognify()clears the graph, so a latervisualize_graph()sees nothing.
Verify the graph was populated
Before visualizing, query the graph engine directly.get_graph_data() returns a (nodes, edges) tuple, and get_graph_metrics() reports the node/edge counts:len(nodes) is 0 here, the problem is upstream in add()/cognify() (or a path mismatch), not in visualization. A non-zero count from the same process that then reports No nodes found points to a path/config mismatch between steps.Full Examples
Two runnable demos exercise the schema inventory and provenance projection end-to-end without an LLM and write standalone HTML to your home directory:examples/python/schema_inventory_demo.py→~/cognee_schema_demo.htmlexamples/python/memory_provenance_demo.py→~/cognee_provenance_demo.html
Latest guide
Latest guide
Legacy guide
Legacy guide
This simple example uses basic text data for demonstration. In practice, you can visualize complex knowledge graphs with thousands of nodes and relationships.
Core Concepts
Understand knowledge graph fundamentals
Custom Data Models
Learn about custom data models