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 --upgrade3. 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
| Operation | Old (OSS) | New (Platform) |
|---|---|---|
| Search | m.search(query, user_id="x") | client.search(query, filters={"user_id": "x"}) |
| Get All | m.get_all(user_id="x") | client.get_all(filters={"user_id": "x"}) |
| Add | m.add(memory, user_id="x") | No change |
| Delete | m.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
| Change | Impact |
|---|---|
| API Version | v1.0 removed; v1.1+ required |
| Async Mode | Platform Client defaults to True |
| Response Format | Always returns dict with "results" key |
version Parameter | Removed from method calls |
| Config Version | Must specify v1.1 or higher |
Migration Steps
1. Update Package
bash
pip install --upgrade mem0ai2. 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" key4. 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.20API 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"}}
]
}