> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hydradb.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connected Subgraph

> Everything connected to one item: its thread, its replies, its parents and children, and the items it links to.

export const Field = ({name, type, required, recommended}) => {
  const label = required ? 'required' : recommended ? 'recommended' : null;
  const typeLabel = typeof type === 'string' ? type : null;
  const ariaParts = [name, typeLabel && `${typeLabel}`, label].filter(Boolean);
  return <span aria-label={ariaParts.join(', ')} className={label ? 'field-wrap has-field-tip' : 'field-wrap'} style={{
    position: 'relative',
    cursor: label ? 'default' : undefined
  }} tabIndex={label ? 0 : undefined}>
      <span className="field-name-row">
        <code>{name}</code>
        {required && <span className="field-req"> *</span>}
        {recommended && <span className="field-rec"> ●</span>}
      </span>
      {type && <span className="field-type">{type}</span>}
      {label && <span className="field-tip" role="tooltip">
          {label}
        </span>}
    </span>;
};

This endpoint returns the **connected subgraph** of one ingested item: every item reachable from it through item-level relations, traversed breadth-first up to `depth` hops, together with the relations among those members and the structural graph around them (entities, comments, attachments, people).

It answers a different question from [Inspecting Context Relations](/api-reference/v2/endpoint/source-relations). Relations are the entity-and-predicate triplets *extracted from text* (`PaymentsWorker → depends_on → OrdersDB`). The subgraph is about *items*: which Slack message replies to which, which page links to which, which ticket a comment belongs to. Use it after [Query](/api-reference/v2/endpoint/query) or [List Documents](/api-reference/v2/endpoint/list-documents) when a single result is not enough and you need what surrounds it.

<RequestExample>
  ```bash cURL theme={"dark"}
  curl -G 'https://api.hydradb.com/context/slack_C0BE77_1788320073/subgraph' \
    -H "Authorization: Bearer <your_api_key>" \
    -H "API-Version: 2" \
    --data-urlencode "database=acme_corp" \
    --data-urlencode "collection=eng_slack" \
    --data-urlencode "depth=3"
  ```

  ```bash HydraDB CLI theme={"dark"}
  hydradb subgraph slack_C0BE77_1788320073 --database acme_corp --collection eng_slack --depth 3
  hydradb --output json subgraph slack_C0BE77_1788320073 | jq '.sources[].source_id'
  ```

  ```json MCP tool theme={"dark"}
  { "name": "hydradb_subgraph", "arguments": { "id": "slack_C0BE77_1788320073", "depth": 3 } }
  ```
</RequestExample>

<Info>
  The Python and TypeScript SDKs gain `context.subgraph()` with their next release, generated from this spec. Until then call the endpoint directly as above; the CLI and the MCP server already do.
</Info>

## Path parameters

| Name                                       | Description                                                                                                                                                                                                                                                 |
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <Field name="id" type="string" required /> | The item to start from. Any `id` returned by Query, List Documents or Ingest. URL-encode it if it contains reserved characters. An id containing a literal `/` cannot be written as one path segment; pass those as `GET /context/subgraph?id=...` instead. |

## Query parameters

| Name                                                                     | Description                                                                                                                                                                                           |
| ------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <Field name="database" type="string" required />                         | Owning database. Formerly `tenant_id`; the `tenant_id` alias is still accepted (deprecated).                                                                                                          |
| <Field name="collection" type="string or null" />                        | Collection scope. If omitted, the default collection is used. Formerly `sub_tenant_id`; the `sub_tenant_id` alias is still accepted (deprecated). (default=`null`)                                    |
| <Field name="type" type="&#x22;knowledge&#x22; or &#x22;memory&#x22;" /> | Which graph the `id` belongs to. The two graphs are completely separate. (default=`"knowledge"`)                                                                                                      |
| <Field name="depth" type="integer" />                                    | Maximum traversal depth in hops. Range `1–10`. (default=`5`)                                                                                                                                          |
| <Field name="max_sources" type="integer" />                              | Maximum number of members returned. Range `1–1000`. When this clips the traversal, `is_truncated` is `true`. (default=`200`)                                                                          |
| <Field name="acl" type="string[]" />                                     | Principals to answer as (document ACLs). The subgraph then contains only items those principals may see, filtered at every hop. Repeated (`acl=a&acl=b`) or comma-separated. Omit for no ACL scoping. |

## How items connect

Every member except the start item records how the traversal found it:

* **`discovered_relation`** names the mechanism. It is `same_thread` when the member shares a thread with an item already in the subgraph (Slack replies, ticket comments); `parent` or `child` for a hierarchy tie (a comment and the message it is under, a page and its section); or the relation type of an explicit `relates_to` link declared at ingest (`reply_to`, `references`, whatever the ingest named it).
* **`discovered_via`** is the `source_id` of the already-admitted member this one was first reached *from*. Follow it back and you rebuild the traversal tree: which reply hangs off which message, which page led to which.

Traversal is breadth-first, so `depth` on each member is its distance from the start item. The start item itself is a member at depth `0`, with neither field set.

<ResponseExample>
  ```json Success theme={"dark"}
  {
    "success": true,
    "data": {
      "seed_source_id": "slack_C0BE77_1788320073",
      "sources": [
        {
          "source_id": "slack_C0BE77_1788320073",
          "title": "Slack message",
          "app_kind": "message",
          "app_provider": "slack",
          "app_external_id": "C0BE77TPEU8:1788320073.073799",
          "thread_id": "C0BE77TPEU8:1788235712.185879",
          "depth": 0,
          "hydration": "resolved"
        },
        {
          "source_id": "slack_C0BE77_1788235712",
          "title": "Slack message",
          "app_kind": "message",
          "app_provider": "slack",
          "app_external_id": "C0BE77TPEU8:1788235712.185879",
          "thread_id": "C0BE77TPEU8:1788235712.185879",
          "depth": 1,
          "hydration": "resolved",
          "discovered_via": "slack_C0BE77_1788320073",
          "discovered_relation": "same_thread"
        }
      ],
      "relations": [
        {
          "source": { "name": "C0BE77TPEU8:1788320073.073799", "type": "SOURCE", "namespace": "sources", "entity_id": "slack_C0BE77_1788320073", "identifier": null },
          "target": { "name": "C0BE77TPEU8:1788235712.185879", "type": "SOURCE", "namespace": "sources", "entity_id": "slack_C0BE77_1788235712", "identifier": null },
          "relations": [
            { "canonical_predicate": "same_thread", "raw_predicate": "same_thread", "context": "", "confidence": 1, "temporal_details": null, "timestamp": "2026-09-02T03:34:33Z", "relationship_id": "rel_same_thread_1", "chunk_id": null, "source_entity_id": null, "target_entity_id": null }
          ],
          "chunk_id": ""
        }
      ],
      "auxiliary_relations": [
        {
          "source": { "name": "saivenu", "type": "ACTOR", "namespace": "actors", "entity_id": "actor_saivenu", "identifier": "saivenu" },
          "target": { "name": "C0BE77TPEU8:1788320073.073799", "type": "SOURCE", "namespace": "sources", "entity_id": "slack_C0BE77_1788320073", "identifier": null },
          "relations": [
            { "canonical_predicate": "sender", "raw_predicate": "SENDER", "context": "", "confidence": 1, "temporal_details": null, "timestamp": "2026-09-02T03:34:33Z", "relationship_id": "rel_sender_1", "chunk_id": null, "source_entity_id": null, "target_entity_id": null }
          ],
          "chunk_id": ""
        }
      ],
      "auxiliary_truncated": false,
      "is_truncated": false,
      "max_depth_reached": 1,
      "success": true,
      "message": "Subgraph fetched successfully"
    },
    "error": null,
    "meta": {
      "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
      "latency_ms": 41.7
    }
  }
  ```

  ```json Unknown id theme={"dark"}
  {
    "success": true,
    "data": {
      "seed_source_id": "no_such_item",
      "sources": [],
      "relations": [],
      "auxiliary_relations": [],
      "auxiliary_truncated": false,
      "is_truncated": false,
      "max_depth_reached": 0,
      "success": true,
      "message": "Subgraph fetched successfully"
    },
    "error": null,
    "meta": {
      "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
      "latency_ms": 6.1
    }
  }
  ```

  ```json Failure theme={"dark"}
  {
    "success": false,
    "data": null,
    "error": {
      "code": "INVALID_INPUT",
      "message": "depth must be a positive integer not exceeding 10"
    },
    "meta": {
      "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
      "latency_ms": 0.4
    }
  }
  ```
</ResponseExample>

## Reading the response

* **`sources[]`** are the members, the start item included at `depth: 0`. Every `source_id` is an id you can pass to [Fetch Content](/api-reference/v2/endpoint/fetch-content) for the full document, or back to this endpoint to re-centre the subgraph on it. `discovered_via` on each member is another member's `source_id`, so the list is also a tree.
* **`relations[]`** are the item-level relations *among the members* (`relates_to`, `same_thread`, `parent_of`), in the same triplet shape as [Inspecting Context Relations](/api-reference/v2/endpoint/source-relations). Their endpoints are `SOURCE` entities whose `entity_id` is the item's id.
* **`auxiliary_relations[]`** is the structural graph around the members: which person sent a message, which entities are mentioned in it, which comments and attachments hang off it. These are recorded from the item itself, not extracted from text, so their `context` is empty.
* **Not included:** the chunk-level entity relations that Query returns as `graph_context`. Those are a different read.

## Some additional notes

<Info>
  **An unknown `id` is an empty subgraph, not an error.** The endpoint does not confirm or deny that an item exists; the same answer comes back for an id that was never ingested and for one the `acl` principals may not see.
</Info>

* **An item nothing links to** comes back as a one-member subgraph: itself, at depth `0`, with `max_depth_reached: 0`. That is a real answer ("this stands alone"), distinct from an unknown id, which has no members.
* **Bounding the traversal.** Threads and hierarchies can be large. `depth` bounds how far the walk goes; `max_sources` bounds how many members it returns. When `max_sources` clips it, `is_truncated` is `true` and the members you have are the ones closest to the start item. `auxiliary_truncated` reports the same for the structural graph.
* **Knowledge vs memory.** If the `id` belongs to a memory, set `type=memory`; the two graphs never connect to each other.
* **Completeness.** An item's links populate once its `indexing_status` reaches `completed`. Items still in `graph_creation` may appear with fewer connections than they will have.
* **Cost.** One request fans out into a bounded series of graph reads, so it is rate-limited like a Query, not like a status poll.

<div className="api-before-related-resources" />

<Tip>
  **Related Resources**

  * **Entity relations:** [Inspecting Context Relations](/api-reference/v2/endpoint/source-relations) - the triplets extracted from text
  * **Full content of a member:** [Fetch Content](/api-reference/v2/endpoint/fetch-content)
  * **Query with graph context:** [Query](/api-reference/v2/endpoint/query) with `graph_context: true`
  * **Concepts:** [Concepts → Context Graphs](/essentials/v2/context-graphs)
</Tip>


## OpenAPI

````yaml api-reference/v2/openapi.json GET /context/{id}/subgraph
openapi: 3.1.0
info:
  contact:
    email: support@hydradb.com
    name: HydraDB Support
  description: >-
    HydraDB Application API — knowledge ingestion, search, and memory
    management.
  license:
    name: Proprietary
  title: HydraDB Application API
  version: 0.1.0
servers:
  - description: Production server
    url: https://api.hydradb.com
security: []
externalDocs:
  description: ''
  url: ''
paths:
  /context/{id}/subgraph:
    get:
      tags:
        - context
      summary: Get connected subgraph
      description: >-
        Return the connected subgraph of one ingested item: every item reachable
        from it through item-level relations (explicit `relates_to` links, a
        shared thread, parent/child hierarchy, traversed breadth-first up to
        `depth` hops), the relations among those members, and the structural
        graph around them (entities, comments, attachments, actors). Chunk-level
        entity relations are not included; use Inspecting Context Relations for
        those. An unknown id returns an empty subgraph, not an error.
      parameters:
        - description: >-
            Item ID: the ingested item whose connected subgraph to return.
            URL-encode it. An id containing a literal '/' cannot be spelled as
            one path segment; address those with the query form, GET
            /context/subgraph?id=.
          in: path
          name: id
          required: true
          schema:
            example: HydraDoc1234
            type: string
        - description: Database (canonical name for the tenant scope)
          in: query
          name: database
          required: true
          schema:
            example: acme_corp
            type: string
        - description: Collection (canonical name for the sub-tenant scope)
          in: query
          name: collection
          schema:
            example: team_docs
            type: string
        - description: Deprecated alias for database
          in: query
          name: tenant_id
          schema:
            deprecated: true
            example: tenant_1234
            type: string
            x-deprecated: 'true'
        - description: Deprecated alias for collection
          in: query
          name: sub_tenant_id
          schema:
            deprecated: true
            example: sub_tenant_4567
            type: string
            x-deprecated: 'true'
        - description: 'Corpus type: ''knowledge'' or ''memory'''
          in: query
          name: type
          schema:
            default: knowledge
            enum:
              - knowledge
              - memory
            type: string
        - description: Max traversal depth in hops
          in: query
          name: depth
          schema:
            default: 5
            maximum: 10
            minimum: 1
            type: integer
        - description: >-
            Max members returned; `is_truncated` reports when this clipped the
            traversal
          in: query
          name: max_sources
          schema:
            default: 200
            maximum: 1000
            minimum: 1
            type: integer
        - description: >-
            Principals to answer as (document ACLs): the subgraph contains only
            items they may see, filtered at every hop. Repeated (acl=a&acl=b) or
            comma-separated. Omit for no ACL scoping.
          in: query
          name: acl
          schema:
            items:
              type: string
            type: array
          style: form
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/handler.Envelope-graph_SourceSubgraphResponse
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.ErrorResponse'
          description: Bad Request
      security:
        - BearerAuth: []
components:
  schemas:
    handler.Envelope-graph_SourceSubgraphResponse:
      properties:
        data:
          $ref: '#/components/schemas/graph.SourceSubgraphResponse'
          example:
            auxiliary_relations:
              - chunk_id: HydraEmbeddings123_0
                relations:
                  - canonical_predicate: works_at
                    chunk_id: HydraEmbeddings123_0
                    confidence: 0.92
                    context: Ada joined Acme Corp in 2024 as a staff engineer.
                    raw_predicate: is employed by
                    relationship_id: rel_1234
                    source_entity_id: entity_1a2b
                    synthesized: true
                    target_entity_id: entity_3c4d
                    temporal_details: since 2024
                    timestamp: '2026-07-02T10:00:00Z'
                source:
                  entity_id: entity_1a2b
                  identifier: Acme Corp
                  name: general
                  namespace: organization
                  provider: slack
                  type: knowledge
                target:
                  entity_id: entity_1a2b
                  identifier: Acme Corp
                  name: general
                  namespace: organization
                  provider: slack
                  type: knowledge
                truncated: true
            auxiliary_truncated: true
            is_truncated: false
            max_depth_reached: 1
            message: Success
            relations:
              - chunk_id: HydraEmbeddings123_0
                relations:
                  - canonical_predicate: works_at
                    chunk_id: HydraEmbeddings123_0
                    confidence: 0.92
                    context: Ada joined Acme Corp in 2024 as a staff engineer.
                    raw_predicate: is employed by
                    relationship_id: rel_1234
                    source_entity_id: entity_1a2b
                    synthesized: true
                    target_entity_id: entity_3c4d
                    temporal_details: since 2024
                    timestamp: '2026-07-02T10:00:00Z'
                source:
                  entity_id: entity_1a2b
                  identifier: Acme Corp
                  name: general
                  namespace: organization
                  provider: slack
                  type: knowledge
                target:
                  entity_id: entity_1a2b
                  identifier: Acme Corp
                  name: general
                  namespace: organization
                  provider: slack
                  type: knowledge
                truncated: true
            sources:
              - app_external_id: C0123456789
                app_kind: slack
                app_provider: slack
                depth: 1
                source_id: HydraDoc1234
                title: Project Phoenix Overview
            success: true
        error:
          $ref: '#/components/schemas/handler.apiError'
          description: Error message, empty string on success.
          example:
            code: DATABASE_NOT_FOUND
            message: Database not found
        meta:
          $ref: '#/components/schemas/handler.responseMeta'
          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
        success:
          description: Whether the request succeeded.
          example: true
          type: boolean
      type: object
    handler.ErrorResponse:
      properties:
        data: {}
        detail:
          $ref: '#/components/schemas/handler.ErrorDetail'
          description: Structured error detail with code, message, and deprecation hints.
          example:
            deprecated: true
            deprecated_field: tenant_id
            error_code: VALIDATION_ERROR
            message: Request validation failed
            preferred_field: database
        error:
          $ref: '#/components/schemas/handler.apiError'
          description: Error message, empty string on success.
          example:
            code: DATABASE_NOT_FOUND
            message: Database not found
        meta:
          $ref: '#/components/schemas/handler.ErrorMeta'
          example:
            latency_ms: 12.3
            request_id: 9d13aef4-02f4-4e73-8c62-4c2601d04f9d
        success:
          description: Whether the request succeeded.
          example: true
          type: boolean
      type: object
    graph.SourceSubgraphResponse:
      properties:
        auxiliary_relations:
          description: |-
            AuxiliaryRelations carries the structural graph around the member
            sources: Entity->Source presence, Source->Comment/Attachment and
            Actor->Source/Comment links. Same item shape as Relations, matching
            GraphRelationsResponse so the dashboard renderer works unchanged.
          example:
            - chunk_id: HydraEmbeddings123_0
              relations:
                - canonical_predicate: works_at
                  chunk_id: HydraEmbeddings123_0
                  confidence: 0.92
                  context: Ada joined Acme Corp in 2024 as a staff engineer.
                  raw_predicate: is employed by
                  relationship_id: rel_1234
                  source_entity_id: entity_1a2b
                  synthesized: true
                  target_entity_id: entity_3c4d
                  temporal_details: since 2024
                  timestamp: '2026-07-02T10:00:00Z'
              source:
                entity_id: entity_1a2b
                identifier: Acme Corp
                name: general
                namespace: organization
                provider: slack
                type: knowledge
              target:
                entity_id: entity_1a2b
                identifier: Acme Corp
                name: general
                namespace: organization
                provider: slack
                type: knowledge
              truncated: true
          items:
            $ref: '#/components/schemas/graph.TripletWithEvidence'
          type: array
          uniqueItems: false
        auxiliary_truncated:
          description: >-
            AuxiliaryTruncated reports that a fetch ceiling clipped the
            auxiliary

            graph, same contract as GraphRelationsResponse.AuxiliaryTruncated.
          example: true
          type: boolean
        is_truncated:
          description: >-
            IsTruncated reports that the traversal stopped before exhausting the

            connected component: the source budget or an edge/expansion fetch
            cap

            was hit, or the depth limit left an unexpanded frontier.
          example: false
          type: boolean
        max_depth_reached:
          description: MaxDepthReached is the deepest BFS level that admitted a member.
          example: 1
          type: integer
        message:
          description: Human-readable result message.
          example: Success
          type: string
        relations:
          description: >-
            Relations holds the Source->Source triplets: every RELATES_TO edge
            whose

            endpoints are both members, plus synthesized same_thread / child_of

            provenance edges for members reached through a node property rather
            than

            a stored edge (those carry Synthesized on their evidence).
          example:
            - chunk_id: HydraEmbeddings123_0
              relations:
                - canonical_predicate: works_at
                  chunk_id: HydraEmbeddings123_0
                  confidence: 0.92
                  context: Ada joined Acme Corp in 2024 as a staff engineer.
                  raw_predicate: is employed by
                  relationship_id: rel_1234
                  source_entity_id: entity_1a2b
                  synthesized: true
                  target_entity_id: entity_3c4d
                  temporal_details: since 2024
                  timestamp: '2026-07-02T10:00:00Z'
              source:
                entity_id: entity_1a2b
                identifier: Acme Corp
                name: general
                namespace: organization
                provider: slack
                type: knowledge
              target:
                entity_id: entity_1a2b
                identifier: Acme Corp
                name: general
                namespace: organization
                provider: slack
                type: knowledge
              truncated: true
          items:
            $ref: '#/components/schemas/graph.TripletWithEvidence'
          type: array
          uniqueItems: false
        seed_source_id:
          type: string
        sources:
          description: |-
            Sources is every member of the subgraph in BFS discovery order, seed
            first.
          example:
            - app_external_id: C0123456789
              app_kind: slack
              app_provider: slack
              depth: 1
              source_id: HydraDoc1234
              title: Project Phoenix Overview
          items:
            $ref: '#/components/schemas/graph.SubgraphSource'
          type: array
          uniqueItems: false
        success:
          description: Whether the request succeeded.
          example: true
          type: boolean
      type: object
    handler.apiError:
      properties:
        code:
          description: Machine-readable error code (e.g. `DATABASE_NOT_FOUND`).
          example: DATABASE_NOT_FOUND
          type: string
        message:
          description: Human-readable description of the error.
          example: Database not found
          type: string
      type: object
    handler.responseMeta:
      properties:
        api_version:
          description: >-
            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).
          type: string
        collection:
          description: >-
            Collection scope. Defaults to the default collection when omitted.
            Formerly `sub_tenant_id`; the `sub_tenant_id` alias is still
            accepted (deprecated).
          example: team_docs
          type: string
        database:
          description: >-
            Owning database. Formerly `tenant_id`; the `tenant_id` alias is
            still accepted (deprecated).
          example: acme_corp
          type: string
        deprecation:
          description: >-
            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.
          items:
            $ref: '#/components/schemas/handler.deprecationNotice'
          type: array
          uniqueItems: false
        latency_ms:
          description: Server-side processing time in milliseconds.
          example: 12.3
          type: number
        request_id:
          description: Unique identifier for this request, useful for support and tracing.
          example: 9d13aef4-02f4-4e73-8c62-4c2601d04f9d
          type: string
        source_type:
          description: Type of the parent source (e.g. `file`, `slack`, `notion`).
          example: file
          type: string
        sub_tenant_id:
          deprecated: true
          example: sub_tenant_4567
          type: string
          x-deprecated: 'true'
        tenant_id:
          deprecated: true
          example: tenant_1234
          type: string
          x-deprecated: 'true'
      type: object
    handler.ErrorDetail:
      properties:
        deprecated:
          description: Whether this response concerns a deprecated field or route.
          example: true
          type: boolean
        deprecated_field:
          description: The deprecated field name.
          example: tenant_id
          type: string
        error_code:
          description: Machine-readable error classification code.
          example: VALIDATION_ERROR
          type: string
        message:
          description: Human-readable description of the error.
          example: Request validation failed
          type: string
        preferred_field:
          description: The canonical replacement for the deprecated field.
          example: database
          type: string
        success:
          deprecated: true
          description: >-
            Deprecated for API clients: always false on this path, so it carries
            no

            information. To detect a failure read the HTTP status code; for what

            went wrong read the envelope's error.code and error.message, and

            meta.request_id when reporting it. The whole `detail` object is

            deprecated legacy — tagging the field individually so SDK users see
            it

            on the property, not just the container (PRO-1208).
          example: true
          type: boolean
          x-deprecated: 'true'
      type: object
    handler.ErrorMeta:
      properties:
        api_version:
          type: string
        latency_ms:
          example: 12.3
          type: number
        request_id:
          description: Unique identifier for this request, useful for support and tracing.
          example: 9d13aef4-02f4-4e73-8c62-4c2601d04f9d
          type: string
      type: object
    graph.TripletWithEvidence:
      properties:
        chunk_id:
          description: Chunk that provides evidence for this relation.
          example: HydraEmbeddings123_0
          type: string
        relations:
          description: Evidence entries for this relationship triplet.
          example:
            - canonical_predicate: works_at
              chunk_id: HydraEmbeddings123_0
              confidence: 0.92
              context: Ada joined Acme Corp in 2024 as a staff engineer.
              raw_predicate: is employed by
              relationship_id: rel_1234
              source_entity_id: entity_1a2b
              synthesized: true
              target_entity_id: entity_3c4d
              temporal_details: since 2024
              timestamp: '2026-07-02T10:00:00Z'
          items:
            $ref: '#/components/schemas/graph.RelationEvidence'
          type: array
          uniqueItems: false
        source:
          $ref: '#/components/schemas/graph.Entity'
          example:
            entity_id: entity_1a2b
            identifier: Acme Corp
            name: general
            namespace: organization
            provider: slack
            type: knowledge
        target:
          $ref: '#/components/schemas/graph.Entity'
          example:
            entity_id: entity_1a2b
            identifier: Acme Corp
            name: general
            namespace: organization
            provider: slack
            type: knowledge
        truncated:
          description: >-
            Truncated is set on auxiliary triplets whose fan-out hit a per-node
            cap,

            so a caller can tell "this source has no more comments" from "we
            stopped

            counting". Omitted (false) on entity relations, which are bounded by
            the

            request's own limit/cursor instead.
          example: true
          type: boolean
      type: object
    graph.SubgraphSource:
      properties:
        app_external_id:
          description: >-
            Provider-assigned identifier for this source (e.g. Slack channel
            ID).
          example: C0123456789
          type: string
        app_kind:
          description: App integration category, populated for connector-synced sources.
          example: slack
          type: string
        app_provider:
          description: Provider name for app-sourced items (e.g. `slack`, `github`).
          example: slack
          type: string
        depth:
          description: Depth is the BFS distance from the seed (0 for the seed itself).
          example: 1
          type: integer
        discovered_relation:
          type: string
        discovered_via:
          description: >-
            DiscoveredVia and DiscoveredRelation record the traversal
            provenance:

            which already-admitted source this member was first reached from,
            and

            through which mechanism — a RELATES_TO relation_type (reply_to,

            child_of, ...), same_thread, parent or child. Empty on the seed.
          type: string
        hydration:
          description: >-
            Hydration carries the same resolved/stub/placeholder classification

            Entity.Hydration documents: a RELATES_TO target may be a
            MERGE-created

            forward reference to a document that has not been ingested yet.
          type: string
        source_id:
          example: HydraDoc1234
          type: string
        thread_id:
          type: string
        title:
          description: Title or name of the source.
          example: Project Phoenix Overview
          type: string
      type: object
    handler.deprecationNotice:
      properties:
        deprecated:
          description: Whether this response concerns a deprecated field or route.
          example: true
          type: boolean
        deprecated_field:
          description: The deprecated field name.
          example: tenant_id
          type: string
        deprecated_since:
          description: API version when the field was deprecated.
          example: 2.0.1
          type: string
        message:
          description: Migration guidance message.
          example: tenant_id is deprecated; use database instead.
          type: string
        preferred_field:
          description: The canonical replacement for the deprecated field.
          example: database
          type: string
      type: object
    graph.RelationEvidence:
      properties:
        canonical_predicate:
          description: >-
            Normalized predicate for the relationship (e.g. `works_at`,
            `depends_on`).
          example: works_at
          type: string
        chunk_id:
          description: NO omitempty
          example: HydraEmbeddings123_0
          type: string
        confidence:
          description: Confidence score, from 0 to 1.
          example: 0.92
          type: number
        context:
          description: Verbatim passage from the source that evidences the relationship.
          example: Ada joined Acme Corp in 2024 as a staff engineer.
          type: string
        raw_predicate:
          description: As-extracted predicate before normalization.
          example: is employed by
          type: string
        relationship_id:
          description: Unique identifier for this relationship instance.
          example: rel_1234
          type: string
        source_entity_id:
          description: NO omitempty
          example: entity_1a2b
          type: string
        synthesized:
          description: >-
            Synthesized marks a triplet with no stored edge behind it. Only

            `present_in` sets it: that edge is derived by collapsing

            Entity-PRESENT_IN->Chunk-HAS_CHUNK->Source, so its RelationshipID is
            a

            deterministic synthetic id rather than a graph relationship id.
            Omitted

            (false) on every stored edge.
          example: true
          type: boolean
        target_entity_id:
          description: NO omitempty
          example: entity_3c4d
          type: string
        temporal_details:
          description: NO omitempty
          example: since 2024
          type: string
        timestamp:
          description: RFC3339 timestamp associated with this item.
          example: '2026-07-02T10:00:00Z'
          type: string
      type: object
    graph.Entity:
      properties:
        entity_id:
          description: Unique identifier for this entity in the graph.
          example: entity_1a2b
          type: string
        hydration:
          description: "Hydration is set on Source nodes in AuxiliaryRelations only, and omitted\neverywhere else. RELATES_TO MERGEs its target by source_id, so a target\nthat has not been ingested yet still exists as a node — callers must be\nable to tell a real document from a forward reference to one.\n\n\tresolved    — ingested; source_id and app_provider both present\n\tstub        — MERGE-created target; source_id present, no app_provider\n\tplaceholder — source_id IS NULL, keyed by app_external_id, awaiting\n\t              builder.py's reconciliation pass"
          type: string
        identifier:
          description: NO omitempty — serialize as null
          example: Acme Corp
          type: string
        name:
          description: Human-readable label for this resource.
          example: general
          type: string
        namespace:
          description: Namespace grouping for the entity (e.g. `organization`, `person`).
          example: organization
          type: string
        provider:
          description: >-
            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.
          example: slack
          type: string
        type:
          description: Entity type label (e.g. `knowledge`, `person`, `organization`).
          example: knowledge
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: API key
      description: 'API key sent as a Bearer token: "Bearer prefix.secret"'
      scheme: bearer
      type: http

````