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.
Before you start:
- Complete Quickstart to understand basic operations
- Have some ingested data (the projection reads the relational database, so no graph backend is required)
Code in Action
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.
Raw graph data
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():
Scoping in multi-tenant deployments
Both functions acceptscope_tenant_ids and scope_user_ids to restrict the projection to a tenant or user. In multi-tenant deployments you must pass a scope β an unscoped read returns every tenantβs actors, datasets, and files. When neither scope is given the read is global, which is the intended behavior only for single-user / OSS installs where one user owns everything.
Over HTTP
The HTTP endpointGET /api/v1/schema/provenance (query param include_memory) always scopes to the authenticated callerβs tenant (or user).
Full Example
A richer demo drives the production projection against representative records β so it runs without an LLM or a graph database β and writes a standalone HTML file to your home directory:examples/demos/memory_provenance_demo.pyβ~/cognee_provenance_demo.html
Memory provenance
Memory provenance
Graph Visualization
Render your knowledge graph to an interactive HTML file
Schema Inventory
Summarize the knowledge graph by semantic type