Skip to content

Platform Quickstart

Fresh

Set up a Mem0 Platform account and store your first memory in under 5 minutes.

Prerequisites

  • Active Mem0 Platform account (sign up free)
  • API key from dashboard settings
  • Python 3.10+ or Node.js 14+

Step 1: Install the SDK

bash
pip install mem0ai
bash
npm install mem0ai

Step 2: Initialize the Client

python
from mem0 import MemoryClient

client = MemoryClient(api_key="your-api-key")
javascript
import MemoryClient from 'mem0ai';

const client = new MemoryClient({ apiKey: 'your-api-key' });
bash
export MEM0_API_KEY="your-api-key"
bash
mem0 init --api-key "your-api-key"

Step 3: Add a Memory

python
messages = [
    {"role": "user", "content": "I'm planning a trip to Tokyo next month."},
    {"role": "assistant", "content": "Great! I'll remember that for future suggestions."}
]

result = client.add(messages, user_id="alice")
print(result)
javascript
const messages = [
  { role: "user", content: "I'm planning a trip to Tokyo next month." },
  { role: "assistant", content: "Great! I'll remember that for future suggestions." }
];

const result = await client.add(messages, {
  user_id: "alice",
  version: "v2",
});
console.log(result);

Step 4: Search Memories

python
results = client.search("What do you know about me?",
    filters={"user_id": "alice"})
print(results)
javascript
const results = await client.search("What do you know about me?", {
    filters: { AND: [{ user_id: "alice" }] }
});
console.log(results);

Sample Response

json
{
  "results": [
    {
      "id": "mem_123abc",
      "memory": "Planning a trip to Tokyo next month.",
      "user_id": "alice",
      "categories": ["travel"],
      "created_at": "2025-10-22T04:40:22.864647-07:00",
      "score": 0.89
    }
  ]
}

What Just Happened?

  1. Messages were analyzed -- Mem0's LLM extracted the key fact ("planning trip to Tokyo")
  2. Memory was created -- The fact was stored as a vector embedding with metadata
  3. Category was assigned -- "travel" was automatically applied
  4. Search worked -- Semantic search found the relevant memory

Next Steps

SOP Documentation Site for Mem0