- For AI agents: mint a Mem0 API key in under five seconds — no email, no dashboard. Four commands to your first memory. + For AI agents: mint a Mem0 API key in under five seconds: no email, no dashboard. Four commands to your first memory.
diff --git a/docs/migration/oss-v2-to-v3.mdx b/docs/migration/oss-v2-to-v3.mdx index 6086c466d..a1649fe72 100644 --- a/docs/migration/oss-v2-to-v3.mdx +++ b/docs/migration/oss-v2-to-v3.mdx @@ -17,7 +17,7 @@ The new Mem0 release redesigns both extraction and retrieval, and cleans up the - **Retrieval**: Multi-signal hybrid search (semantic + BM25 keyword + entity matching) - **Entity linking**: Automatic entity extraction and cross-memory linking - **SDK cleanup**: Deprecated parameters removed, naming conventions standardized -- **API surface aligned with Platform**: Entity IDs now follow the same convention across OSS and Platform — top-level kwargs for `add()` / `delete_all()`, inside `filters` for `search()` / `get_all()` +- **API surface aligned with Platform**: Entity IDs now follow the same convention across OSS and Platform: top-level kwargs for `add()` / `delete_all()`, inside `filters` for `search()` / `get_all()` These changes produce a **+20 point improvement on LoCoMo** (71.4 → 91.6) and **+26 point improvement on LongMemEval** (67.8 → 93.4), while cutting extraction latency roughly in half. @@ -27,13 +27,13 @@ These changes produce a **+20 point improvement on LoCoMo** (71.4 → 91.6) and | Change | Old | New | Migration | |---|---|---|---| -| `search()` / `get_all()` entity IDs | Top-level kwargs (`user_id="..."`) | Inside `filters` dict | `m.search("q", filters={"user_id": "..."})` — top-level kwargs now raise `ValueError` | +| `search()` / `get_all()` entity IDs | Top-level kwargs (`user_id="..."`) | Inside `filters` dict | `m.search("q", filters={"user_id": "..."})`: top-level kwargs now raise `ValueError` | | `top_k` default | `100` | `20` | Pass `top_k=100` explicitly to restore | | `threshold` default | `None` (no filtering) | `0.1` (filters low-relevance) | Pass `threshold=0.0` for old behavior | | `threshold` validation | Any float | Must be in `[0, 1]` | Out-of-range values now raise `ValueError` | | `rerank` default | `True` | `False` | Pass `rerank=True` to restore | | Entity ID validation | Accepted any string | Trimmed; empty / whitespace-only rejected (`ValueError`) | Pass a non-empty identifier without internal spaces | -| `messages` in `add()` | Could be `None` | Must be `str` / `dict` / `list[dict]` — other types raise `Mem0ValidationError` (code `VALIDATION_003`) | Always pass a string, dict, or list of messages | +| `messages` in `add()` | Could be `None` | Must be `str` / `dict` / `list[dict]`: other types raise `Mem0ValidationError` (code `VALIDATION_003`) | Always pass a string, dict, or list of messages | | `add()` events | Returns `ADD`, `UPDATE`, `DELETE` | Returns `ADD` only | Update code expecting UPDATE/DELETE | | Custom extraction prompt | `custom_fact_extraction_prompt` | `custom_instructions` | Rename in config | | Custom update prompt | `custom_update_memory_prompt` | Deprecated | Use `custom_instructions` instead | @@ -50,8 +50,8 @@ These changes produce a **+20 point improvement on LoCoMo** (71.4 → 91.6) and | `search()` / `getAll()` entity IDs | Top-level options (`userId: "..."`) | Inside `filters` object | `m.search("q", { filters: { userId: "..." } })` | | `threshold` validation | Any number | Must be in `[0, 1]` | Out-of-range values now throw | | Entity ID validation | Any string | Trimmed; empty / whitespace-only rejected | Pass non-empty identifiers without internal spaces | -| `messages` in `add()` | Could be `null` / `undefined` | Required — throws on null/undefined | Always pass a string or array | -| Payload key for lemmatized text | `text_lemmatized` (snake_case) | `textLemmatized` (camelCase) | TS-only internal field. If you share a vector store collection between Python and TS SDKs, lemma-based BM25 will not resolve across languages — keep collections language-scoped. | +| `messages` in `add()` | Could be `null` / `undefined` | Required: throws on null/undefined | Always pass a string or array | +| Payload key for lemmatized text | `text_lemmatized` (snake_case) | `textLemmatized` (camelCase) | TS-only internal field. If you share a vector store collection between Python and TS SDKs, lemma-based BM25 will not resolve across languages: keep collections language-scoped. | | Custom prompt | `customPrompt` | `customInstructions` | Rename in config | | Graph memory | `enableGraph` + `graphStore` in config | Removed | Graph store support has been removed entirely | | Default graph config | Neo4j default config applied | No default graph config | Graph store config is no longer used | @@ -62,7 +62,7 @@ These changes produce a **+20 point improvement on LoCoMo** (71.4 → 91.6) and |---|---|---|---| | Constructor | `MemoryClient(api_key, org_id, project_id)` | `MemoryClient(api_key)` | Remove `org_id`, `project_id` from constructor | | Method options | `client.add(messages, **kwargs)` | `client.add(messages, options=AddMemoryOptions(...))` | Use typed option classes (or `**kwargs` still works) | -| Removed params | `api_version`, `output_format`, `async_mode`, `filter_memories`, `keyword_search`, `force_add_only`, `batch_size`, `immutable`, `includes`, `excludes`, `enable_graph`, `org_name`, `project_name` | — | Remove from all calls | +| Removed params | `api_version`, `output_format`, `async_mode`, `filter_memories`, `keyword_search`, `force_add_only`, `batch_size`, `immutable`, `includes`, `excludes`, `enable_graph`, `org_name`, `project_name` | N/A | Remove from all calls | ### TypeScript Client SDK @@ -70,7 +70,7 @@ These changes produce a **+20 point improvement on LoCoMo** (71.4 → 91.6) and |---|---|---|---| | Constructor | `new MemoryClient({ apiKey, organizationId, projectId })` | `new MemoryClient({ apiKey })` | Remove `organizationId`, `projectId`, `organizationName`, `projectName` | | All params | snake_case: `user_id`, `agent_id`, `top_k` | camelCase: `userId`, `agentId`, `topK` | Rename all params to camelCase | -| Removed params | `api_version`, `output_format`, `async_mode`, `enable_graph`, `org_id`, `project_id`, `org_name`, `project_name`, `filter_memories`, `batch_size`, `force_add_only`, `immutable`, `includes`, `excludes`, `keyword_search` | — | Remove from all calls | +| Removed params | `api_version`, `output_format`, `async_mode`, `enable_graph`, `org_id`, `project_id`, `org_name`, `project_name`, `filter_memories`, `batch_size`, `force_add_only`, `immutable`, `includes`, `excludes`, `keyword_search` | N/A | Remove from all calls | | Output format enum | `OutputFormat.V1`, `OutputFormat.V1_1` | Removed | v1.1 is now always used | | API version enum | `API_VERSION.V1`, `API_VERSION.V2` | Removed | Handled internally | @@ -108,7 +108,7 @@ The Python `[nlp]` extra installs [spaCy](https://spacy.io/) for entity extracti