Visualize Json
Return the dataset’s knowledge graph as a JSON-safe payload.
Same authorization, dataset resolution and bounded fetch as GET /visualize — pass the same arguments to get the JSON behind the
same subgraph the HTML page would have shown. Does not include the
semantic layout; see GET /visualize/semantic for that, computed
separately so a client that never opens the semantic tab never pays
for it.
Query Parameters
Same as GET /visualize (dataset_id, full, query, seed_node_ids,
neighborhood_depth, neighborhood_seed_top_k, max_nodes), plus
stream.
Response
A JSON object with nodes, links, color_maps, schema_graph,
schema_data, pipeline_stages, edge_classes, bundles,
provenance_index, has_meaningful_topological_rank, memory_map
and search_events.
Streaming
Sent when the request has Accept: text/event-stream or
stream=true, for graphs too large for one response. Events:
meta (seeds, seed source, bounds); one chunk per read, with
compact nodes (id, name, type, stage, is_unnamed, belongs_to_set,
source_node_set) and links (source, target, relation, edge_class)
whose endpoints were all sent in this or an earlier chunk; summary
(importance and label_priority per node, split into events of at
most one chunk’s size, the first also carrying color_maps.node_set);
done (totals). A failure after the response started is one
error event with message and status. The heavy side payloads
are not streamed, and full=true cannot be streamed.
Error Codes
- 409 Conflict: Dataset not found, permission denied, or the payload could not be built (generic message; full detail is server-logged, not returned, to avoid leaking internals)
- Request validation error (400 on the cognee server, like any
invalid parameter):
max_nodesabove 5000 without streaming, orfull=truewith streaming - 503 Service Unavailable: streamed, and this server already has its maximum number of graph streams open; retry shortly
Notes
- User must have read permissions on the dataset
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
UUID of the dataset to visualize. List your datasets via GET /api/v1/datasets to find it.
""
Include the entire graph instead of a bounded subgraph.
Query string whose nearest vector hits seed the subgraph.
Explicit seed node ids for subgraph neighborhood expansion.
k-hop neighborhood depth for subgraph expansion.
1 <= x <= 10Maximum number of seed nodes.
1 <= x <= 100Hard cap on rendered nodes after expansion. Up to 5000 as JSON, up to 20000 when streamed.
1 <= x <= 20000Stream the graph as server-sent events. Defaults to content negotiation on Accept; true or false decides outright.
Response
Successful Response