MemoryRouter
Vercel AI SDK memory

Vercel AI SDK memory: providers, persistence, and a vault

The AI SDK gives you streaming, tools, and agents. Memory is explicitly delegated: to a provider, or to a database you operate behind useChat.

Vercel. Sources checked 2026-09-25.

How Vercel AI SDK handles memory today

The docs describe agent memory in three shapes: memory providers such as Anthropic, Letta, Mem0, Supermemory, and MongoDB-backed options, message persistence in your own backend keyed by chat id, and the raw option of reloading history yourself.

Providers cover the middle layer. The parts that stay with you are per-user isolation, retention, and making recall useful across products, because those are properties of the store rather than the SDK.

What Vercel AI SDK forgets

Persistence is not memory. A message log is not recall.

The fix with MemoryRouter

Two clean paths. Route model calls through the OpenAI-compatible endpoint for automatic recall and capture, or call the memory API directly from your route handlers when you want explicit control.

  1. 1

    Route provider calls through MemoryRouter

    Provider base URL

    baseURL: "https://api.memoryrouter.ai/v1"  // Memory Key supplies auth context
  2. 2

    Add explicit memory tools when you want them

    Expose search, store, and time-window recall as tools so your agent can save a decision the moment it is made and look it up later.

  3. 3

    Key memory per user

    Issue a vault per user through your provisioning flow, so isolation and deletion are account operations rather than query parameters.

Start a MemoryRouter vault

An endpoint and API that fit the AI SDK model. 14-day free trial.

Related

Vercel AI SDK memory FAQ

Sources

Sources checked 2026-09-25. Tool behavior changes; check the vendor docs before relying on a detail.

Start free