Mem0 (pronounced "mem-zero") is an open-source project providing an intelligent memory layer for AI assistants and agents, enabling personalized AI interaction experiences. It remembers user preferences, adapts to individual needs, and continuously learns and improves over time, making it ideal for customer support chatbots, AI assistants, and autonomous systems.
Project Address: https://github.com/mem0ai/mem0
Mem0's memory layer combines Large Language Models (LLMs) with vector-based storage technology, providing efficient memory storage and retrieval mechanisms.
Python Installation:
pip install mem0ai
Node.js Installation:
npm install mem0ai
from openai import OpenAI
from mem0 import Memory
openai_client = OpenAI()
memory = Memory()
def chat_with_memories(message: str, user_id: str = "default_user") -> str:
# Retrieve relevant memories
relevant_memories = memory.search(query=message, user_id=user_id, limit=3)
memories_str = "\n".join(f"- {entry['memory']}" for entry in relevant_memories["results"])
# Generate assistant response
system_prompt = f"You are a helpful AI. Answer the question based on query and memories.\nUser Memories:\n{memories_str}"
messages = [{"role": "system", "content": system_prompt}, {"role": "user", "content": message}]
response = openai_client.chat.completions.create(model="gpt-4o-mini", messages=messages)
assistant_response = response.choices[0].message.content
# Create new memory from the conversation
messages.append({"role": "assistant", "content": assistant_response})
memory.add(messages, user_id=user_id)
return assistant_response
def main():
print("Chat with AI (type 'exit' to quit)")
while True:
user_input = input("You: ").strip()
if user_input.lower() == 'exit':
print("Goodbye!")
break
print(f"AI: {chat_with_memories(user_input)}")
if __name__ == "__main__":
main()
Mem0 supports various Large Language Models, defaulting to OpenAI's gpt-4o-mini
. The project provides detailed Supported LLMs documentation.
Self-hosted deployment with full control using the open-source package, suitable for enterprise users requiring customized configurations.
Personalized AI chat application that remembers user preferences, facts, and memories.
Experience personalized conversational AI that remembers user preferences and past interactions.
Chrome extension for storing memories across ChatGPT, Perplexity, and Claude.
Intelligent customer support system built using Langgraph and Mem0.
Use with CrewAI for personalized AI collaboration results.
Mem0 is a revolutionary AI memory system, providing developers with powerful tools to build truly intelligent, personalized AI applications. Through its multi-layered memory architecture and easy-to-use API, developers can easily create AI systems that learn, remember, and adapt to user needs. Whether in customer service, education, healthcare, or entertainment, Mem0 can significantly enhance user experience and the practicality of AI systems.