← All REST endpoints

POST /api/v1/memory/agents/:agent_id/memories

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.

POST/api/v1/memory/agents/:agent_id/memoriesstable

Capture a memory

Parameters
NameInTypeRequiredDefaultAllowedDescription
agent_idquerystringrequired——The agent's agent_key (path segment).
contentbodystringrequired——The memory itself.
titlebodystringoptional——Human-readable label (truncated at 200 characters).
summarybodystringoptional——Short summary text.
contextbodystringoptional——Where, when and who, as prose.
reflectionbodystringoptional——What the agent made of it at the time.
tangentbodystringoptional——What it strayed to.
interpretationbodystringoptional——The durable reading of the memory.
content_typebodystringoptionalepisodicepisodic, semantic, proceduralMemory type.
compartmentbodystringoptionaldefault—Access compartment slug.
occurred_atbodystringoptional——When the memory is about (ISO-8601).
moodbody—optional——Object with valence (-1.0–1.0), arousal, dominance (0–1). Missing components fall back to neutral.
hormonesbody—optional——Object with cortisol, dopamine, oxytocin, serotonin (0–1). Missing components fall back to baseline.
withbody—optional——Collaborators (stored as collaborators).
placebody—optional——Where labels (alias: where).
when_labelsbody—optional——When labels (alias: when).
taskbodystringoptional——The job the memory was part of.
artifactbodystringoptional——The artifact it was about.
scopebodystringoptionalagentagent, orgscope=org files the memory under the caller's organization (membership-checked; open classification enforced).
repobodystringoptional——Repo slug for org-scoped memories (with scope=org).

Captures a memory for the agent through the canonical write path (the same code the MCP remember tool runs). The owner is forced to the path agent; the Guardian may quarantine a write, which comes back 202 with memory: null, not a fake success.

Response

FieldTypeAllowedDescription
memory——The created memory (full detail view), or null when quarantined.
statusstring—ok, or quarantined when the Guardian holds the write.
confidencestringhigh, medium, lowIngest confidence.

Example

bash
curl -X POST https://therobot.is/api/v1/memory/agents/project-aria/memories \
  -H "Authorization: Bearer trm_api_EXAMPLE" \
  -H "Content-Type: application/json" \
  -d '{"content": "Hank moved the crate to the dry side of the dock before the rain", "title": "Hank docks crate", "mood": {"valence": 0.4, "arousal": 0.6}}'

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 or foreign agent key — at the agent level the two are deliberately the same answer, so no existence leaks.

  • 422{ "errors": { "field": ["message", …] } }

    Validation failure, as a per-field message map.