EP 17 5 min with Stella & Liam

Does the Vercel AI SDK Remember Between Sessions?

A Vercel AI SDK call only sees the messages you pass into it, so a scheduled agent starts blank every run.

AI Stella and Liam are AI hosts with AI-generated voices. About our AI hosts

Key takeaways

  1. A Vercel AI SDK call only sees the messages you pass in, so nothing carries over by itself.
  2. useChat keeps messages in the browser, and serverless functions lose memory on cold starts and redeploys.
  3. A database, Vercel Drives, durable workflows and SDK memory providers each cover one slice of memory.
  4. A shared memory layer over MCP lets every run read what earlier runs saved with get_context and save_turn.
  5. Scheduled agents suffer most, because nobody is there to re-brief them.

Show notes

A Vercel AI SDK call only sees the messages you pass into it, so a scheduled agent starts blank every run. In this episode of Agentic Pod, Liam and Stella walk through five ways to give it memory, from your own database to Vercel Drives, durable workflows and memory providers, and how a shared memory layer like Vilix AI lets every run read what earlier runs saved with get_context and save_turn.

What we cover:

  • Why generateText and streamText start blank
  • useChat keeps state in the browser, serverless loses it on cold starts
  • Fix 1: your own database (Postgres, Supabase, Upstash Redis, Vercel KV)
  • Fix 2: Vercel Drives for sandbox agents
  • Fix 3: durable workflows remember where a run stopped, not what it learned
  • Fix 4: memory providers built for the SDK
  • Fix 5: one hosted memory layer over MCP with Vilix AI, source labels, saved failures and newest memory wins
  • User rules, project rules, skills, the agent inbox and one Vilix AI account per client

Chapters

Questions answered in this episode

Does the Vercel AI SDK remember between sessions?

No. Each generateText or streamText call only sees the messages you pass in. Persistence is up to you.

Why does my scheduled Vercel agent start blank?

A cron-triggered agent has no person to re-brief it and no stored history, so it repeats work and can reach different answers.

What are the ways to add memory to a Vercel AI SDK agent?

Store message history in your own database, use Vercel Drives for sandbox agents, add durable workflow execution for crash recovery, use a memory provider built for the SDK, or connect one hosted memory layer over MCP.

How does a shared memory layer help?

The agent calls get_context at the start of a run and save_turn at the end, so the next run, and any other connected tool, sees the full history.

Links & resources

Full transcript

Intro

Liam

Hey hey hey, welcome to Agentic Pod! I'm Liam.

Stella

And I'm Stella! Liam, a Vercel AI SDK call only sees the messages you pass into it. Nothing else. So where does the memory live?

Liam

Nowhere. That's the surprise. Today: why your Vercel agent starts blank every session, five ways to fix it, and which one fits.

Stella

Five? I'll take the one that fits my cron job. It wakes up blank every morning, a bit like me.

Liam

Same. Let's go.

Why the agent starts blank

Stella

So I call generateText. What does it actually remember?

Liam

Only what you hand it. Each generateText or streamText call sees the messages array you pass in. That's the whole world.

Stella

But my chat app feels like it remembers.

Liam

That's the useChat hook. It keeps the messages in the browser. Close the tab, and that state is gone.

Stella

And on the server?

Liam

Serverless functions lose anything held in memory on a cold start or a redeploy. So the SDK is doing its job. It handles the interaction. Keeping things is your job.

Stella

Okay, but in a chat, I can re-brief the agent myself.

Liam

Right. A scheduled agent has nobody to re-brief it. Picture a daily lead enrichment agent. It researches the same leads again, burns the same tokens again, and may land on a different answer.

Stella

Ouch. So which fix do I pick?

Four fixes, and what each one remembers

Liam

Option one: save the message history in your own database. Postgres, Supabase, Upstash Redis, Vercel KV. You get full detail.

Stella

And the catch?

Liam

You write the rest. Summaries, retention, retrieval. And it stays inside that one app.

Stella

Option two?

Liam

Vercel Drives, for sandbox agents. Durable file storage across runs. Files survive, but recall stays manual. The agent has to know which file to open.

Stella

And durable workflows? I keep seeing those.

Liam

Great for crashes. A long run dies at step nine, and it resumes at step nine. But it remembers where a run stopped, not what the run learned.

Stella

Right. And memory providers built for the SDK?

Liam

Those give you per-user memory with scoped retrieval. Useful. But you add a service to run, and your memory is tied to that provider.

Stella

Okay. So all four stay inside one app. What's number five?

The fifth fix, with Vilix AI

Liam

One hosted memory layer, shared over MCP, the plug that lets an AI app use outside tools. That's Vilix AI.

Stella

And what does my agent do with it?

Liam

At the start of the run, it calls get_context. So it reads what earlier runs saved. At the end, it calls save_turn with the full conversation, not a summary.

Stella

So tomorrow's run sees the real reasoning.

Liam

Exactly. Every save carries a source label, so you know if it came from your Vercel agent, Claude Code or Cursor. And failures get saved too, so the agent doesn't retry a dead end.

Stella

What if my Vercel agent and Cursor disagree?

Liam

Newest memory wins. Correct it once in Vilix AI, and every connected tool sees the new truth.

Stella

And the lead enrichment agent?

Liam

It reads yesterday's leads first. It skips what's done. Same tokens, no repeat work.

Stella

That's the fix for my cron job. Wait, one more thing. What about the stuff I paste every single run?

Rules, agencies and recap

Liam

Tone, format, do's and don'ts? Those go in user rules and project rules in Vilix AI. Every connected tool loads them. Reusable procedures live as skills.

Stella

And if I run ten agents and want to nudge them all?

Liam

The agent inbox. Post one message, and your agents get it on their next read. Urgent ones repeat until the agent acknowledges.

Stella

Okay, and the agency crowd? Because I know people shipping Vercel agents for clients.

Liam

One Vilix AI account per client, like a Gmail account that belongs to that client. Every agent you build for them connects to that account, so the memory belongs to their business.

Stella

So the agent loop stays stateless.

Liam

Right. Stateless compute, separate memory. Quick recap. The SDK only sees the messages you pass. A database, Drives, durable workflows and memory providers each cover one slice. With Vilix AI, get_context first, save_turn last, newest memory wins. The guide and the blog post are in the description, and setup takes under two minutes per tool at vilix.ai. Which agent of yours wakes up blank? Tell us in the comments. See you next time!