Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsMar 28, 2026·2 min de lectura

Mem0 — Long-Term Memory Layer for AI Agents

Add persistent memory to AI agents and assistants. Remembers user preferences, context, and past interactions across sessions.

Introducción

Mem0 is a memory layer for AI applications. It remembers user preferences, past interactions, and context across sessions — so your AI assistant doesn't start from scratch every conversation. Multi-level memory (user, session, agent state), 26% more accurate than OpenAI's built-in memory, 91% faster, and 90% fewer tokens than full-context approaches. 51,000+ GitHub stars, Y Combinator S24.


Key Features

  • Multi-level memory: User preferences, session context, agent state
  • Adaptive learning: Continuously improves from interactions
  • Cross-platform SDKs: Python (pip install mem0ai) and Node.js (npm install mem0ai)
  • Self-hosted or managed: Full control locally, or use the hosted platform
  • LLM-agnostic: Works with OpenAI, Anthropic, and other providers

Full Example: Chat with 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 = memory.search(query=message, user_id=user_id, limit=3)
    memories_str = "\
".join(f"- {m['memory']}" for m in relevant["results"])

    # Build prompt with memory context
    system = f"You are a helpful AI. Use these memories:\
{memories_str}"
    messages = [
        {"role": "system", "content": system},
        {"role": "user", "content": message}
    ]

    # Generate response
    response = openai_client.chat.completions.create(
        model="gpt-4.1-nano-2025-04-14",
        messages=messages
    )
    reply = response.choices[0].message.content

    # Save new memories from conversation
    messages.append({"role": "assistant", "content": reply})
    memory.add(messages, user_id=user_id)

    return reply

# Usage
chat_with_memories("I'm a Python developer who loves FastAPI")
chat_with_memories("What framework should I use for my next API?")
# → Mem0 remembers you prefer FastAPI

Use Cases

  • AI Assistants: Consistent, personalized conversations across sessions
  • Customer Support: Remember past tickets, preferences, account history
  • Healthcare: Track patient preferences and interaction history
  • Productivity: Personal AI that knows your workflows and tools
  • Gaming: NPCs that remember player choices and adapt

Integrations

  • ChatGPT browser extension (adds memory to ChatGPT, Perplexity, Claude)
  • LangGraph for building memory-enhanced agents
  • CrewAI for multi-agent systems with shared memory

FAQ

Q: What is Mem0? A: Add persistent memory to AI agents and assistants. Remembers user preferences, context, and past interactions across sessions.

Q: How do I install Mem0? A: Check the Quick Use section above for step-by-step installation instructions. Most assets can be set up in under 2 minutes.

🙏

Fuente y agradecimientos

Created by Taranjeet Singh / mem0ai. Licensed under Apache 2.0. mem0 — ⭐ 51,300+ Docs: docs.mem0.ai

Thanks to the Mem0 team (YC S24) for building the most popular open-source memory layer for AI.

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados