Universal memory layer for AI Agents https://mem0.ai
Find a file
2025-12-13 14:00:29 +05:30
.github Added support for python 3.12 (#3295) 2025-08-12 15:01:41 -05:00
cookbooks Formatting (#2750) 2025-05-22 01:17:29 +05:30
docs [docs] Filters fix in docs (#3815) 2025-12-11 18:38:08 +05:30
embedchain Fix: Add Google Genai library support (#2941) 2025-06-17 17:47:09 +05:30
evaluation Fix: Changed keyword from assisstant to secretary (#2937) 2025-07-08 10:57:25 +05:30
examples Add Strands agent (with AWS ElastiCache and Neptune) example mention in Joint blog post by Mem0 and AWS (#3824) 2025-12-13 14:00:29 +05:30
mem0 Updates to python sdk (#3749) 2025-11-13 14:22:39 -08:00
mem0-ts Fix embedder config schema to support embeddingDims and url parameters (#3633) 2025-10-21 09:30:44 -07:00
openmemory feat(api): add vector store configuration endpoints (#3583) 2025-10-23 18:36:25 +05:30
server [Update] Default LLM (#3587) 2025-10-15 11:19:52 -07:00
tests [fix] list' object has no attribute 'id' - Id fault with chroma pinecone and other providers (#3693) 2025-10-31 16:46:10 +05:30
vercel-ai-sdk (fix): added version=v2 as default param in ai sdk add calls (#3540) 2025-10-05 02:16:02 +05:30
.gitignore Added Mem0 TS Library (#2270) 2025-02-27 15:19:17 -08:00
.pre-commit-config.yaml Code Formatting (#1828) 2024-09-07 22:39:28 +05:30
CONTRIBUTING.md Added support for python 3.12 (#3295) 2025-08-12 15:01:41 -05:00
LICENSE Add: Licence (#1605) 2024-07-30 07:43:29 +05:30
LLM.md [Update] Default LLM (#3587) 2025-10-15 11:19:52 -07:00
Makefile feat(vector-store): Add Valkey vector store support (#3272) 2025-09-10 04:01:53 +05:30
MIGRATION_GUIDE_v1.0.md Mem0 1.0.0 (#3545) 2025-10-16 15:50:20 +05:30
poetry.lock Fix CI issues related to missing dependency (#3096) 2025-07-03 18:52:50 -07:00
pyproject.toml Updates to python sdk (#3749) 2025-11-13 14:22:39 -08:00
README.md Mem0 1.0.0 (#3545) 2025-10-16 15:50:20 +05:30

Mem0 - The Memory Layer for Personalized AI

mem0ai%2Fmem0 | Trendshift

Learn more · Join Discord · Demo · OpenMemory

Mem0 Discord Mem0 PyPI - Downloads GitHub commit activity Package version Npm package Y Combinator S24

📄 Building Production-Ready AI Agents with Scalable Long-Term Memory →

+26% Accuracy vs. OpenAI Memory • 🚀 91% Faster • 💰 90% Fewer Tokens

🎉 mem0ai v1.0.0 is now available! This major release includes API modernization, improved vector store support, and enhanced GCP integration. See migration guide →

🔥 Research Highlights

  • +26% Accuracy over OpenAI Memory on the LOCOMO benchmark
  • 91% Faster Responses than full-context, ensuring low-latency at scale
  • 90% Lower Token Usage than full-context, cutting costs without compromise
  • Read the full paper

Introduction

Mem0 ("mem-zero") enhances AI assistants and agents with an intelligent memory layer, enabling personalized AI interactions. It remembers user preferences, adapts to individual needs, and continuously learns over time—ideal for customer support chatbots, AI assistants, and autonomous systems.

Key Features & Use Cases

Core Capabilities:

  • Multi-Level Memory: Seamlessly retains User, Session, and Agent state with adaptive personalization
  • Developer-Friendly: Intuitive API, cross-platform SDKs, and a fully managed service option

Applications:

  • AI Assistants: Consistent, context-rich conversations
  • Customer Support: Recall past tickets and user history for tailored help
  • Healthcare: Track patient preferences and history for personalized care
  • Productivity & Gaming: Adaptive workflows and environments based on user behavior

🚀 Quickstart Guide

Choose between our hosted platform or self-hosted package:

Hosted Platform

Get up and running in minutes with automatic updates, analytics, and enterprise security.

  1. Sign up on Mem0 Platform
  2. Embed the memory layer via SDK or API keys

Self-Hosted (Open Source)

Install the sdk via pip:

pip install mem0ai

Install sdk via npm:

npm install mem0ai

Basic Usage

Mem0 requires an LLM to function, with `gpt-4.1-nano-2025-04-14 from OpenAI as the default. However, it supports a variety of LLMs; for details, refer to our Supported LLMs documentation.

First step is to instantiate the memory:

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-4.1-nano-2025-04-14", messages=messages)
    assistant_response = response.choices[0].message.content

    # Create new memories 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()

For detailed integration steps, see the Quickstart and API Reference.

🔗 Integrations & Demos

  • ChatGPT with Memory: Personalized chat powered by Mem0 (Live Demo)
  • Browser Extension: Store memories across ChatGPT, Perplexity, and Claude (Chrome Extension)
  • Langgraph Support: Build a customer bot with Langgraph + Mem0 (Guide)
  • CrewAI Integration: Tailor CrewAI outputs with Mem0 (Example)

📚 Documentation & Support

Citation

We now have a paper you can cite:

@article{mem0,
  title={Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memory},
  author={Chhikara, Prateek and Khant, Dev and Aryan, Saket and Singh, Taranjeet and Yadav, Deshraj},
  journal={arXiv preprint arXiv:2504.19413},
  year={2025}
}

⚖️ License

Apache 2.0 — see the LICENSE file for details.