← All REST endpoints

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_idstable

Set an edge weight

Parameters
NameInTypeRequiredDefaultAllowedDescription
agent_idquerystringrequired——The agent's agent_key (path segment).
edge_idquerystringrequired——Association edge UUID (path segment). Both of its endpoints must belong to the agent.
weightbodynumberrequired——New weight, clamped 0–1.
reasonbodystringoptional——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

FieldTypeAllowedDescription
edge——The updated edge.
edge.idstring—Association edge UUID.
edge.sourcestring—Source memory UUID.
edge.targetstring—Target memory UUID.
edge.typestring—Edge type (e.g. co_occurrence from Hebbian reinforcement).
edge.weightnumber—Association weight, clamped 0–1.
edge.reinforcement_countinteger—Times the edge was reinforced.
edge.last_reinforced_atstring—Last reinforcement (ISO-8601), or null.

Example

bash
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.