update_memory
Destructive
Correct the entities, tags, and order links on a saved event.
Use this when the user says a saved memory has a wrong or missing entity or
tag, or that two saves belong in sequence. Do not use it to change the saved
text; the stored content is never modified.
Writes to an existing record.
Args:
event_id: The event to correct.
remove_entities: Entity names or ids to unlink; orphans are deprecated.
add_entities: New entities [{name, type}, ...]; creates one when the
exact spelling does not exist.
add_entity_ids: Existing entity ids to link, never creating. Each is
re-validated; failures come back in `rejected_entity_ids`.
Idempotent.
add_tags: Tag paths to attach (same rules as `save_memory`).
remove_tags: Tag leaf names or group ids to detach.
add_prev_events: Event ids that come before this one, linking
`other -> event_id`, for saves that belong together but were not
chained at save time.
remove_prev_events: Event ids to unlink from the front of this event.
Links carrying document structure from ingestion are refused as
`protected_source` and cannot be rebuilt. The direction is always
"prev", so cutting a link on the other side means running this on
the later event. An id in both lists is refused as
`conflicting_request` and neither operation runs.
add_resolved_by: Evidence events that resolved this one — items are
`{"event_id": "...", "relation": "realization"}`, where `relation`
defaults to `realization`. The direction is the opposite of
`add_prev_events`: this event is the plan or intent, and each
listed event is the evidence. Write access is needed on this event
and read access on the peer. For `realization` this event must come from a
registered app (`#plan`, `#novel`, ...) and both ends must sit in
the same team part.
revoke_resolved_by: Same item shape, taking the edge down. The revoke is
soft: the assertion is preserved, and re-adding the same pair later
revives it rather than creating a second edge. The same pair in
both lists is refused as `conflicting_request`.
Returns:
`{event_id, removed_count, added_count, now_linked_entities,
orphaned_entities, added_tags?, removed_tags?, rejected_tags?,
rejected_entity_ids?, added_prev_events?, removed_prev_events?,
rejected_prev_events?, added_resolved_by?, already_linked_resolved_by?,
revoked_resolved_by?, rejected_resolved_by?, graph_delta?}`.
`graph_delta` reports the derived-layer re-sync when participation or
tags actually changed; a link-only edit feeds no derived layer and
carries none.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| add_tags | No | Tag paths to attach (same rules as `save_memory`). | |
| event_id | Yes | The event to correct. | |
| remove_tags | No | Tag leaf names or group ids to detach. | |
| add_entities | No | New entities [{name, type}, ...]; creates one when the exact spelling does not exist. | |
| add_entity_ids | No | Existing entity ids to link, never creating. Each is re-validated; failures come back in `rejected_entity_ids`. Idempotent. | |
| add_prev_events | No | Event ids that come before this one, linking `other -> event_id`, for saves that belong together but were not chained at save time. | |
| add_resolved_by | No | Evidence events that resolved this one — items are `{"event_id": "...", "relation": "realization"}`, where `relation` defaults to `realization`. The direction is the opposite of `add_prev_events`: this event is the plan or intent, and each listed event is the evidence. Write access is needed on this event and read access on the peer. For `realization` this event must come from a registered app (`#plan`, `#novel`, ...) and both ends must sit in the same team part. | |
| remove_entities | No | Entity names or ids to unlink; orphans are deprecated. | |
| remove_prev_events | No | Event ids to unlink from the front of this event. Links carrying document structure from ingestion are refused as `protected_source` and cannot be rebuilt. The direction is always "prev", so cutting a link on the other side means running this on the later event. An id in both lists is refused as `conflicting_request` and neither operation runs. | |
| revoke_resolved_by | No | Same item shape, taking the edge down. The revoke is soft: the assertion is preserved, and re-adding the same pair later revives it rather than creating a second edge. The same pair in both lists is refused as `conflicting_request`. |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||