AI SDK SDK changes.

Updates for the Supermemory AI SDK SDK and API client surface.

MCP retries instead of signing you out during an auth outage#

A brief authentication outage used to return invalid_token, the protocol signal to discard your credential, so every connected MCP client was logged out. Those requests now return 503 with Retry-After so clients wait and retry.

Improvements

  • withSupermemory in @supermemory/tools now takes an apiKey option instead of only reading the environment variable, so it works with secrets managers, edge runtimes, and per-request keys.
  • The ai-sdk package re-exports PromptTemplate, MemoryPromptData, and WithSupermemoryOptions, so the documented custom-template example compiles.

withSupermemory now takes the key directly, so it works with a secrets manager, an edge runtime, or a different key per request:

import { withSupermemory } from "@supermemory/tools/ai-sdk"

const model = withSupermemory(openai("gpt-5.6"), "user-123", {
  apiKey: process.env.MY_VAULT_KEY,
})

Requires @supermemory/tools 2.2.0 or later:

npm install @supermemory/tools@latest

Persistent memory plugin for OpenAI Codex#

Install the Codex plugin to recall project and user memory, capture completed sessions, and explicitly search or save context.

Fixes

  • The AI SDK wrapper now continues without memory when retrieval fails or exceeds five seconds.