diff --git a/docs/core-concepts/memory-operations/search.mdx b/docs/core-concepts/memory-operations/search.mdx index d964066ff..57f3f14e4 100644 --- a/docs/core-concepts/memory-operations/search.mdx +++ b/docs/core-concepts/memory-operations/search.mdx @@ -215,7 +215,7 @@ client.search("preferences", filters={ - **Use natural language**: Mem0 understands intent, so describe what you're looking for naturally - **Scope with user ID**: Always provide `user_id` to scope search to relevant memories - **Platform API**: Use `filters={"user_id": "alice"}` - - **OSS**: Use `filters={"user_id": "alice"}` + - **OSS**: Use `user_id="alice"` as parameter - **Combine filters**: Use AND/OR logic to create precise queries (Platform) - **Consider wildcard filters**: Use wildcard filters (e.g., `run_id: "*"`) for broader matches - **Tune parameters**: Adjust `top_k` for result count, `threshold` for relevance cutoff diff --git a/docs/migration/platform-v2-to-v3.mdx b/docs/migration/platform-v2-to-v3.mdx index dd3b93fa6..fa021aac2 100644 --- a/docs/migration/platform-v2-to-v3.mdx +++ b/docs/migration/platform-v2-to-v3.mdx @@ -42,7 +42,7 @@ Previously, when an agent said something like "I've booked your flight for March ### Retrieval is hybrid now -Search now uses hybrid retrieval, which improves ranking quality — especially for queries involving exact keywords, proper nouns, entities that appear across multiple memories, and time-aware queries. Existing code that reads `results[]` and the top-level `score` continues to work, but V3 can return additional top-level fields when the platform has more structured context available: +Search now uses hybrid retrieval, which improves ranking quality — especially for queries involving exact keywords, proper nouns, entities that appear across multiple memories, and time-aware queries (via Temporal Reasoning). The response shape is unchanged: ```json { @@ -51,11 +51,6 @@ Search now uses hybrid retrieval, which improves ranking quality — especially "id": "mem-uuid", "memory": "User moved to San Francisco in January 2026", "score": 0.82, - "score_breakdown": { - "semantic": 0.74, - "bm25": 0.68, - "entity": 0.12 - }, "metadata": {}, "categories": ["location"] } @@ -63,7 +58,7 @@ Search now uses hybrid retrieval, which improves ranking quality — especially } ``` -The top-level `score` remains a `[0, 1]` value. Relative ranking between results stays comparable to v2, but absolute numbers shift since the scoring method changed — retune any hard thresholds in your app against representative queries. Temporal signals are used internally for ranking and are not returned as extra client-facing data. +The top-level `score` remains a `[0, 1]` value. Relative ranking between results stays comparable to v2, but absolute numbers shift since the scoring method changed — retune any hard thresholds in your app against representative queries. Temporal signals are applied internally during ranking and are not returned as extra client-facing fields. ## API Changes @@ -169,11 +164,6 @@ Poll status via `GET /v1/event/{event_id}/` — status will be `SUCCEEDED` or `F "id": "mem-uuid", "memory": "User moved to San Francisco from New York in January 2026", "score": 0.82, - "score_breakdown": { - "semantic": 0.74, - "bm25": 0.68, - "entity": 0.12 - }, "metadata": {}, "categories": ["location"], "created_at": "2026-01-15T10:30:00Z", diff --git a/docs/platform/features/temporal-reasoning.mdx b/docs/platform/features/temporal-reasoning.mdx index 144f95044..9df007114 100644 --- a/docs/platform/features/temporal-reasoning.mdx +++ b/docs/platform/features/temporal-reasoning.mdx @@ -99,80 +99,6 @@ const results = await client.search("what did I do last week?", { `reference_date` is especially useful for tests and backfills because it makes relative phrases reproducible. -## See it in action - -### Add a few dated memories - - -```python Python -client.add( - [{"role": "user", "content": "I finished the Q1 product review on March 10, 2025."}], - user_id="jordan", -) - -client.add( - [{"role": "user", "content": "I have a dentist appointment on April 18, 2025 at 2 PM."}], - user_id="jordan", -) - -client.add( - [{"role": "user", "content": "I am the product lead at Acme Corp."}], - user_id="jordan", -) -``` - -```javascript JavaScript -await client.add( - [{ role: "user", content: "I finished the Q1 product review on March 10, 2025." }], - { userId: "jordan" } -); - -await client.add( - [{ role: "user", content: "I have a dentist appointment on April 18, 2025 at 2 PM." }], - { userId: "jordan" } -); - -await client.add( - [{ role: "user", content: "I am the product lead at Acme Corp." }], - { userId: "jordan" } -); -``` - - - - Platform writes are asynchronous. For quick validation, wait briefly before searching or verify the completed event in the dashboard or CLI. - - -### Search with a temporal query - - -```python Python -results = client.search( - "what did I do last week?", - filters={"user_id": "jordan"}, - reference_date="2025-03-21T00:00:00Z", -) - -for item in results["results"]: - print(item["memory"], item["score"]) -``` - -```javascript JavaScript -const results = await client.search("what did I do last week?", { - filters: { user_id: "jordan" }, - referenceDate: "2025-03-21T00:00:00Z", -}); - -results.results.forEach((item) => { - console.log(item.memory, item.score); -}); -``` - - - - Expected behavior: the March 10 review leads this result set, the April 18 appointment does not, and the ongoing role at Acme does not crowd out the dated answer. - - ## Supported query patterns