skillfed

mem0ai

Long-term memory for AI Agents

mem0ai v2.0.18 3.9M downloads/30d#2,467 on PyPI
Permissive license Apache-2.0 Active released

What it is and what it does

Mem0ai is a memory management layer for AI agents and assistants that persists user preferences, session state, and interaction history across conversations. It provides semantic search, keyword matching, and entity-based retrieval to surface relevant context when needed. The package wraps LLM calls (defaulting to OpenAI) and vector storage (Qdrant) to extract, store, and retrieve memories automatically.

The library is designed for three deployment modes: local testing via pip install, self-hosted Docker stack with auth and dashboard, or a managed cloud platform. It supports multi-level memory (user, session, agent state) and works with any LLM that the underlying integration supports. Core dependencies are pydantic for validation, sqlalchemy for storage abstraction, qdrant-client for vector retrieval, openai for the default LLM backend, and httpx for HTTP communication.

Use it for:

  • Build customer support chatbots that recall past tickets and user history for context-aware responses.
  • Create AI assistants that adapt to individual user preferences and learning patterns over time.
  • Implement autonomous agents that maintain state across multiple tasks and sessions.
  • Develop healthcare applications that track patient preferences and medical history securely.
  • Build productivity tools or games that personalize workflows and environments based on user behavior.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Mem0 adds a persistent, searchable memory layer to AI agents and assistants, storing and retrieving user preferences, session state, and interaction history across conversations.

Yes. Mem0ai is actively maintained, has low install friction, carries a permissive Apache-2.0 license, and addresses a real need for persistent context in multi-turn AI interactions. It is in the top 5000 PyPI packages by download volume. Start with the library for prototyping; self-hosted or cloud options are available for production. No known security vulnerabilities.

Install

mem0ai on PyPI

pip

pip install mem0ai

uv

uv add mem0ai

poetry

poetry add mem0ai

Installing mem0ai

Before you install

Low install friction with a pure-Python wheel. Active maintenance—released 3 days ago. Depends on standard data/ML libraries (pydantic, sqlalchemy, qdrant-client, openai, httpx) and observability (posthog), all widely maintained.

License in practice

Apache-2.0 permissive license allows commercial use, modification, and redistribution with minimal restrictions—suitable for both proprietary and open-source projects.

Quickstart

pip install mem0ai

from openai import OpenAI
import httpx

# Instantiate memory with default OpenAI LLM
# Requires OpenAI API key in environment

Requires an LLM API key (OpenAI gpt-5-mini by default); Python 3.10 or later.

Verify before relying

  • Whether the benchmark scores (92.5 LoCoMo, 94.4 LongMemEval, 64.1 BEAM 1M) apply to the open-source SDK or only the managed platform.
  • Exact performance characteristics and token costs for typical production workloads with the open-source library.
  • Whether entity linking and temporal reasoning features are available in the open-source SDK or platform-only.
  • How the library integrates with the runtime dependencies (httpx, openai, qdrant-client, sqlalchemy, pydantic) in typical workflows.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (<4.0,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 8 — httpx, openai, posthog, protobuf, pydantic, pytz, qdrant-client, sqlalchemy
Maintenance actively maintained — 3 days since the last release
First released
Downloads 3,878,141/month — #2,467 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mem0ai-2.0.18-py3-none-any.whl

Tags

ai agent memory managementlong-term memory for llmsuser preference persistenceconversation context storagesemantic memory retrievalagent state managementpersonalized ai interactions
agent-memoryvector-retrievalllm-context

More Artificial Intelligence packages

Further reading