---
title: "Get graph relations"
method: GET
path: "/context/relations"
tags: ["context"]
---

# Get graph relations

`GET /context/relations`

Return knowledge-graph relations for a tenant or a single source.

## Query parameters

- `database` string, required
- `collection` string
- `tenant_id` string
- `sub_tenant_id` string
- `id` string
- `type` 'knowledge' | 'memory'
- `limit` integer
- `cursor` number

## Response `200`

OK

- HandlerEnvelopeGraphGraphRelationsResponse
  - `data` GraphGraphRelationsResponse
    - `is_truncated` boolean — Whether the response was truncated due to the result limit.
    - `message` string — Human-readable result message.
    - `next_cursor` number — NO omitempty
    - `relations` GraphTripletWithEvidence[] — Array of triplet groups with evidence for each relationship.
      - `chunk_id` string — Chunk that provides evidence for this relation.
      - `relations` GraphRelationEvidence[] — Evidence entries for this relationship triplet.
        - `canonical_predicate` string — Normalized predicate for the relationship (e.g. `works_at`, `depends_on`).
        - `chunk_id` string — NO omitempty
        - `confidence` number — Confidence score, from 0 to 1.
        - `context` string — Verbatim passage from the source that evidences the relationship.
        - `raw_predicate` string — As-extracted predicate before normalization.
        - `relationship_id` string — Unique identifier for this relationship instance.
        - `source_entity_id` string — NO omitempty
        - `target_entity_id` string — NO omitempty
        - `temporal_details` string — NO omitempty
        - `timestamp` string — RFC3339 timestamp associated with this item.
      - `source` GraphEntity
        - `entity_id` string — Unique identifier for this entity in the graph.
        - `identifier` string — NO omitempty — serialize as null
        - `name` string — Human-readable label for this resource.
        - `namespace` string — Namespace grouping for the entity (e.g. `organization`, `person`).
        - `provider` string — Provider is the source app the entity's evidence chunk came from (e.g. "slack", "google", "intercom"), read from the owning Source node's app_provider. Empty string when the evidence has no app source (plain document / web ingest). Consumed by the dashboard to render a connector logo inside the graph node.
        - `type` string — Entity type label (e.g. `knowledge`, `person`, `organization`).
      - `target` GraphEntity
        - `entity_id` string — Unique identifier for this entity in the graph.
        - `identifier` string — NO omitempty — serialize as null
        - `name` string — Human-readable label for this resource.
        - `namespace` string — Namespace grouping for the entity (e.g. `organization`, `person`).
        - `provider` string — Provider is the source app the entity's evidence chunk came from (e.g. "slack", "google", "intercom"), read from the owning Source node's app_provider. Empty string when the evidence has no app source (plain document / web ingest). Consumed by the dashboard to render a connector logo inside the graph node.
        - `type` string — Entity type label (e.g. `knowledge`, `person`, `organization`).
    - `success` boolean — Whether the request succeeded.
  - `error` HandlerApiError
    - `code` string — Machine-readable error code (e.g. `DATABASE_NOT_FOUND`).
    - `message` string — Human-readable description of the error.
  - `meta` HandlerResponseMeta
    - `api_version` string — APIVersion echoes the version of the API that served the request (PRO-1209), sourced from reqmeta.APIVersion — the same value carried by OpenAPI info.version and /health — so a client always knows which API version produced a response. Always present (no omitempty).
    - `collection` string — Collection scope. Defaults to the default collection when omitted. Formerly `sub_tenant_id`; the `sub_tenant_id` alias is still accepted (deprecated).
    - `database` string — Owning database. Formerly `tenant_id`; the `tenant_id` alias is still accepted (deprecated).
    - `deprecation` HandlerDeprecationNotice[] — Deprecation lists any migration nudges that apply to this request — the caller used a legacy /tenants route, a legacy tenant_id/sub_tenant_id field, or the deprecated sub_tenant_ids selector. It is a non-breaking signal (the status code is unchanged); omitempty keeps it absent for fully-migrated requests. A list so independent deprecations coexist without clobbering.
      - `deprecated` boolean — Whether this response concerns a deprecated field or route.
      - `deprecated_field` string — The deprecated field name.
      - `deprecated_since` string — API version when the field was deprecated.
      - `message` string — Migration guidance message.
      - `preferred_field` string — The canonical replacement for the deprecated field.
    - `latency_ms` number — Server-side processing time in milliseconds.
    - `request_id` string — Unique identifier for this request, useful for support and tracing.
    - `source_type` string — Type of the parent source (e.g. `file`, `slack`, `notion`).
    - `sub_tenant_id` string
    - `tenant_id` string
  - `success` boolean — Whether the request succeeded.

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.dev/hydradb/apis/hydradb-application-api.md) · [All operations](https://skmtc.dev/hydradb/apis/hydradb-application-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hydradb/hydradb-application-api/revisions/c773cb4e113a/schema)
