> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maximem.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate from Mem0 to Synap

> Looking for a Mem0 alternative? Map Mem0's user-scoped memory bag onto Synap: concept mapping, SDK call equivalents, and a backfill snippet for a clean cutover.

You're using Mem0 and want to evaluate or move to Synap. This page covers how Mem0 stores memory, how its concepts map onto Synap, and how to backfill your existing data.

<Note>
  This page is the Mem0-specific mapping. For the method every migration shares — scope mapping, configuring your instance, pilot, verify, cut over — see [How migration works](/migrations/how-it-works).
</Note>

## How Mem0 stores memory

Mem0 has a single user-scoped memory bag accessed via `m.add()`, `m.search()`, `m.get_all()`. Memories are untyped strings. Multi-user is `user_id`; multi-tenant is not first-class.

## The mapping

| Mem0 concept                           | Synap concept                                                                                                                                                                                    |
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `user_id`                              | `user_id`                                                                                                                                                                                        |
| No customer/org concept                | Add `customer_id` if you have multi-tenant; otherwise pass a stable sentinel like your app name                                                                                                  |
| `m.add(messages, user_id=...)`         | `sdk.memories.create(document=..., document_type="ai-chat-conversation", user_id=..., customer_id=...)`                                                                                          |
| `m.search(query, user_id=...)`         | `sdk.user.context.fetch(user_id=..., customer_id=..., search_query=[query])`                                                                                                                     |
| `m.get_all(user_id=...)`               | No exact equivalent: Synap doesn't expose a "list all raw memories" method. Use multiple targeted `search_query` calls with `sdk.user.context.fetch()` to retrieve the slices you actually need. |
| Memory deletion: `m.delete(memory_id)` | `await sdk.memories.delete(memory_id)`                                                                                                                                                           |

## Backfill from Mem0

```python theme={null}
from mem0 import Memory
from dateutil.parser import parse
from maximem_synap import MaximemSynapSDK
from maximem_synap.memories.models import CreateMemoryRequest

old = Memory()   # Mem0
new = MaximemSynapSDK()
await new.initialize()

async def migrate_one_user(user_id: str, customer_id: str = "my_app"):
    mem0_memories = old.get_all(user_id=user_id)["memories"]

    batch = [
        CreateMemoryRequest(
            document=m["memory"],
            document_type="document",      # Mem0 doesn't store conversation framing
            user_id=user_id,
            customer_id=customer_id,
            document_created_at=parse(m["created_at"]) if m.get("created_at") else None,
            mode="long-range",
            metadata={
                "source": "mem0_backfill",
                "mem0_id": m["id"],
            },
        )
        for m in mem0_memories
    ]
    await new.memories.batch_create(documents=batch, fail_fast=False)
```

<Note>
  Mem0 stores only pre-extracted memory strings, not the original conversations, so this backfill ingests those strings directly. Where you still have the source conversations, ingest those instead — Synap re-extracts natively and produces richer, typed memories than re-processing a summary can. See [why re-extraction matters](/migrations/how-it-works#5-backfill).
</Note>

## What you gain immediately

* Typed extractions (facts vs preferences vs episodes vs emotions vs temporal events).
* Customer / client / user scopes, not just user.
* Entity resolution across conversations.
* Context compaction.

## What you'll need to adapt

Mem0's "search returns a flat list of strings" pattern becomes "fetch returns a `ContextResponse` with typed lists." Your prompt-construction code needs to iterate over `ctx.facts`, `ctx.preferences`, `ctx.episodes` etc. instead of one flat list — usually a few-line change. See [Response shapes](/sdk/response-shapes).

## Next

Follow the shared [migration method](/migrations/how-it-works) to pilot one user, verify scope isolation, swap your retrieval call sites, and cut over.
