Skip to content

Knowledge Graph API

Get Knowledge Graph

Returns the full graph (nodes + edges) for a workspace.

http
GET /workspaces/{ws_id}/knowledge-graph
Authorization: Bearer <token>

Response

json
{
  "nodes": [
    {
      "id": "uuid",
      "label": "Machine Learning",
      "entity_type": "concept",
      "document_id": "uuid"
    }
  ],
  "edges": [
    {
      "source": "node-uuid-1",
      "target": "node-uuid-2",
      "relation": "related_to",
      "weight": 0.85
    }
  ]
}

Node Fields

FieldTypeDescription
idUUIDEntity identifier
labelstringDisplay name
entity_typestringType classification (person, organization, concept, etc.)
document_idUUID?Source document, if applicable

Edge Fields

FieldTypeDescription
sourceUUIDSource node ID
targetUUIDTarget node ID
relationstringRelationship type label
weightfloatRelationship strength (0-1)

List Entities

Returns entities for a workspace with metadata, ordered by creation date.

http
GET /workspaces/{ws_id}/knowledge-graph/entities
Authorization: Bearer <token>

Response

json
[
  {
    "id": "uuid",
    "name": "TrustRAG",
    "entity_type": "technology",
    "document_id": "uuid",
    "metadata": { "aliases": ["TRAG"] },
    "created_at": "2026-05-22T06:00:00Z"
  }
]

Entity Fields

FieldTypeDescription
idUUIDEntity identifier
namestringEntity name
entity_typestringClassification type
document_idUUID?Source document
metadataobjectAdditional structured data
created_atstringCreation timestamp

Access Control

Both endpoints require workspace access. Users can access graphs for:

  • Workspaces they own
  • Workspaces they are members of
  • Public workspaces

Released under the Apache 2.0 License.