supermemoryai/supermemory · error · Error
Supermemory forget memory failed: ${response.status} ${respo
Error message
Supermemory forget memory failed: ${response.status} ${response.statusText}. ${errorText} What it means
forgetMemoryRequest throws when the Supermemory forget/delete endpoint returns a non-OK status. The message carries the HTTP status, status text, and response body so the failure is diagnosable from logs alone.
Source
Thrown at packages/tools/src/shared/forget-memory.ts:41
export async function forgetMemoryRequest(
apiKey: string,
params: ForgetMemoryParams,
baseUrl: string = DEFAULT_BASE_URL,
options?: ForgetMemoryRequestOptions,
): Promise<void> {
const response = await fetch(`${baseUrl}/v4/memories`, {
method: "DELETE",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${apiKey}`,
},
body: JSON.stringify(params),
signal: options?.signal ?? AbortSignal.timeout(FETCH_TIMEOUT_MS),
})
if (!response.ok) {
const errorText = await response.text().catch(() => "Unknown error")
throw new Error(
`Supermemory forget memory failed: ${response.status} ${response.statusText}. ${errorText}`,
)
}
}
View on GitHub (pinned to d436792e77)
Solutions
- Check the status code embedded in the message (404 = memory already gone, 401 = key, 400 = payload)
- Treat 404 as success (idempotent forget) where appropriate
- Verify API key and retry transient 5xx with backoff
- Pass a custom options.signal to control cancellation
Example fix
// before
await forgetMemoryRequest({ memoryId })
// after
try {
await forgetMemoryRequest({ memoryId })
} catch (e) {
if (e instanceof Error && e.message.includes('404')) return { ok: true }
throw e
} Defensive patterns
Strategy: try-catch
Try / catch
try { await forgetMemoryRequest({ memoryId }) } catch (e) { if (e instanceof Error && /404/.test(e.message)) return { ok: true } /* idempotent */; throw e } Prevention
- Treat 404 forget as success in agent tool handlers
- Retry transient 5xx with backoff
When it happens
Trigger: Invoking the memoryForgetTool / createMemoryForgetFunction with a memoryId that doesn't exist (404), invalid API key (401), or when the API rejects the payload (400). Also thrown if the request exceeds FETCH_TIMEOUT_MS and the abort surfaces as a failed response path.
Common situations: Agent tools trying to forget already-deleted memories; wrong API key environment; timeouts on slow networks.
Related errors
- Failed to add conversation: ${response.status} ${response.st
- Supermemory profile search failed: ${response.status} ${resp
- Supermemory profile search failed: ${response.status} ${resp
- Failed to delete document
- withSupermemory: options must be an object with required con
AI-assisted analysis of supermemoryai/supermemory@d436792e77 (2026-08-28).
Data as JSON: /api/errors/b207e8ede48d3cb7.
Report an issue: GitHub.