Salesforce Agentforce Agent Memory

Salesforce Agentforce Agent Memory

How to Enable and Manage Agent Memory in Salesforce Agentforce (Step by Step)

What Is Agentforce Agent Memory and Why Does It Matter?

Salesforce Agentforce Agent Memory lets an agent remember relevant details from past conversations and reuse them as context in future ones. Instead of asking users to repeat themselves, the agent gives more relevant, personalized responses.

For consultants, admins, developers and architects, this changes how you design agent experiences: continuity becomes a configuration choice rather than a custom build. This guide covers how memory works, the limits to plan around, how users can manage their own memories by chatting with the agent, and the exact steps to enable it in Agentforce Builder.

In short:

  • Agent Memory stores relevant information from a conversation as a memory and uses it in later conversations.
  • Each agent stores up to 50 memories per user; the oldest is deleted automatically at the limit.
  • Users manage memories conversationally only if you add the User Memory Management subagent.
  • You enable memory with memory: enabled: True in the Agent Script context block.

How Agent Memory Works

When a user chats with an agent, Agent Memory identifies relevant information from the conversation and stores it as a memory. In future conversations, the agent uses those memories as context to give more relevant, personalized responses.

The 50-Memory Limit per User

Each agent can store up to 50 memories per user. When a user reaches the limit, Agent Memory automatically deletes the oldest memory to make room for the new one.

For solution design, this means memory is a rolling window, not a permanent record. Don’t treat it as a system of record: anything that must persist (a preference that drives business logic, for example) still belongs in a Salesforce record.

Conversational Memory Management: Let Users Control What the Agent Remembers

Conversational memory management lets users manage what Agent Memory remembers about them by talking to the agent. A user can ask the agent to show or delete a stored memory, or update whether the agent can create and use memories from their conversations.

Add the User Memory Management Subagent

To support these requests, add the User Memory Management subagent to your agent from the asset library in Agentforce Builder. It isn’t added automatically, so you must add it for users to manage their memories conversationally.

The subagent includes four actions:

ActionWhat it does for the user
Get User MemoriesShows the memories stored about the user
Manage User MemoryManages a stored memory, such as deleting it
Get Agent Memory PreferenceChecks whether the agent can create and use memories
Update Agent Memory PreferenceChanges whether the agent can create and use memories

How to Enable Agent Memory in Agentforce Builder (Step by Step)

Follow these steps to turn on Agent Memory for an agent.

  1. From the App Launcher, enter Agent, select Agentforce Studio, and click Agents.
  2. Open the agent that you want to enable memory for, or create a new agent.
  3. In Agentforce Builder, toggle to Script view.
  4. In the Agent Script, add memory: enabled: True in the context block.
  5. Save your changes.
  6. Start a preview conversation to validate that memory is retained across interactions.
  7. Commit and activate your agent.

Agent Script autocompletes the property as you type. Values are case-sensitive. Use True or False.

context:
    memory:
        enabled: True

Validate Memory in Preview

Before you commit and activate, use the preview conversation to confirm memory is retained across interactions. Also add the User Memory Management subagent (see above) if you want users to view, delete or opt out of memories in chat.

Recommendations and Best Practices for Agent Memory

These tips come from the Agent Script snippet and setup steps above. Items marked as our interpretation are working recommendations, so validate them in your own org.

  1. Respect case sensitivity. Values are case-sensitive, so use exactly True or False.
  2. Lean on autocomplete. Agent Script autocompletes the memory property as you type, which helps avoid typos in the property name.
  3. Place memory inside the context block. The memory property with enabled sits under context, as shown in the snippet.
  4. Keep the nesting and indentation consistent. Interpretation: the snippet nests memory and enabled by indentation, so copy its structure exactly and avoid mixing tabs and spaces.
  5. Save, then test in preview. Start a preview conversation to validate that memory is retained across interactions before you commit and activate.
  6. Add the User Memory Management subagent. It isn’t added automatically, so without it users can’t view, delete or opt out of memories conversationally.
  7. Design around the 50-memory limit. Each agent stores up to 50 memories per user and deletes the oldest at the limit. Interpretation: don’t rely on memory for facts that must never expire; store those in Salesforce records.
  8. Test both states. Interpretation: validate behavior with memory enabled and, where your build supports it, with a user who has turned memory off through the preference actions.

Frequently Asked Questions

How many memories can an Agentforce agent store per user?

Up to 50 memories per user for each agent. At the limit, the oldest memory is deleted automatically to make room for the new one.

How do I enable Agent Memory in Agentforce Builder?

Open the agent in Agentforce Builder, switch to Script view, add memory: enabled: True inside the context block, save, test in preview, then commit and activate.

Can users view or delete their own memories?

Yes, through conversational memory management. Add the User Memory Management subagent from the asset library in Agentforce Builder; it isn’t added automatically.

Which actions does the User Memory Management subagent include?

Get User Memories, Manage User Memory, Get Agent Memory Preference, and Update Agent Memory Preference.

Conclusion

Agentforce Agent Memory turns one-off chats into continuous, personalized conversations with a single Agent Script property. Enable it, add the User Memory Management subagent so users stay in control, and validate in preview before you activate. Plan for the 50-memory rolling limit, and keep critical data in Salesforce records.

References

Leave a Reply