FAQs - Mem0

How does Mem0 work?

Mem0 utilizes a sophisticated hybrid database system to efficiently manage and retrieve memories for AI agents and assistants. Each memory is linked to a unique identifier, such as a user ID or agent ID, enabling Mem0 to organize and access memories tailored to specific individuals or contexts. When a message is added to Mem0 via the add method, the system extracts pertinent facts and preferences, distributing them in a managed vector store. This strategy ensures that diverse types of information are stored optimally, facilitating swift and effective searches. When an AI agent or LLM needs to access memories, it employs the search method. Mem0 conducts a comprehensive search across these data stores, retrieving relevant information from each. The retrieved memories can be seamlessly integrated into the system prompt as required, enhancing the personalization and relevance of responses.

What are the key features of Mem0?

How is Mem0 different from traditional RAG?

Mem0’s memory implementation for Large Language Models (LLMs) offers several advantages over Retrieval-Augmented Generation (RAG):

These advanced memory capabilities make Mem0 a powerful tool for developers aiming to create personalized and context-aware AI applications.

What are the common use-cases of Mem0?

Why aren't my memories being created?

Mem0 uses a sophisticated classification system to determine which parts of text should be extracted as memories. Not all text content will generate memories, as the system is designed to identify specific types of memorable information. There are several scenarios where Mem0 may return an empty list of memories:

Example Scenarios

Input: "What is machine learning?"
No memories extracted - Content is definitional and does not meet memory classification criteria.

Input: "Yesterday I learned about machine learning in class"
Memory extracted - Contains personal experience and temporal context.

Best Practices

To ensure successful memory extraction:

How do I configure Mem0 for AWS Lambda?

When deploying Mem0 on AWS Lambda, you’ll need to modify the storage directory configuration due to Lambda’s file system restrictions. By default, Lambda only allows writing to the /tmp directory. To configure Mem0 for AWS Lambda, set the MEM0_DIR environment variable to point to a writable directory in /tmp:

MEM0_DIR=/tmp/.mem0

If you’re not using environment variables, you’ll need to modify the storage path in your code:

# Change from
home_dir = os.path.expanduser("~")
mem0_dir = os.environ.get("MEM0_DIR") or os.path.join(home_dir, ".mem0")

# To
mem0_dir = os.environ.get("MEM0_DIR", "/tmp/.mem0")

Note that the /tmp directory in Lambda has a size limit of 512MB and its contents are not persistent between function invocations.

How can I use metadata with Mem0?

Metadata is the recommended approach for incorporating additional information with Mem0. You can store any type of structured data as metadata during the add method, such as location, timestamp, weather conditions, user state, or application context. This enriches your memories with valuable contextual information that can be used for more precise retrieval and filtering. During retrieval, you have two main approaches for using metadata:

  1. Pre-filtering: Include metadata parameters in your initial search query to narrow down the memory pool.
  2. Post-processing: Retrieve a broader set of memories based on query, then apply metadata filters to refine the results.

Examples of useful metadata you might store:

This flexibility allows you to create highly contextually aware AI applications that can adapt to specific user needs and situations. Metadata provides an additional dimension for memory retrieval, enabling more precise and relevant responses.

How do I disable telemetry in Mem0?

To disable telemetry in Mem0, you can set the MEM0_TELEMETRY environment variable to False:

MEM0_TELEMETRY=False

You can also disable telemetry programmatically in your code:

import os
os.environ["MEM0_TELEMETRY"] = "False"

Setting this environment variable will prevent Mem0 from collecting and sending any usage data, ensuring complete privacy for your application.

How do I delete my Mem0 account?

You can delete your Mem0 account at any time directly from the dashboard:

  1. Sign in at app.mem0.ai.
  2. Go to Settings → Account.
  3. Click Delete account and confirm.

Deletion is immediate and irreversible. The following is removed:

Any application still using your old API keys will start receiving 401 Unauthorized responses immediately. If you’d like to use Mem0 again later, you can create a new account at any time: it will start fresh with no data carried over.