PATCH /api/v1/memory/agents/:agent_id/edges/:edge_id
Auth: Memory API token (Authorization: Bearer trm_api_… or trm_mk_…) minted with writes_enabled=true, or the agent owner's/admin's JWT. A recall-only credential gets 403 writes are off for this credential.
PATCH
/api/v1/memory/agents/:agent_id/edges/:edge_idstableSet an edge weight
| Name | In | Type | Required | Default | Allowed | Description |
|---|---|---|---|---|---|---|
agent_id | query | string | required | — | — | The agent's agent_key (path segment). |
edge_id | query | string | required | — | — | Association edge UUID (path segment). Both of its endpoints must belong to the agent. |
weight | body | number | required | — | — | New weight, clamped 0–1. |
reason | body | string | optional | — | — | Audit reason recorded on the edge. |
Sets an association edge's weight (clamped 0–1) with an audit reason. Changes flow into the graph projection, including removal once the weight falls below the graph's minimum.
Response
| Field | Type | Allowed | Description |
|---|---|---|---|
edge | — | — | The updated edge. |
edge.id | string | — | Association edge UUID. |
edge.source | string | — | Source memory UUID. |
edge.target | string | — | Target memory UUID. |
edge.type | string | — | Edge type (e.g. co_occurrence from Hebbian reinforcement). |
edge.weight | number | — | Association weight, clamped 0–1. |
edge.reinforcement_count | integer | — | Times the edge was reinforced. |
edge.last_reinforced_at | string | — | Last reinforcement (ISO-8601), or null. |
Example
curl -X PATCH https://therobot.is/api/v1/memory/agents/project-aria/edges/9a8b7c6d-5e4f-4a3b-2c1d-0f9e8d7c6b5a \
-H "Authorization: Bearer trm_api_EXAMPLE" \
-H "Content-Type: application/json" \
-d '{"weight": 0.8, "reason": "confirmed by operator review"}'Errors
401{ "error": "Authentication required" }A well-formed but unknown or revoked trm_ bearer. The response does not say which.
403{ "error": "writes are off for this credential" }A credential without writes_enabled=true hit a write endpoint.
404{ "error": "not found" }Unknown id, an id owned by another agent, or an agent the principal cannot see.
403{ "error": "not owned by this agent" }The addressed row exists but does not belong to the path agent.
400{ "error": "weight is required" }No weight in the request body.