supermemoryai/supermemory · warning
Supermemory retrieval failed; continuing without injected me
Error message
Supermemory retrieval failed; continuing without injected memories
What it means
Warned (only when skipMemoryOnError is enabled) that the attempt to retrieve memories and inject them into the Vercel AI SDK model call failed, so the request proceeds without injected memories. The original error message from transformParamsWithMemory is attached. It is a graceful-degradation path: the LLM call still happens, just without personalization context.
Source
Thrown at packages/tools/src/vercel/index.ts:160
baseUrl: options.baseUrl,
includeToolCalls: options.includeToolCalls ?? false,
promptTemplate: options.promptTemplate,
memoryRetrievalTimeoutMs: DEFAULT_MEMORY_RETRIEVAL_TIMEOUT_MS,
})
const skipMemoryOnError = options.skipMemoryOnError ?? true
// Proxy keeps prototype/getter fields (e.g. provider, modelId) that `{ ...model }` drops.
return new Proxy(model, {
get(target, prop, receiver) {
if (prop === "doGenerate") {
return async (params: LanguageModelCallOptions) => {
let modelParams: LanguageModelCallOptions = params
try {
modelParams = await transformParamsWithMemory(params, ctx)
} catch (memoryError) {
if (skipMemoryOnError) {
ctx.logger.warn(
"Supermemory retrieval failed; continuing without injected memories",
{
error:
memoryError instanceof Error
? memoryError.message
: "Unknown error",
},
)
modelParams = params
} else {
ctx.logger.error("Error during memory retrieval for generation", {
error:
memoryError instanceof Error
? memoryError.message
: "Unknown error",
})
throw memoryError
}View on GitHub (pinned to d436792e77)
Solutions
- Inspect the logged error field to identify the root cause (auth vs validation vs network)
- Verify the Supermemory API key and tool configuration (projectFilter JSON validity, correct endpoint)
- If failures should fail loudly instead of silently degrading, set skipMemoryOnError: false
- Retry with backoff for transient network errors; check Supermemory status and SDK changelog for breaking param changes
Example fix
// before
const result = await generateText({ model: wrapped, prompt })
// silently no memories when retrieval fails
// after
const wrapped = wrapLanguageModel({
model,
middleware: supermemoryMiddleware({
skipMemoryOnError: false, // surface retrieval errors instead of degrading
}),
}); Defensive patterns
Strategy: try-catch
Validate before calling
if (!process.env.SUPERMEMORY_API_KEY) {
throw new Error('SUPERMEMORY_API_KEY is required for memory injection');
} Type guard
const hasMemoryConfig = (c: unknown): c is { apiKey: string } =>
typeof c === 'object' && c !== null && typeof (c as any).apiKey === 'string' && (c as any).apiKey.length > 0; Try / catch
try {
const result = await generateText({ model: wrapped, prompt });
} catch (e) {
// when skipMemoryOnError: false, retrieval failures throw here;
// decide whether to retry without the middleware or surface the error
if (e instanceof Error && /supermemory/i.test(e.message)) { /* handle */ }
throw e;
} Prevention
- Validate API key presence at startup
- Keep skipMemoryOnError: false in dev so retrieval failures are visible
- Log the error metadata attached to the warning to catch config mistakes early
When it happens
Trigger: wrapLanguageModel/wrapper context where the Supermemory search API call inside transformParamsWithMemory throws — invalid/missing API key, malformed filter JSON, bad timeRange, network failure, or non-2xx from the Supermemory endpoints — and skipMemoryOnError defaults to true.
Common situations: Missing or rotated SUPERMEMORY_API_KEY, stale SDK version sending params the API rejects, transient network outages in edge/serverless runtimes, malformed projectFilter/filter JSON passed to the wrapper options.
Related errors
AI-assisted analysis of supermemoryai/supermemory@d436792e77 (2026-08-28).
Data as JSON: /api/errors/327ec22271074c02.
Report an issue: GitHub.