Add Persistent Memory to an Agent
Give your Agent long-term memory across conversations through Mem0.
About This Task
You can add memory to your Agent through Mem0. Mem0 Memory tools give your Agent long-term memory across conversations. Adding them creates two tools: one for storing memories (store_memory) and one for retrieving them (retrieve_memories). Both tools are scoped to individual users through a user_id that the platform injects automatically from the Agent's state.
For an explanation of how Mem0 Memory tools work, see Mem0 Memory.
You need a Mem0 API key to use Mem0 Memory tools. When you add the tools, the key is stored as a workspace secret. You can reuse an existing secret if you've already added a Mem0 API key to your workspace.
- In the Tools section of the Agent configuration panel, click Add Tool.
- Choose Mem0 Memory.
- In the API Key field, choose an existing Mem0 API key secret from the list, or type a new key to save it as a secret.
- Optionally, adjust the store memory tool settings:
- Tool name: The name the Agent uses to identify and call the store memory tool. Defaults to
store_memory. - Description: Explains to the Agent when to use this tool. Keep it clear and specific.
- Tool name: The name the Agent uses to identify and call the store memory tool. Defaults to
- Optionally, adjust the retrieve memories tool settings:
- Tool name: The name the Agent uses to identify and call the retrieve memories tool. Defaults to
retrieve_memories. - Description: Explains to the Agent when to use this tool. Keep it clear and specific.
- Top K: The maximum number of memories to return per retrieval call. Defaults to
5.
- Tool name: The name the Agent uses to identify and call the retrieve memories tool. Defaults to
- Click Add Mem0 Memory Tools.
The platform adds both tools to the Agent and automatically updates the Agent's state_schema to include a user_id field. This scopes each user's memories separately.
To change the tool settings after adding them, click Manage Tool next to the Mem0 Memory entry in the Tools section.
Related Information
Was this page helpful?