Intermediate9 min

Giving Your Chatbot Memory and Variables

A bot that forgets your name between messages feels broken. Memory is what makes a conversation feel like a conversation. In Voiceflow you store information in variables; an AI model holds short-term context within a turn. Combining both gives a bot that remembers who it is talking to and what they wanted.

Variables: the bot's notepad

Capture a value once (the user's name, their order number, their plan) into a variable, then reuse it anywhere later with curly-brace syntax. Variables persist across the whole conversation.

Voiceflow - using a variable
Agent
Before we start, what is your first name?
You
Priya
Agent
Thanks Priya! And what order number are you asking about?
You
A-4471
Agent
Got it Priya, looking up order A-4471 now.
Capture once, personalize everywhere after.

Conversation context for the model

When a turn calls a model, pass the recent exchange and the key variables into the prompt so its answer fits the conversation so far. You do not pass the entire history forever; you pass a rolling window plus the durable variables.

Confirm, then store
When you capture something important like an email or order number, repeat it back and ask the user to confirm before you act on it. Acting on a misheard value erodes trust faster than asking once.

Result: a bot that greets returning context naturally, references the order being discussed, and never asks the same question twice in one session.

Hands-on tasks