List graph — GET /v1/knowledge/graph

Returns the caller org's knowledge as a node/edge graph shaped for a force-directed renderer: pages, memories and synced sources as nodes; the page parent tree, the wikilinks between pages, and each source's connector provenance as edges.

GET /v1/knowledge/graph

Addresshttps://api.hanzo.ai/v1/knowledge/graph
MethodGET
Operationget_knowledge_graph
AuthAuthorization: Bearer $HANZO_API_KEY

Returns the caller org's knowledge as a node/edge graph shaped for a force-directed renderer: pages, memories and synced sources as nodes; the page parent tree, the wikilinks between pages, and each source's connector provenance as edges. Wikilink targets are resolved HERE by title or slug, so a rename never needs an edge rewrite and a link that matches no page renders as its own "unresolved" node instead of vanishing. ?project= narrows it. A store outage degrades to an honest empty graph, never a 5xx.

Request

1 field.

FieldInTypeRequiredDescription
projectquerystring—Project narrows the graph to one project scope.

Response

StatusBodyMeaning
200knowledge.graphOutok
defaultproblem-detailsrefused

200 body — 11 fields.

FieldInTypeAlwaysDescription
degradedbodyboolean—Degraded is true when the store was unreachable and this graph is honestly empty rather than wrong.
edgesbodyknowledge.graphEdge[]—Edges are the parent tree, the resolved wikilinks and the connector provenance.
edges[].frombodystring—From is the id of the node the edge starts at: the child page for a parent edge, the page holding the wikilink for a link edge, the kb.source for a provenance edge.
edges[].kindbodystring—parent | link | provenance
edges[].tobodystring—To is the id of the node the edge points at: the parent page, the linked page, the kb.connector.
nodesbodyknowledge.graphNode[]—Nodes are the pages, memories, sources, connectors and unresolved link targets.
nodes[].idbodystring—"<doctype>:<name>" — globally unique, click-to-open key
nodes[].namebodystring—the document name (empty for synthetic nodes)
nodes[].projectbodystring—Project is the project scope the underlying document was saved under.
nodes[].titlebodystring—display label
nodes[].typebodystring—kb.page | kb.memory | kb.source | kb.connector | unresolved

Failure carries the platform error shape — see Errors.

Examples

hanzo knowledge graph
import { Configuration, KnowledgeApi } from 'hanzoai';

const api = new KnowledgeApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getKnowledgeGraph();
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import KnowledgeApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = KnowledgeApi(client).get_knowledge_graph()
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.KnowledgeAPI.GetKnowledgeGraph(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, knowledge_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = knowledge_api::get_knowledge_graph(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.KnowledgeApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new KnowledgeApi(client).getKnowledgeGraph();
curl https://api.hanzo.ai/v1/knowledge/graph \
  -H "Authorization: Bearer $HANZO_API_KEY"

Tool knowledge, op get_knowledge_graph — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "knowledge",
         "arguments": {
           "op": "get_knowledge_graph",
           "input": {}
         }
       }
     }'

Knowledge API · All Hanzo APIs · Interactive reference

Was this page useful?