Getting Started
Core Features
How-To Guides
Configuration
Troubleshooting
Integrations
Mem0 ("mem-zero") provides an intelligent memory layer designed to enhance AI assistants and agents. It allows your AI applications to remember user preferences, adapt to individual needs, and continuously learn over time. This leads to more personalized and context-rich interactions, making AI systems more effective for tasks like customer support, personal assistants, and adaptive gaming environments.
This memory layer helps your AI maintain context across conversations and sessions, ensuring that interactions feel natural and informed by past exchanges. It manages different levels of memory, including user-specific information, session-specific details, and overall agent knowledge, to provide a seamless and personalized experience.
You can get started with Mem0 either through its hosted platform for a managed experience or by self-hosting the open-source SDK.
Select whether you want to use the managed hosted platform or install the open-source SDK locally.
Mem0 can be integrated with various tools and frameworks to enhance your AI applications:
For more detailed information, advanced configurations, and troubleshooting, refer to the official resources:
This example demonstrates how to initialize Mem0 and integrate it into a simple chat application using Python. This setup allows your AI to retrieve relevant past memories and create new ones from ongoing conversations.
Mem0 requires an underlying Large Language Model (LLM) to function. The default LLM is gpt-4.1-nano-2025-04-14 from OpenAI. You can configure Mem0 to work with various other LLMs; refer to the official documentation for a list of Supported LLMs.
from openai import OpenAI
from mem0 import Memory
# Initialize your OpenAI client
openai_client = OpenAI()
# Instantiate the Mem0 Memory layer
memory = Memory()
def chat_with_memories(message: str, user_id: str = "default_user") -> str:
# 1. Retrieve relevant memories for the current message and user
relevant_memories = memory.search(query=message, user_id=user_id, limit=3
The user_id parameter is crucial for personalizing interactions. It allows Mem0 to associate memories with a specific user, ensuring that each user receives tailored responses based on their unique history. In the example, "default_user" is used, but in a real application, you would replace this with a unique identifier for each of your users.
To run the example above:
chat_app.py).OpenAI() client.python chat_app.pyexit to quit.