curl --request GET \
--url https://ndi-api.nace.ai/v1/workspaces/{workspace_id}/tools/kg-info \
--header 'X-API-Key: <api-key>'{
"built_at": "2023-11-07T05:31:56Z",
"coverage": {
"labels_required": [
"<string>"
],
"request_access_hint": "<string>",
"restricted_candidates": 0
},
"edge_total": 123,
"edge_types": [
{
"count": 123,
"type": "<string>"
}
],
"hubs": [
{
"degree": 123,
"node_id": "<string>",
"node_type": "<string>",
"title": "<string>"
}
],
"node_total": 123,
"node_types": [
{
"count": 123,
"type": "<string>"
}
],
"path_prefix": "<string>",
"snapshot_id": "<string>",
"graph": {
"component_total": 123,
"components": [
{
"sampled": 123,
"size": 123,
"isolated": false
}
],
"edges": [
{
"edge_type": "<string>",
"from_node_id": "<string>",
"statements": 123,
"to_node_id": "<string>"
}
],
"isolated_nodes": 123,
"nodes": [
{
"component": 123,
"degree": 123,
"is_document": true,
"node_id": "<string>",
"node_type": "<string>",
"source_file_count": 123,
"title": "<string>"
}
],
"sampled_from": 123,
"truncated": true
}
}{
"error": {
"code": "invalid_request",
"detail": null,
"message": "Request body has extra fields that this operation does not accept.",
"request_id": "req-01j9k2n3p4q5r6s7t8v9",
"retryable": false
}
}{
"error": {
"code": "invalid_request",
"detail": null,
"message": "Request body has extra fields that this operation does not accept.",
"request_id": "req-01j9k2n3p4q5r6s7t8v9",
"retryable": false
}
}kg_info
Return snapshot metadata for the workspace knowledge graph.
Cost class: cacheable.
Returns type distributions, totals, and the highest-degree hub nodes for the
graph built at ingestion. snapshot_id is the cache key: it changes when
the graph is rebuilt, so a caller can detect staleness cheaply. hubs
are good kg_walk entry points when no specific node IDs are known.
When path_prefix is supplied, counts are scoped to files under that
prefix. Omitting it returns workspace-wide totals.
include_graph adds a drawable sample: the backbone of the largest
connected components, the edges among the sampled nodes, and the component
statistics that say what the sample left out. It is for visual clients; a
caller choosing walk seeds wants hubs, which cost nothing.
Call this before kg_search or kg_walk to confirm the graph exists
and to select useful start nodes.
curl --request GET \
--url https://ndi-api.nace.ai/v1/workspaces/{workspace_id}/tools/kg-info \
--header 'X-API-Key: <api-key>'{
"built_at": "2023-11-07T05:31:56Z",
"coverage": {
"labels_required": [
"<string>"
],
"request_access_hint": "<string>",
"restricted_candidates": 0
},
"edge_total": 123,
"edge_types": [
{
"count": 123,
"type": "<string>"
}
],
"hubs": [
{
"degree": 123,
"node_id": "<string>",
"node_type": "<string>",
"title": "<string>"
}
],
"node_total": 123,
"node_types": [
{
"count": 123,
"type": "<string>"
}
],
"path_prefix": "<string>",
"snapshot_id": "<string>",
"graph": {
"component_total": 123,
"components": [
{
"sampled": 123,
"size": 123,
"isolated": false
}
],
"edges": [
{
"edge_type": "<string>",
"from_node_id": "<string>",
"statements": 123,
"to_node_id": "<string>"
}
],
"isolated_nodes": 123,
"nodes": [
{
"component": 123,
"degree": 123,
"is_document": true,
"node_id": "<string>",
"node_type": "<string>",
"source_file_count": 123,
"title": "<string>"
}
],
"sampled_from": 123,
"truncated": true
}
}{
"error": {
"code": "invalid_request",
"detail": null,
"message": "Request body has extra fields that this operation does not accept.",
"request_id": "req-01j9k2n3p4q5r6s7t8v9",
"retryable": false
}
}{
"error": {
"code": "invalid_request",
"detail": null,
"message": "Request body has extra fields that this operation does not accept.",
"request_id": "req-01j9k2n3p4q5r6s7t8v9",
"retryable": false
}
}Authorizations
Path Parameters
Workspace identifier.
Query Parameters
Scope node and edge counts to files under this prefix.
Also return a drawable subgraph in graph: a representative sample of nodes and the edges among them, for a client that renders the graph. Off by default — the sample is far larger than the counts, and a caller that draws nothing has no use for it.
Node budget for the include_graph sample. Ignored when include_graph is false.
1 <= x <= 500Response
Successful Response
Snapshot metadata for the knowledge graph, optionally scoped to a path prefix.
snapshot_id is the cache key: it changes when the graph is rebuilt, so
a caller can detect staleness without re-fetching everything. hubs are
the highest-degree nodes among those a walk can actually expand from —
useful entry points for an initial walk. A node above kg-walk's
hub-degree cap is excluded here even if it outranks every hub shown: it is
never a corridor, so seeding a walk on it would return only the seed.
What the access gate withheld, in counts and label names only.
Never a name, path, or fragment of withheld content. Naming the labels leaks nothing the caller cannot already read from the workspace config, and it turns "some results were withheld" into an actionable request.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
A subgraph small enough to draw, plus the shape of the graph it came from.
Sampling is the point: a real workspace graph has far more nodes than a
node-link diagram can carry, so this is a representative slice — the
backbone of the largest components — never the whole graph. Everything the
slice cannot show is reported as a number beside it (sampled_from,
component_total, isolated_nodes), so the picture is never mistaken
for the census.
Show child attributes
Show child attributes