Conversation Variables: How to Make the Agent Remember Steps and Preferences
Conversation variables in Agentforce are the mechanism that turns a dialogue into a controlled process instead of a series of disconnected messages. Without them, an agent can sound intelligent but behave like a beginner: it repeats the
same questions, loses earlier decisions, forgets the user’s preferred language, and jumps between options without continuity. Conversation variables solve this by giving the agent a working memory that exists for exactly as long as the current
conversation session lasts.
The core definition is simple. Conversation variables are unique to the agent, and their values live only within the current conversation session. They are not a database and they are not long-term storage. They represent the temporary
state of the interaction. When the session ends, the values disappear. This is precisely why they are so useful for anything that matters “right now” in the chat, such as user preferences, confirmed details, intermediate conclusions, and step-by-step
progress.
Agentforce includes some conversation variables out of the box, meaning there are ready-to-use variables available by default. In addition, you can create custom conversation variables to match your specific business flow. This matters
because different organizations, and even different support teams inside the same organization, follow different troubleshooting patterns, different service scripts, and different compliance requirements. Custom conversation variables let you capture that
logic as structured state instead of relying on the language model to remember everything implicitly.
A practical example is a variable called TroubleshootingSteps that stores a list of troubleshooting actions already completed. In real customer support, this is critical. A good troubleshooting flow typically involves a sequence of checks,
such as verifying symptoms, confirming product version, restarting, checking configuration, validating network conditions, or confirming permissions. If the agent does not track what has already happened, it tends to loop, repeat advice, and frustrate the
user. If the agent stores completed steps in TroubleshootingSteps, it behaves like an experienced specialist. It can say, in effect, “We have already done these checks, so the next logical step is this one.” This also brings discipline to the interaction,
because the agent follows a coherent sequence rather than improvising randomly.
Conversation variables become especially valuable when the user changes topics mid-chat. This is normal human behavior. A user might be discussing a technical issue and then suddenly ask about billing, delivery, refunds, or a different
product. If the agent resets every time the topic shifts, the experience feels unreliable. Conversation variables prevent that by preserving key preferences and requirements throughout the session.
Consider a simple but common scenario. The user starts the chat in a specific language and asks for short, direct answers. Then the user switches to a completely different question. The correct behavior is for the agent to keep the chosen
language, the expected tone, and any other requirements consistent across the entire session, even if the topic changes. This is what good memory should look like: language preference, response format, confirmation style, and communication constraints
should remain stable while the conversation remains open. The user experiences the agent as one competent operator who stays aligned, not as a system that keeps forgetting its own context.
It is important to understand that conversation variables do not replace context variables. They complement them. Context variables are read-only, trusted values coming from the platform and channel environment. Conversation variables
represent what the agent learns or establishes during the current interaction. In a well-governed design, context variables define safe boundaries, while conversation variables provide continuity and efficiency inside those boundaries.
In practice, conversation variables deliver several benefits at once. They reduce repeated questions because the agent can reuse confirmed information. They support step-by-step workflows and prevent circular troubleshooting. They provide
a controlled form of memory that can be used consistently in instructions, in action inputs, and in decision logic across the session.
And this leads naturally to the next topic. Once you understand how to preserve memory inside a session, you usually realize you need variables that reflect your unique business process and data model. That is where custom variables become
essential. In the next step, we will look at how to create custom variables, how to choose the right data type, and which settings matter so the agent can use them reliably for action inputs, output mapping, and predictable decision-making.