Skip to main content
REST One HTTPS request. Works in any runtime, including serverless functions. Forget memories by describing them, for example “my old phone number”. Synap finds the memories that match the description and either files them for a person to approve, or removes them straight away. Use this when you do not hold memory ids. To delete one memory whose id you have, use memories.delete. A call always covers exactly one user: pass user_id, plus customer_id on a B2B instance. A request that would reach wider than one user is refused. Python 0.5.5 and later. JavaScript and TypeScript 0.5.6 and later.

Parameters

string
required
What to forget, in the user’s own words. 3 to 500 characters.
string
The user whose memories to search. Optional in the signature, but a call without it is refused (HTTP 400), because a forget must cover exactly one user.
string
The customer the user belongs to. Required on B2B. Not accepted on B2C: passing it is rejected. See B2C vs B2B.
dict[str, str]
The level of your scope ladder to search, named in full, for example {"customer": "acme", "team": "payments", "user": "dana"}. Only needed when your ladder has a level between customer and user.
string
default:"preview"
What happens to the memories that match.

Returns

A ForgetResponse.
string
What happened.
string | None
The id of this forget request. In preview mode, the pending request you approve in the dashboard.
list[ForgetCandidate]
The memories the description matched. Each has memory_id, content, memory_type, and store: "memory", or where a copy of its text lives (chunk, sentence, entity, triple, profile, candidate).
list[string]
The memories removed by this call.
list[string]
The memories that could not be removed.
list[string]
On a partial result, the stores that may still hold the text.
bool
true when a search limit stopped the match while it was still finding memories, so the description may cover more than this call reached.
Tell your end user something was removed only when status is "deleted". A partial result hides the memories from reads, but a copy of the text may remain.

Example

Raises

  • InvalidInputError: the call does not cover exactly one user (HTTP 400), Synap rejected the request (HTTP 422), or description or mode is invalid (caught before anything is sent).
  • ServiceUnavailableError: the matcher was unavailable (HTTP 503). Nothing was deleted, so it is safe to try again. The SDK retries first, under its normal retry policy.
  • RateLimitError: too many requests (HTTP 429).
  • AuthenticationError: the API key is missing or invalid, or initialize() has not been called.

See also