Update memory group_ids
Add or remove group_ids on a single memory — the sharing
axis. Group tags control who can reach a row via
filters: {group_ids: <id>} on search / list, so this is how a
memory becomes shared (or un-shared) after ingest.
Scope is group tags only: text and the entity ids
(user_id / agent_id / conv_id / app_id) are
immutable post-ingest and are not editable here. The operation is
set-based and idempotent — re-sending the same patch is a no-op and
skips the write entirely. See :class:MemoryGroupPatchRequest for
the full contract.
Authorizations
Long-lived org API key. Alternative: Authorization: Bearer <key>.
Required alongside the API key (no key→org reverse index).
Path Parameters
Body
PATCH /v1/memories/{id} — add or remove group_ids on an
existing memory row.
Scope is intentionally narrow: this endpoint mutates the row's
group tags only — the sharing axis. It does not edit text or
any entity id (user_id / agent_id / conv_id /
app_id); those are immutable once ingested.
Semantics are set-based and order-independent — group_ids is an
unordered set of tags. Adding an id already present is a no-op, and
removing an id that isn't there is a no-op, so the whole operation
is idempotent and safe to retry. remove is applied before
add; the same id may not appear in both lists (422 contradictory_group_ids). At least one list must be non-empty
(422 empty_patch).
Every id in add_group_ids must be an active group on the
org (see POST /v1/groups); an unknown or archived id is
rejected with 422 invalid_group_ids. remove_group_ids is
not validated against the registry — a tag can always be removed,
including one whose group was archived after it was applied.
Group ids to add to the row. Each must be an active group on the org. Ids already present are ignored (no duplicates). Blank entries are trimmed away.
["grp_eng", "grp_oncall"]Group ids to remove from the row. Ids not currently on the row are ignored. Not validated against the group registry, so an archived group's tag can still be removed.
["grp_personal"]Response
Updated. Returns the full memory with its new group_ids.
Unified memory resource — facts, artifacts, episodes marshal to
this shape. type is the discriminator; details is the
type-specific extension.
Invariant: text is always a short readable preview, regardless
of type (fact statement / artifact summary / episode summary).
Stable UUID for this memory row.
Memory subtype. fact = a single semantic claim extracted from a turn; artifact = a structured object (code, doc, image) referenced by the conversation; episode = a session-scoped summary of a stretch of turns.
fact, artifact, episode Short readable preview. For facts: the claim statement. For artifacts: a summary or title (full body lives in details.full_content, opt-in via include=full_content). For episodes: a summary of the session.
Constant discriminator for the resource type.
"memory"User scope this row belongs to.
Agent scope, if any.
Conversation anchor.
App scope, if any.
Group ids associated with this row — the sharing axis. Stamped at ingest time and editable afterward via PATCH /v1/memories/{id} (add_group_ids / remove_group_ids). Reachable as a filter axis via filters: {group_ids: <id>} or {group_ids: {"$in": [<id>, ...]}}.
Optional category labels from xmem's extraction pipeline.
Vector-similarity score. Present only on search responses; null on list / get-by-id / patch / ingest result rows.
ISO-8601 timestamp of original ingest.
ISO-8601 timestamp of the last supersede / consolidation.
Per-row fact details — sits under Memory.details when
Memory.type == "fact". Mirrors the SoT shape, not xmem's raw
Fact shape: e.g. xmem's source_artifact_id → artifact_id.
- FactDetails
- ArtifactDetails
- EpisodeDetails