Skip to main content
POST
/
v4
/
memories
/
forget-matching
Forget memories matching a prompt/query
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({query: 'forget everything about Project Titan', containerTag: 'user_123'})
};

fetch('https://api.supermemory.ai/v4/memories/forget-matching', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "dryRun": true,
  "count": 123,
  "forgetBatchId": "<string>",
  "summary": "<string>",
  "candidates": [
    {
      "id": "<string>",
      "memory": "<string>",
      "score": 123
    }
  ],
  "forgotten": [
    {
      "id": "<string>",
      "memory": "<string>",
      "score": 123
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
query
string
required

Natural-language instruction ('forget everything about Project Titan') or a bare topic ('Project Titan'). An agent searches the container's memories and selects matches to forget.

Required string length: 1 - 2000
Example:

"forget everything about Project Titan"

containerTag
string
required

Container tag / space the forget operation is scoped to.

Maximum string length: 100
Pattern: ^[a-zA-Z0-9_:-]+$
Example:

"user_123"

dryRun
boolean
default:false

When true, returns the memories that WOULD be forgotten without mutating anything. Defaults to false (forgets for real).

Example:

false

threshold
number
default:0.5

Minimum cosine similarity a memory must have to be considered. Lower = wider net. Defaults to 0.5.

Required range: 0 <= x <= 1
Example:

0.5

maxForget
integer
default:100

Maximum number of memories this call may forget. Defaults to 100, max 500.

Required range: 1 <= x <= 500
Example:

100

reason
string

Optional reason stored as forgetReason on each memory.

Example:

"project cancelled"

Response

Forget operation completed (or previewed)

Response after an agentic mass-forget

dryRun
boolean
required

Whether this was a preview (no mutation) or a real forget

count
number
required

Number of memories selected / forgotten

forgetBatchId
string | null
required

ID tagged on every memory forgotten in this call (null on dryRun)

summary
string
required

The agent's one-line summary of what it did

candidates
object[]

On dryRun: the memories that would be forgotten

forgotten
object[]

On apply: the memories that were forgotten