Neurophic
Memory

Delete a memory

Learn about how to delete a memory

Delete removes a memory immediately and permanently. By default it also removes the history behind the memory.

DELETE/v1/memories/{id}https://api.neurophic.ai

Request

id
string in path required
Memory id.
identifier
string in query required 1-500 characters
Your end-user id.
restorePrevious
string in query default false
When 'true', delete only this version and restore the version it superseded. Defaults to 'false', which removes the memory and every version it superseded.

Warning

Send no request body: a DELETE with a body is rejected.

Delete or roll back

When a new memory contradicts an older one, the older one is kept and marked as superseded, so a fact can carry a chain of versions. Deleting can go two ways:

  • Default. Removes the memory and every older version it superseded, following the chain all the way back, including decayed ones. Use this when the fact should be gone altogether.
  • Roll back. With restorePrevious: true, only the named memory is removed and whatever it superseded becomes the current version again. Use this when the latest update was wrong but the earlier fact was right; if the memory superseded nothing, it is the same as the default.

Response

204Success

Failures return one of the errors listed under API reference > Errors.

A successful delete returns 204 with no body:

HTTP/1.1 204 No Content

Note

  • Deleting a receipt id from Ingest removes the observation only. Before processing, that stops anything being promoted from it; after promotion, the long-term memories derived from it stay and must be deleted separately.
  • Patterns have no id and cannot be deleted directly. Delete the memories they were built from.

Example

import { Neurophic } from 'neurophic';

const client = new Neurophic({ apiKey: process.env.NEUROPHIC_API_KEY });

await client.memory.delete('5f1d2c3e-0c2a-4b7e-9a1b-2f3c4d5e6f70', {
  identifier: 'user-123',
});