Skip to main content
GET
Use this endpoint when a query result needs more context, such as the replies to a Slack message. Pass an id returned by Query, List Context, or Ingest Context to retrieve the starting source, the sources connected to it, and their relationships. The endpoint follows threads, parent-child relationships, and forceful relations (links you declare between sources). For relationships extracted from text, such as service dependencies, use Inspecting Context Relations.

Reading the response

  • sources[] contains the starting source and the connected sources. Pass a source_id to Inspect Context to read its content.
  • Each source includes its distance from the starting source in depth. The starting source has depth: 0.
  • discovered_via identifies the source that led to this one. discovered_relation describes the connection, such as same_thread, parent, child, or a link declared at ingestion.
  • relations[] describes links between those sources, such as thread membership and parent-child relationships.
  • auxiliary_relations[] includes related people, comments, and attachments.
  • is_truncated and auxiliary_truncated indicate that response limits were reached. is_truncated is true when max_sources clips the traversal.

Behavior notes

  • IDs with reserved characters: URL-encode the id if it contains reserved characters. An ID containing a literal / cannot be written as one path segment; pass it as GET /context/subgraph?id=... instead. Python and TypeScript SDK 2.1.7 use this form for every ID.
  • Knowledge and memory graphs: type selects which graph the id belongs to (default "knowledge"). The two graphs are completely separate.
  • Collection: Omit collection to use the database’s default collection.
  • Limits: depth is the maximum traversal depth in hops, from 1 to 10 (default 5). max_sources caps the sources returned, from 1 to 1000 (default 200).
  • Access control: acl lists the principals to answer as. Only sources those principals may see are returned, filtered at every hop. Repeat or comma-separate values, or omit acl for 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 or id, depth outside 1 to 10, or max_sources outside 1 to 1000), 404 DATABASE_NOT_FOUND, 500 INTERNAL_ERROR (a transient graph read failure; retry the request). See Error Responses for the full list.

Authorizations

Authorization
string
header
required

Send your API key as Authorization: Bearer <your_api_key>.

Path Parameters

id
string
required

Context ID to start from. Use the query form for IDs containing a slash.

Example:

"HydraDoc1234"

Query Parameters

database
string
required

Database containing the context.

Example:

"acme_corp"

collection
string

Collection containing the context.

Example:

"team_docs"

tenant_id
string
deprecated

Deprecated: use database.

Example:

"acme_corp"

sub_tenant_id
string
deprecated

Deprecated: use collection.

Example:

"team_docs"

type
enum<string>

Split: knowledge or memory; all reads knowledge only. meta.source_type identifies the corpus. Unified: omit type or use unified; split values are ignored with type_ignored_on_unified.

Available options:
knowledge,
memory,
unified,
all
depth
integer
default:5

Max traversal depth in hops

Required range: 1 <= x <= 10
max_sources
integer
default:200

Max members returned; is_truncated reports when this clipped the traversal

Required range: 1 <= x <= 1000
acl
string[]

Principals allowed to read the returned contexts. Omit for no additional scoping.

Response

OK

data
GraphSourceSubgraphResponse · object
Example:
error
HandlerApiError · object | null

Error details on failure, or null on success.

Example:

null

meta
HandlerResponseMeta · object
Example:
success
boolean

Whether the request succeeded.

Example:

true