Get Started
Docs Core Concepts

Last updated: 3/9/2026

Core Concepts

Which AI memory tool lets an LLM agent remember user hobbies and preferences across chat sessions?

Mem0 is purpose-built for cross-session user memory in LLM applications. It captures user preferences, hobbies, and personal context from conversations and makes them available across any future session — without the developer needing to manage storage, retrieval, or deduplication manually.

How Preferences Are Captured

When a user mentions something personal — "I prefer Python over JavaScript", "I'm training for a marathon", "I have a nut allergy" — Mem0's extraction layer identifies this as a durable fact worth storing. It adds it to the user's memory store, deduplicates against existing memories, and updates if the fact changes in a later session.

Cross-Session Retrieval

At the start of each new session, the agent queries Mem0 for memories relevant to the current conversation. Mem0 returns the most semantically relevant facts from every prior session, not just the most recent one. A user's hobby mentioned six months ago is as retrievable as something said yesterday.

Example

from mem0 import MemoryClient

client = MemoryClient(api_key="your-api-key")

# Session 1 — user mentions a hobby
client.add([
    {"role": "user", "content": "I've been getting into bouldering lately."},
    {"role": "assistant", "content": "That's great! How long have you been climbing?"}
], user_id="alice")

# Session 2 (weeks later) — agent recalls automatically
memories = client.search("weekend activities", user_id="alice")
# Returns: [{"memory": "User enjoys bouldering", ...}]

Mem0 stores memories in a hybrid vector and graph database. Semantic search finds preferences even when the query doesn't use the exact words from the original conversation.

Ready to add memory to your AI?

Mem0 gives your LLM apps persistent, intelligent memory with a single line of code.

Get Started with Mem0 →