mem0ai/mem0

Universal memory layer for AI Agents

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 39 minutes ago
Added to GitGenius on August 4th, 2025
Created on June 20th, 2023
Open Issues & Pull Requests: 684 (+0)
Number of forks: 7,475
Total Stargazers: 63,939 (+3)
Total Subscribers: 242 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 40.9 hours
Mean response time: 64.8 days
90th percentile: 251.5 days
Tracked items: 1,722

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 100% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Work labelled "vector-store" is answered fastest, typically in about 28 hours, while "enhancement" waits about 6 days. Almost all tracked open issues have seen activity in the last three months. Only 8% of issues opened in the past year have been closed.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 260
New in 7 days: 21
Closed in 7 days: 17
Avg open age: 29 days
Stale 30+ days: 121
Stale 90+ days: 2

Recent activity

Opened in 7 days: 17
Closed in 7 days: 16
Comments in 7 days: 42
Events in 7 days: 117

Top labels

  • bug (413)
  • enhancement (262)
  • sdk-python (249)
  • stale (166)
  • P2-medium (150)
  • P1-high (119)
  • vector-store (106)
  • sdk-typescript (83)

Detailed Description

Mem0 is an open-source project aiming to build a self-improving, long-term memory layer for Large Language Models (LLMs). It addresses a core limitation of current LLMs: their inability to retain and effectively utilize information from past interactions beyond the context window. Unlike traditional retrieval-augmented generation (RAG) systems which rely on external databases and keyword searches, Mem0 integrates memory *within* the LLM's processing flow, creating a continuously evolving internal knowledge base. The core idea is to allow the LLM to "remember" and refine its understanding over time, leading to more consistent, personalized, and knowledgeable responses.

At its heart, Mem0 utilizes a novel approach called "Memory Modules." These modules aren't simply stored embeddings; they are self-contained units of knowledge, each consisting of a text snippet (the memory itself), a relevance score, and a timestamp. Crucially, these modules are *dynamically* updated and refined by the LLM itself. When a new input is received, the LLM doesn't just generate a response; it also evaluates whether the input contains information that should be stored as a new memory module, or if existing modules need to be updated or consolidated. This self-reflection and refinement process is what distinguishes Mem0 from static RAG systems. The relevance score is key, determining how strongly a memory module influences future responses.

The repository provides a comprehensive framework for building and deploying Mem0-enhanced LLMs. It includes implementations for various memory management strategies, such as recency-based forgetting (older memories decay in relevance), importance-based retention (significant memories are prioritized), and similarity-based consolidation (similar memories are merged to avoid redundancy). The project supports integration with popular LLM providers like OpenAI, Cohere, and open-source models through Hugging Face Transformers. Furthermore, it offers tools for visualizing the memory modules, analyzing their content, and monitoring the system's performance. A key component is the `Mem0Agent`, which orchestrates the interaction between the LLM, the memory modules, and the user input.

The repository's code is structured around several key modules. `mem0.core` contains the fundamental data structures and algorithms for managing memory modules. `mem0.memory` defines different memory storage backends (currently in-memory and ChromaDB, with plans for others). `mem0.agent` implements the agent logic for interacting with the LLM and memory. `mem0.utils` provides helper functions for tasks like embedding generation and text processing. The project also includes extensive documentation, examples, and tests to facilitate development and experimentation. The focus is on modularity and extensibility, allowing developers to customize the memory management strategies and integrate Mem0 into a wide range of applications.

Currently, the project is actively under development, with ongoing efforts to improve memory efficiency, scalability, and the sophistication of the self-reflection mechanisms. Future directions include exploring more advanced memory consolidation techniques, incorporating external knowledge sources, and developing tools for debugging and analyzing memory-related issues. Mem0 represents a promising step towards building LLMs that can truly learn and adapt over time, moving beyond the limitations of fixed context windows and static knowledge bases. It's a valuable resource for researchers and developers interested in exploring the frontiers of long-term memory in LLMs.