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

  1. Check the status code embedded in the message (404 = memory already gone, 401 = key, 400 = payload)
  2. Treat 404 as success (idempotent forget) where appropriate
  3. Verify API key and retry transient 5xx with backoff
  4. 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

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


AI-assisted analysis of supermemoryai/supermemory@d436792e77 (2026-08-28). Data as JSON: /api/errors/b207e8ede48d3cb7. Report an issue: GitHub.