SmartMemory
GET
/memory/code/dependencies

Trace code dependencies for an entity.

Returns the root entity and its dependents (what uses it) and/or dependencies (what it uses), controlled by direction.

CODE-INDEXER-HARDEN-1 F24: when the name matches more than one entity the response is HTTP 409 with every candidate (detail.status == "ambiguous"). Pass file_path or item_id to choose one.

Authorization

AuthorizationBearer <token>

Send Authorization: Bearer <token>. The token is either a Clerk session JWT or a SmartMemory API key (prefix sm_live_, sm_test_, or legacy sk_).

In: header

Query Parameters

entity_name*Entity Name

Entity name, case-insensitive. Matches the stored name or qualified name exactly, or as a dotted suffix (so 'run' finds 'Svc.run'). More than one match returns 409 with the candidates.

direction?DependencyDirection

Traversal direction

repo?|

Filter by repository name

limit?Limit

Max related entities per direction

file_path?|

Checkout-relative file path, to choose one of several same-named entities

item_id?|

Exact item_id of one candidate from a previous 409 response

Response Body

application/json

application/json

curl -X GET "https://example.com/memory/code/dependencies?entity_name=string"
null
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}