Mem0 Cloud Memory
The Mem0 Cloud Memory component acts as a bridge between your automation workflows and the external Mem0 Cloud service. It allows you to save and recall important context, user preferences, and conversation history in the cloud rather than keeping them only in your current session.
This is essential for building AI assistants that “remember” things across different sessions or users. For example, if a user tells their bot their name in one conversation, this component ensures the bot remembers that name in future interactions by storing it in the cloud.
How it Works
This component integrates directly with the Mem0 Cloud API. It does not process data locally on your device but sends and receives information via the internet to/from Mem0’s servers.
When you configure this component, you are essentially giving Nappai access to a shared cloud notebook.
- Storage: You can send data (memories) to the cloud to be saved for future reference.
- Retrieval: You can ask the component to search the cloud for relevant information based on a specific query.
The component handles the technical connection to Mem0’s servers using the credentials you provide. It organizes data by User ID or Session ID, ensuring that data from one user does not mix with data from another.
Connection & Credentials
This component requires configuring a credential in the Nappai panel before interacting with the external service:
- Go to the Credentials section in your Nappai panel.
- Create a new credential of the type Mem0 API Key. You will need your API key from https://app.mem0.ai.
- In your workflow, select the saved credential in the Credential input field of this node.
Inputs
The following fields are available to configure this component. Each field may be visible in different operations:
- Host: The URL for the Mem0 Cloud service. Leave this blank unless you are using a specific custom endpoint.
- Organization Name: Your organization identifier within Mem0 Cloud. This helps separate your data from other organizations.
- Project Name: A name to organize your memories within your organization.
- Memory Retrieval Limit: The maximum number of relevant memories you want to retrieve at one time. Setting a higher number may result in more detailed but potentially slower responses.
- Session ID: A unique identifier for the current user or session. This ensures that memories are saved and retrieved for the correct person.
Outputs
This component produces structured data that can be used by other components in your workflow, such as an AI Generator.
Output Data Example (JSON)
The component returns a Memory object containing the retrieved information.
json
{
“memory”: [
{
“id”: “mem_12345”,
“value”: “User prefers coffee with oat milk”,
“metadata”: {
“source”: “conversation”,
“user_id”: “user_abc”
},
“created_at”: “2023-10-27T10:00:00Z”
}
]
}
Note: The Memory output contains a list of found memories. You can map this to an AI prompt to give the assistant context.
Connectivity
This component is typically used in the middle of a workflow.
- Connects to: It is often placed after a Data Collector or Input Component (to save new memories) and before an AI Generator or LLM Component (to retrieve past context).
- Logical Flow: User Input → Save Memory (Cloud) → AI Process (with retrieved Memory) → Response.
Usage Example
Scenario: You are building a customer support bot that remembers customer preferences.
- Configuration: You add the Mem0 Cloud Memory component to your flow. You select your Mem0 API Key credential. You enter the Session ID linked to the current chat user.
- Saving Memory: When a user says “I am allergic to peanuts,” you map this text to the component to save it to the cloud.
- Retrieving Memory: When the user asks “What can I order?”, you set the Query to “order restrictions” or leave it blank to retrieve all relevant memories.
- Result: The component returns the memory about the peanut allergy. You send this memory to an AI component, which then generates a response suggesting safe food options, explicitly avoiding peanuts.
Tips and Best Practices
- Always use Session IDs: Ensure every user has a unique Session ID. If you use the same ID for everyone, all users will share the same memories, which is a privacy risk.
- Keep Retrieval Limits Moderate: If you set the Memory Retrieval Limit too high, you might overload the AI with too much information. Start with a low number (e.g., 3-5) and adjust as needed.
- Cloud vs. Local: Use this component when you need “long-term” memory that persists across different sessions. If you only need memory for the current conversation, a local memory component might be faster and cheaper.
Security Considerations
- API Key Protection: Never share your Mem0 API Key. Keep it secure in the Nappai Credentials section.
- Data Isolation: By using unique Session IDs and Organization Names, you ensure that one customer’s private data is never exposed to another customer.
- Development Mode: This component is currently in a Development state. Behavior may change, so it is recommended for testing and staging environments rather than critical production use until stable.