relations = client.context.relations(
database="acme_corp",
id="billing_runbook_v3",
limit=500,
)
const relations = await client.context.relations({
database: "acme_corp",
id: "billing_runbook_v3",
limit: 500,
});
curl -G 'https://api.hydradb.com/context/relations' \
-H "Authorization: Bearer <your_api_key>" \
-H "API-Version: 2" \
--data-urlencode "database=acme_corp" \
--data-urlencode "id=billing_runbook_v3" \
--data-urlencode "limit=500"
{
"success": true,
"data": {
"relations": [
{
"source": {
"name": "PaymentsWorker",
"type": "Service",
"namespace": "default",
"entity_id": "entity_payments_worker",
"identifier": null,
"provider": ""
},
"target": {
"name": "OrdersDB",
"type": "Database",
"namespace": "default",
"entity_id": "entity_orders_db",
"identifier": null,
"provider": ""
},
"relations": [
{
"canonical_predicate": "DEPENDS_ON",
"raw_predicate": "depends on",
"context": "PaymentsWorker fetches transactions from OrdersDB during sync.",
"confidence": 0.93,
"temporal_details": "2026-02",
"timestamp": "2026-05-12T08:14:00Z",
"relationship_id": "rel_payments_orders",
"chunk_id": "billing_runbook_v3_chunk_3",
"source_entity_id": "entity_payments_worker",
"target_entity_id": "entity_orders_db"
}
],
"chunk_id": "billing_runbook_v3_chunk_3"
}
],
"auxiliary_relations": [],
"auxiliary_truncated": false,
"is_truncated": false,
"next_cursor": null,
"success": true,
"message": "Successfully fetched relations for source"
},
"error": null,
"meta": {
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"latency_ms": 12.3
}
}
{
"success": true,
"data": {
"relations": [
{
"source": {
"name": "PaymentsWorker",
"type": "Service",
"namespace": "default",
"entity_id": "entity_payments_worker",
"identifier": null,
"provider": ""
},
"target": {
"name": "OrdersDB",
"type": "Database",
"namespace": "default",
"entity_id": "entity_orders_db",
"identifier": null,
"provider": ""
},
"relations": [
{
"canonical_predicate": "DEPENDS_ON",
"raw_predicate": "depends on",
"context": "PaymentsWorker depends on OrdersDB for transaction sync.",
"confidence": 0.88,
"temporal_details": null,
"timestamp": "2026-05-12T08:14:00Z",
"relationship_id": "rel_payments_orders",
"chunk_id": "billing_runbook_v3_chunk_4",
"source_entity_id": "entity_payments_worker",
"target_entity_id": "entity_orders_db"
}
],
"chunk_id": "billing_runbook_v3_chunk_4"
}
],
"auxiliary_relations": [],
"auxiliary_truncated": false,
"is_truncated": true,
"next_cursor": 1778573640.0,
"success": true,
"message": "Successfully fetched relations for source"
},
"error": null,
"meta": {
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"latency_ms": 12.3
}
}
{
"success": false,
"data": null,
"error": {
"code": "DATABASE_NOT_FOUND",
"message": "Database 'acme_corp' not found. Use GET /databases to list active databases."
},
"meta": {
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"latency_ms": 4.8
}
}
Context
Inspecting Context Relations
Read the entity-relation triplets extracted from your content, for one source or a whole collection.
GET
/
context
/
relations
relations = client.context.relations(
database="acme_corp",
id="billing_runbook_v3",
limit=500,
)
const relations = await client.context.relations({
database: "acme_corp",
id: "billing_runbook_v3",
limit: 500,
});
curl -G 'https://api.hydradb.com/context/relations' \
-H "Authorization: Bearer <your_api_key>" \
-H "API-Version: 2" \
--data-urlencode "database=acme_corp" \
--data-urlencode "id=billing_runbook_v3" \
--data-urlencode "limit=500"
{
"success": true,
"data": {
"relations": [
{
"source": {
"name": "PaymentsWorker",
"type": "Service",
"namespace": "default",
"entity_id": "entity_payments_worker",
"identifier": null,
"provider": ""
},
"target": {
"name": "OrdersDB",
"type": "Database",
"namespace": "default",
"entity_id": "entity_orders_db",
"identifier": null,
"provider": ""
},
"relations": [
{
"canonical_predicate": "DEPENDS_ON",
"raw_predicate": "depends on",
"context": "PaymentsWorker fetches transactions from OrdersDB during sync.",
"confidence": 0.93,
"temporal_details": "2026-02",
"timestamp": "2026-05-12T08:14:00Z",
"relationship_id": "rel_payments_orders",
"chunk_id": "billing_runbook_v3_chunk_3",
"source_entity_id": "entity_payments_worker",
"target_entity_id": "entity_orders_db"
}
],
"chunk_id": "billing_runbook_v3_chunk_3"
}
],
"auxiliary_relations": [],
"auxiliary_truncated": false,
"is_truncated": false,
"next_cursor": null,
"success": true,
"message": "Successfully fetched relations for source"
},
"error": null,
"meta": {
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"latency_ms": 12.3
}
}
{
"success": true,
"data": {
"relations": [
{
"source": {
"name": "PaymentsWorker",
"type": "Service",
"namespace": "default",
"entity_id": "entity_payments_worker",
"identifier": null,
"provider": ""
},
"target": {
"name": "OrdersDB",
"type": "Database",
"namespace": "default",
"entity_id": "entity_orders_db",
"identifier": null,
"provider": ""
},
"relations": [
{
"canonical_predicate": "DEPENDS_ON",
"raw_predicate": "depends on",
"context": "PaymentsWorker depends on OrdersDB for transaction sync.",
"confidence": 0.88,
"temporal_details": null,
"timestamp": "2026-05-12T08:14:00Z",
"relationship_id": "rel_payments_orders",
"chunk_id": "billing_runbook_v3_chunk_4",
"source_entity_id": "entity_payments_worker",
"target_entity_id": "entity_orders_db"
}
],
"chunk_id": "billing_runbook_v3_chunk_4"
}
],
"auxiliary_relations": [],
"auxiliary_truncated": false,
"is_truncated": true,
"next_cursor": 1778573640.0,
"success": true,
"message": "Successfully fetched relations for source"
},
"error": null,
"meta": {
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"latency_ms": 12.3
}
}
{
"success": false,
"data": null,
"error": {
"code": "DATABASE_NOT_FOUND",
"message": "Database 'acme_corp' not found. Use GET /databases to list active databases."
},
"meta": {
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"latency_ms": 4.8
}
}
Inspect the relationships HydraDB extracted from your content, such as
PaymentsWorker depends on OrdersDB. Each relationship is a triplet: a starting entity (a named person, service, or topic), a relationship, and a target entity.
Pass id to scope to a single source, or omit it to return all relations in the collection. Set type=memory when id belongs to a memory.
relations = client.context.relations(
database="acme_corp",
id="billing_runbook_v3",
limit=500,
)
const relations = await client.context.relations({
database: "acme_corp",
id: "billing_runbook_v3",
limit: 500,
});
curl -G 'https://api.hydradb.com/context/relations' \
-H "Authorization: Bearer <your_api_key>" \
-H "API-Version: 2" \
--data-urlencode "database=acme_corp" \
--data-urlencode "id=billing_runbook_v3" \
--data-urlencode "limit=500"
{
"success": true,
"data": {
"relations": [
{
"source": {
"name": "PaymentsWorker",
"type": "Service",
"namespace": "default",
"entity_id": "entity_payments_worker",
"identifier": null,
"provider": ""
},
"target": {
"name": "OrdersDB",
"type": "Database",
"namespace": "default",
"entity_id": "entity_orders_db",
"identifier": null,
"provider": ""
},
"relations": [
{
"canonical_predicate": "DEPENDS_ON",
"raw_predicate": "depends on",
"context": "PaymentsWorker fetches transactions from OrdersDB during sync.",
"confidence": 0.93,
"temporal_details": "2026-02",
"timestamp": "2026-05-12T08:14:00Z",
"relationship_id": "rel_payments_orders",
"chunk_id": "billing_runbook_v3_chunk_3",
"source_entity_id": "entity_payments_worker",
"target_entity_id": "entity_orders_db"
}
],
"chunk_id": "billing_runbook_v3_chunk_3"
}
],
"auxiliary_relations": [],
"auxiliary_truncated": false,
"is_truncated": false,
"next_cursor": null,
"success": true,
"message": "Successfully fetched relations for source"
},
"error": null,
"meta": {
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"latency_ms": 12.3
}
}
{
"success": true,
"data": {
"relations": [
{
"source": {
"name": "PaymentsWorker",
"type": "Service",
"namespace": "default",
"entity_id": "entity_payments_worker",
"identifier": null,
"provider": ""
},
"target": {
"name": "OrdersDB",
"type": "Database",
"namespace": "default",
"entity_id": "entity_orders_db",
"identifier": null,
"provider": ""
},
"relations": [
{
"canonical_predicate": "DEPENDS_ON",
"raw_predicate": "depends on",
"context": "PaymentsWorker depends on OrdersDB for transaction sync.",
"confidence": 0.88,
"temporal_details": null,
"timestamp": "2026-05-12T08:14:00Z",
"relationship_id": "rel_payments_orders",
"chunk_id": "billing_runbook_v3_chunk_4",
"source_entity_id": "entity_payments_worker",
"target_entity_id": "entity_orders_db"
}
],
"chunk_id": "billing_runbook_v3_chunk_4"
}
],
"auxiliary_relations": [],
"auxiliary_truncated": false,
"is_truncated": true,
"next_cursor": 1778573640.0,
"success": true,
"message": "Successfully fetched relations for source"
},
"error": null,
"meta": {
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"latency_ms": 12.3
}
}
{
"success": false,
"data": null,
"error": {
"code": "DATABASE_NOT_FOUND",
"message": "Database 'acme_corp' not found. Use GET /databases to list active databases."
},
"meta": {
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"latency_ms": 4.8
}
}
Pagination pattern
Pass each response’snext_cursor back as cursor until it is null. If next_cursor is null while is_truncated is true, the export is incomplete: retry the page or increase limit.
all_relations = []
cursor = None
while True:
page = client.context.relations(
database="acme_corp",
id="billing_runbook_v3",
limit=1000,
cursor=cursor,
)
all_relations.extend(page.data.relations)
if page.data.next_cursor is None:
if page.data.is_truncated:
raise RuntimeError(
"Relations export is incomplete. Retry this page or increase limit."
)
break
cursor = page.data.next_cursor
Behavior notes
- Cursor opacity:
next_cursoris opaque (currently the timestamp, in Unix seconds, of the last group returned). Do not construct it client-side or assume meaning: pass back exactly what the server returned. - Full-graph exports: Omit
id, use a smalllimit, and paginate.limitcounts relation groups, from1to10000(default5000). - Ordering:
data.relations[]comes back newest first, by each group’s latest relationtimestamp, not by relevance. - Unknown
id: Returns200with an emptyrelationslist, not an error. So does anidtheaclprincipals may not see. auxiliary_relations: The structural graph around the sources (who sent a message, which comments hang off it), in the same triplet shape. It does not count againstlimit;auxiliary_truncatedistruewhen it was clipped.- Graph completeness: A source’s relations are fully populated only once its
indexing_statusreachescompleted. Sources ingraph_creationare searchable, but their relations may still be in flight. timestampformat differs by endpoint: On this endpoint each relation’stimestampis an ISO-8601 string (for example2026-05-12T08:14:00Z). The same relations surfaced as passthrough on Query (ingraph_context) and List Context carrytimestampas a Unix epoch float (seconds) instead. Normalize before comparing relation timestamps across endpoints.- Access control:
acllists the principals to answer as. Only relations from sources those principals may see are returned. Repeat or comma-separate values, or omitaclfor no caller-supplied ACL filtering. For enforced connectors, the authenticated caller is used instead; see ACL enforcement.
Errors
Common codes:400 INVALID_INPUT (missing database, a limit outside 1 to 10000, or a non-numeric cursor), 404 DATABASE_NOT_FOUND, 500 INTERNAL_ERROR (a transient graph read failure; retry the request). See Error Responses for the full list.
Related resources
- Before this: Ingestion Status: confirm the graph is complete
- Related: Connected Subgraph: threads, parents, children, and declared links around one source
- Related: Query: return relations with results using
graph_context: true - Guide: Query
Authorizations
Query Parameters
Response
OK
Show child attributes
Show child attributes
Example:
{
"auxiliary_relations": [
{
"chunk_id": "HydraEmbeddings123_0",
"collection": "team_docs",
"database": "acme_corp",
"relations": [
{
"canonical_predicate": "works_at",
"chunk_id": "HydraEmbeddings123_0",
"collection": "team_docs",
"confidence": 0.92,
"context": "Ada joined Acme Corp in 2024 as a staff engineer.",
"database": "acme_corp",
"raw_predicate": "is employed by",
"relationship_id": "rel_1234",
"source_entity_id": "entity_1a2b",
"source_id": "HydraDoc1234",
"synthesized": true,
"target_entity_id": "entity_3c4d",
"temporal_details": "since 2024",
"timestamp": "2026-07-02T10:00:00Z"
}
],
"source": {
"collection": "team_docs",
"database": "acme_corp",
"entity_id": "entity_1a2b",
"identifier": "Acme Corp",
"name": "general",
"namespace": "organization",
"provider": "slack",
"type": "knowledge"
},
"target": {
"collection": "team_docs",
"database": "acme_corp",
"entity_id": "entity_1a2b",
"identifier": "Acme Corp",
"name": "general",
"namespace": "organization",
"provider": "slack",
"type": "knowledge"
},
"truncated": true
}
],
"auxiliary_truncated": true,
"is_truncated": false,
"message": "Success",
"next_cursor": null,
"relations": [
{
"chunk_id": "HydraEmbeddings123_0",
"collection": "team_docs",
"database": "acme_corp",
"relations": [
{
"canonical_predicate": "works_at",
"chunk_id": "HydraEmbeddings123_0",
"collection": "team_docs",
"confidence": 0.92,
"context": "Ada joined Acme Corp in 2024 as a staff engineer.",
"database": "acme_corp",
"raw_predicate": "is employed by",
"relationship_id": "rel_1234",
"source_entity_id": "entity_1a2b",
"source_id": "HydraDoc1234",
"synthesized": true,
"target_entity_id": "entity_3c4d",
"temporal_details": "since 2024",
"timestamp": "2026-07-02T10:00:00Z"
}
],
"source": {
"collection": "team_docs",
"database": "acme_corp",
"entity_id": "entity_1a2b",
"identifier": "Acme Corp",
"name": "general",
"namespace": "organization",
"provider": "slack",
"type": "knowledge"
},
"target": {
"collection": "team_docs",
"database": "acme_corp",
"entity_id": "entity_1a2b",
"identifier": "Acme Corp",
"name": "general",
"namespace": "organization",
"provider": "slack",
"type": "knowledge"
},
"truncated": true
}
],
"success": true
}
Show child attributes
Show child attributes
Example:
{
"collection": "team_docs",
"database": "acme_corp",
"latency_ms": 12.3,
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"source_type": "file",
"sub_tenant_id": "sub_tenant_4567",
"tenant_id": "tenant_1234",
"warnings": [
{
"code": "acl_ignored_by_connector_enforcement",
"collections": ["team_docs", "engineering"],
"message": "This connector enforces ACL, so the request's acl was ignored."
}
]
}
Was this page helpful?
