Get the knowledge graph

knowledgeGraph(projectReference: ID!, input: KnowledgeGraphInput): KnowledgeGraph!

Arguments

ArgumentTypeRequiredDescription
projectReferenceID!YesProject whose knowledge is selected. Ordinary callers require project.knowledge.read. A run-bound MCP service credential instead must match the persisted run's project and agent plus its actor or runtime transport binding; its effective sealed authority must grant the invoked tool and a knowledge selector. On project-scoped MCP endpoints, the scoped project supplies this value when omitted.
inputKnowledgeGraphInputNo

Input fields

input

KnowledgeGraphInput

FieldTypeRequiredDescription
lookupTargetKnowledgeLookupTargetInputNoSource to read; omit for the main preview branch.
callerSelectorJSONNoCaller-selected document scope. Source membership and server-trusted knowledge policy are intersected with this selector before pagination; denied nodes, edges, broken-link labels and counts are filtered.
rootFileVersionIdUUIDNoStart node by file version ID; or rootPath.
rootPathStringNoStart node by path, 1 to 1024 characters.
maxDepthIntNoLink hops from the root, 0 to 3; omit the root to read the whole visible set. Responses over 512 KiB fail with a size limit (REST 413, MCP PAYLOAD_TOO_LARGE). Narrow the graph with root_path, max_depth, filters or pagination.limit (GraphQL rootPath, maxDepth, filters or pagination.limit).
filtersKnowledgeFiltersInputNo
paginationKnowledgeGraphPaginationInputNo

Response

Returns KnowledgeGraph!. Open the type for its fields and nested types.

FieldTypeDescription
nodes[KnowledgeGraphNode!]!Visible knowledge files as nodes. Markdown document links are edges; external and broken links are returned separately. Use the graph to find related files.
edges[KnowledgeGraphEdge!]!
externalLinks[KnowledgeGraphExternalLink!]!
brokenLinks[KnowledgeGraphBrokenLink!]!
returnedNodesInt!
totalNodesInt!
partialBoolean!True when nodes or links were left out of this page.
linksTruncatedBoolean!True when the link count or byte budget left links out.

All fields of KnowledgeGraph.

Types marked with ! cannot be null. Lists use [Type] notation. The type index lists all published input and response types.

Example

graphql
query KnowledgeGraph($projectReference: ID!, $input: KnowledgeGraphInput) {
  knowledgeGraph(projectReference: $projectReference, input: $input) {
    limit
    linksTruncated
    partial
    returnedNodes
    totalNodes
    nodes {
      fileId
      fileVersionId
      path
      reserved
      tags
    }
    edges {
      ordinal
      sourceFileVersionId
      targetFileVersionId
    }
    pageInfo {
      hasNextPage
      endCursor
      hasPreviousPage
      startCursor
    }
  }
}
json
{
  "projectReference": "00000000-0000-4000-8000-000000000001"
}