Fetch a code entity and its 1-hop graph context in a single response.
Returns the entity itself plus categorised neighbour lists:
- calls: entities this entity calls (outgoing CALLS edges)
- called_by: entities that call this one (incoming CALLS edges)
- tests: test entities that cover this entity (incoming TESTS edges)
- inherits: classes this entity inherits from (outgoing INHERITS edges)
- defines: entities defined inside this one (outgoing DEFINES edges)
Empty lists are returned for edge categories with no neighbours.
CODE-INDEXER-HARDEN-1 F24: a name matching more than one entity is HTTP 409
with every candidate. F29: entity carries source_dirty,
source_fingerprint and head_commit. An index built from uncommitted
changes never reads as fresh against a different revision.
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, 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.
Filter by repository name
Current source revision (git SHA, or the '-dirty-' form for uncommitted changes). Marks the entity stale if it differs from the indexed revision
Checkout-relative file path, to choose one of several same-named entities
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/context?entity_name=string"null{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Get Clusters
Detect knowledge clusters in your Zettelkasten. Finds groups of highly interconnected notes that form coherent knowledge domains.
Get 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.