List graph — GET /v1/knowledge/files/{id}/graph

Answers one of the caller's org files' place in the org's graph: the files it links to and is linked from (a hyperlink, a citation by name), the files that name the same entities, and the entities it names.

GET /v1/knowledge/files/{id}/graph

Addresshttps://api.hanzo.ai/v1/knowledge/files/{id}/graph
MethodGET
Operationget_knowledge_files_by_id_graph
AuthAuthorization: Bearer $HANZO_API_KEY

Answers one of the caller's org files' place in the org's graph: the files it links to and is linked from (a hyperlink, a citation by name), the files that name the same entities, and the entities it names. It is how an agent finds the other documents a question about this one needs.

Request

1 field.

FieldInTypeRequiredDescription
idpathstringyesID is the file's id, as POST /v1/knowledge/files answered it.

Response

StatusBodyMeaning
200knowledge.fileGraphok
defaultproblem-detailsrefused

200 body — 34 fields.

FieldInTypeAlwaysDescription
entitiesbodyknowledge.fileEntity[]—Entities are the entities it names, most mentioned first.
entities[].filesbodyinteger (int64)—Files is how many other files of the org name it too.
entities[].kindbodystring—Kind is person, org, product, place or term.
entities[].namebodystring—Name is the entity as the text names it.
entities[].sectionsbodyinteger (int64)—Sections is how many of the file's sections name it.
filebodyknowledge.File—
file.bucketbodystring—Bucket is the org bucket the object is in, by the friendly name /v1/s3/buckets lists.
file.charsbodyinteger (int64)—Chars is the length of the text read out of the file, in bytes.
file.clippedbodyboolean—Clipped is true when only the file's beginning is indexed: its text ran past the org's bound or the room the index has.
file.createdbodyinteger (int64)—Created is when the file was first registered, in unix seconds.
file.donebodyinteger (int64)—Done is how far the running stage has come, of Total: bytes of the file read (extract), sections summarized (toc), cut into passages (passages) and linked (graph), passages embedded (embed).
file.embeddedbodyinteger (int64)—Embedded is how many of those passages carry a vector — Passages once the embed stage is done, unless Note says the file is embedded in part.
file.errorbodystring—Error is why a stored or failed file was not indexed — or, on a ready file, why it is searched by its words alone — in words a person can act on.
file.idbodystring—ID names the file in its org.
file.keybodystring—Key is the object's key in that bucket.
file.namebodystring—Name is the object's file name, the last segment of its key.
file.notebodystring—Note says in words where the file is indexed less than whole and why: its text past the org's bound or the room the index has, its passages past the bound on vectors.
file.parentbodystring—Parent is the id of the archive this file was unpacked from.
file.passagesbodyinteger (int64)—Passages is how many passages its text was cut into.
file.projectbodystring—Project is the project scope it is indexed under.
file.sectionsbodyinteger (int64)—Sections is how many nodes its table of contents has, the document's own root included.
file.sizebodyinteger (int64)—Size is the object's length in bytes, as the store reports it.
file.stagebodystring—Stage is the ingest stage the file is in: extract, toc, passages or graph while indexing, embed while a ready file's vectors are written.
file.statusbodystring—Status is queued, indexing, ready, stored (kept but not indexed — Error says why) or failed.
file.totalbodyinteger (int64)—Total is what the running stage has to do in all, in Done's units.
file.typebodystring—Type is the object's media type as the store holds it, or the one its name implies when the store holds only the generic default.
file.updatedbodyinteger (int64)—Updated is when its record last changed, in unix seconds.
linksbodyknowledge.fileLink[]—Links are the other files it is joined to, strongest first.
links[].directionbodystring—Direction is out when this file links to the other, in when the other links to this one, and shared when the two name the same entities.
links[].filebodystring—File is the other file, by id.
links[].kindbodystring—Kind is href (a hyperlink), cites (the text names the file), xref (a cross-reference inside one document) or entity (shared mentions).
links[].labelbodystring—Label is the link's own text, or the entities the two files share.
links[].namebodystring—Name is the other file's name.
links[].weightbodyinteger (int64)—Weight is how many edges of this kind join the two; for shared entities, how many entities they share.

Failure carries the platform error shape — see Errors.

Examples

hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.

import { Configuration, KnowledgeApi } from 'hanzoai';

const api = new KnowledgeApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getKnowledgeFilesByIdGraph({ id: 'id' });
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_files_by_id_graph(id='id')
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.KnowledgeAPI.GetKnowledgeFilesByIdGraph(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_files_by_id_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).getKnowledgeFilesByIdGraph();
curl https://api.hanzo.ai/v1/knowledge/files/<id>/graph \
  -H "Authorization: Bearer $HANZO_API_KEY"

MCP reaches knowledge through the knowledge tool, which names its 9 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:

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

Knowledge API · All Hanzo APIs · Interactive reference

Was this page useful?