# EP 17: Does the Vercel AI SDK Remember Between Sessions?

- URL: https://www.agenticpod.net/episodes/ep17-vercel-ai-sdk-memory-between-sessions/
- Watch on YouTube: https://www.youtube.com/watch?v=HMe3ScWWDeo
- Published: 2026-10-17
- Length: 5 min
- Hosts: Stella (asks), Liam (answers). Both are AI hosts with AI-generated voices.

## Summary

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

## Key takeaways

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

## Chapters

- 0:00 Intro
- 0:39 Why the agent starts blank
- 1:32 Four fixes, and what each one remembers
- 2:25 The fifth fix, with Vilix AI
- 3:27 Rules, agencies and recap

## FAQ

**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.

## Resources

- [Full technical guide (setup, copy-paste prompts, FAQ)](https://github.com/asly-97/ai-automation-workflows/tree/main/vercel-ai-sdk-agent-memory)
- [The blog post behind this episode](https://vilix.ai/blog/vercel-ai-sdk-agent-forgets-between-sessions-fix)
- [Vilix AI, one shared memory for ChatGPT, Claude, Claude Code, Codex, Cursor, OpenClaw, Hermes and every MCP tool](https://vilix.ai)
- [Connect Vilix AI in under two minutes per tool](https://vilix.ai/get-started)

## 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!
