Selective forget across derived layers. For reference-counted GDPR erasure, use /v1/erasures.

POST /v1/forget

Selective, non-destructive forget. Removes records from one or more derived layers (beliefs, facts, episodes, understanding) — but leaves the underlying events intact in the WAL. For true, reference-counted event deletion (GDPR right-to-erasure), use POST /v1/erasures instead.

Capability

forget.cascade.<mode> matching the requested cascade.

Request

{
  "scope": "org:acme/dept:eng/user:alice",
  "layers": ["beliefs", "facts"],
  "selector": {
    "about_subject": "user:alice",
    "about_entity":  "ent_acme_corp",
    "predicate":     "is_likely_to_renew",
    "memory_ids":    [],
    "valid_during":  null,
    "recorded_during": null
  },
  "cascade": "derived_only",
  "confirm_all": false,
  "audit_note": "User retracted speculation",
  "idempotency_key": "forget-alice-001"
}
FieldTypeNotes
scopestringRequired.
layersstring[]Subset of beliefs, facts, episodes, understanding.
selectorobjectAll fields optional; combinable. See below.
cascadeenumderived_only (default) or redact_events. See below.
confirm_allboolRequired true when selector is empty/only-layers — guards "forget everything in scope."
audit_notestringRecorded in the audit trail.
idempotency_keystring≤ 64 chars. Repeated calls deduplicated.

Selector fields

FieldEffect
about_subjectMatch records where subject equals this actor/entity ID
about_entityMatch records mentioning this entity
predicateMatch facts/beliefs with this predicate
memory_idsExplicit record IDs
valid_duringMatch records with valid_from/to overlapping this range
recorded_duringSame, on the recorded_from/to axis

Cascade modes

ModeCapabilityBehaviour
derived_only (default)forget.cascade.derived_onlyDeletes from named layers. Events untouched.
redact_eventsforget.cascade.redact_eventsBlanks event payloads, keeps id + wal_offset (preserves refcount integrity).

True event deletion is not a cascade mode here. See erasures for the GDPR path.

Response

{
  "deleted": {
    "events": 0,
    "episodes": 0,
    "facts":   2,
    "beliefs": 1,
    "understanding": 0
  },
  "audit_id": "audit_01HX..."
}

Errors

HTTPerror_codeWhen
403policy_deniedRequested cascade capability missing
422EMPTY_SELECTOR_WITHOUT_CONFIRMATIONSelector empty (or only layers) and confirm_all is not true
422invalid_selectorSelector fields contradict (e.g., memory_ids plus about_subject)