Skip to content

Migration Guides Fresh

Open Source to Platform

Migrate from self-hosted Mem0 to managed Mem0 Platform.

Benefits

  • Setup: 5 minutes vs 30+ for OSS configuration
  • Compliance: SOC2 Type II, GDPR, audit logs
  • Features: Webhooks, memory export, analytics, custom categories
  • Infrastructure: Auto-scaling, high availability, zero maintenance

Steps

1. Prepare

  • Create account at Mem0 Platform
  • Generate API key from Settings > API Keys

2. Update SDK

bash
pip install mem0ai --upgrade

3. Replace Initialization

python
# Before (OSS)
from mem0.memory.main import Memory
m = Memory.from_config(config)

# After (Platform)
from mem0 import MemoryClient
client = MemoryClient(api_key="m0-...")

4. Update API Calls

OperationOld (OSS)New (Platform)
Searchm.search(query, user_id="x")client.search(query, filters={"user_id": "x"})
Get Allm.get_all(user_id="x")client.get_all(filters={"user_id": "x"})
Addm.add(memory, user_id="x")No change
Deletem.delete(memory_id)No change

Rollback

Revert by switching imports back to Memory class and restoring local configuration.


v0.x to v1.0.0

Major release with breaking changes.

Breaking Changes

ChangeImpact
API Versionv1.0 removed; v1.1+ required
Async ModePlatform Client defaults to True
Response FormatAlways returns dict with "results" key
version ParameterRemoved from method calls
Config VersionMust specify v1.1 or higher

Migration Steps

1. Update Package

bash
pip install --upgrade mem0ai

2. Remove Deprecated Parameters

Remove version="v1.0" from all Memory.add() calls and config objects.

3. Standardize Response Handling

python
# Before
result = client.search(query, user_id="alice")
# result could be list or dict

# After
result = client.search(query, user_id="alice")
memories = result["results"]  # Always dict with "results" key

4. Update Filters (Optional)

Use new {"AND": [...]} syntax for enhanced filtering.

5. Handle Async Mode

MemoryClient.add() now uses async_mode=True by default.

Rollback

bash
pip install mem0ai==0.1.20

API Changes Reference

Response Format

All endpoints now return:

json
{
  "results": [...],
  "total": 42
}

Filter Syntax

V2 filters use nested logical operators:

python
{
    "AND": [
        {"user_id": "alice"},
        {"created_at": {"gte": "2024-01-01"}}
    ]
}

SOP Documentation Site for Mem0