GET /api/v1/memory/agents/:agent_id/graph
Auth: Memory API token (Authorization: Bearer trm_api_… or trm_mk_…) or the agent owner's/admin's JWT. The principal must be able to see the agent: its owner, a global admin, or a credential bound to it. Unknown and foreign agents are the same 404.
GET
/api/v1/memory/agents/:agent_id/graphstableFetch the memory subgraph
| Name | In | Type | Required | Default | Allowed | Description |
|---|---|---|---|---|---|---|
agent_id | query | string | required | — | — | The agent's agent_key (path segment). |
compartment | query | string | optional | — | — | Restrict to one compartment slug. |
min_weight | query | number | optional | 0.2 | — | Minimum edge weight to include. |
hops | query | integer | optional | 2 | — | Traversal depth from seed (1–3). Only meaningful with seed. |
seed | query | string | optional | — | — | Memory UUID to traverse from. Omit for the whole graph. |
limit | query | integer | optional | 500 | — | Node cap. |
Returns the agent's association subgraph: without seed the whole graph at or above min_weight (node-capped, strongest salience first); with seed the ≤hops neighborhood of that memory. Only nodes owned by the agent appear, and an edge only when both endpoints do.
Response
| Field | Type | Allowed | Description |
|---|---|---|---|
nodes | — | — | Array of memory nodes. |
nodes[].id | string | — | Memory UUID. |
nodes[].title | string | — | Human-readable label (empty for a sealed memory whose title was stripped). |
nodes[].sealed | boolean | — | True when the row is sealed and its contents withheld. |
nodes[].summary | string | — | Generated or authored summary (may be empty). |
nodes[].record_class | string | original, summary, inferred, reconstructed, user_supplied, system_generated, contested | Provenance class of the record. |
nodes[].disputed | boolean | — | Whether the record is under dispute. |
nodes[].content_type | string | episodic, semantic, procedural | Memory type. |
nodes[].state | string | active, consolidating, archived, quarantined, pruned | Lifecycle state. |
nodes[].compartment | string | — | Access compartment slug (default: default). |
nodes[].salience | number | — | Current salience, 0–1. |
nodes[].decay_weight | number | — | Decay weight, clamped 0.05–1.0. |
nodes[].pinned | boolean | — | Pinned memories resist decay. |
nodes[].valence | number | — | Emotional valence at capture, -1.0–1.0. |
nodes[].arousal | number | — | Emotional arousal at capture, 0–1. |
nodes[].recall_count | integer | — | Times recalled. |
nodes[].occurred_at | string | — | When the memory is about (ISO-8601), or null. |
edges | — | — | Array of association edges whose both endpoints are in nodes. |
edges[].id | string | — | Association edge UUID. |
edges[].source | string | — | Source memory UUID. |
edges[].target | string | — | Target memory UUID. |
edges[].type | string | — | Edge type (e.g. co_occurrence from Hebbian reinforcement). |
edges[].weight | number | — | Association weight, clamped 0–1. |
edges[].reinforcement_count | integer | — | Times the edge was reinforced. |
edges[].last_reinforced_at | string | — | Last reinforcement (ISO-8601), or null. |
truncated | boolean | — | True when the node cap cut the result. |
Example
curl "https://therobot.is/api/v1/memory/agents/project-aria/graph?min_weight=0.3&limit=100" \
-H "Authorization: Bearer trm_api_EXAMPLE"Errors
401{ "error": "Authentication required" }A well-formed but unknown or revoked trm_ bearer. The response does not say which.
404{ "error": "not found" }Unknown or foreign agent key — at the agent level the two are deliberately the same answer, so no existence leaks.