Disclosure: I'm Mohammed, founder of MemorySync. I drafted this article with AI assistance and reviewed it for accuracy against the official MemorySync and AI SDK docs. The code is adapted from the docs and I haven't run it.
The AI SDK's chatbot persistence guide shows how to save a chat: useChat sends the chat id and messages, and you store the messages when the stream ends. Load them by chat id and the conversation picks up where it left off. Start a new chat, though, and the model knows nothing about the user. A transcript belongs to one chat. Long-term memory is the facts about a user that should show up in every chat.
This post adds that second part to an AI SDK app with MemorySync's AI SDK integration, memorysync-ai-sdk . MemorySync is a hosted memory layer, and I'm building it. The AI SDK behaviour comes from the official Language Model Middleware and Chatbot Message Persistence docs. Everything about MemorySync comes from its Vercel AI SDK Memory guide . The code is adapted from those docs.…