From a4633aa0652df142bfb9e07e184d7506547e0805 Mon Sep 17 00:00:00 2001 From: kartik-mem0 Date: Fri, 26 Jun 2026 16:48:19 +0530 Subject: [PATCH] docs(api-reference): address reviewer comments on search defaults table and retrieval_criteria shape - search-memories.mdx: collapse V1/V2/V3 comparison table to a single "Default" column showing current (v3) values only (threshold 0.1, rerank false, top_k 10) - organizations-projects.mdx: replace bogus {role, content} retrieval_criteria examples with the correct {name, description, weight} shape, mirroring the canonical criteria-retrieval.mdx examples; update prose to name the three required fields --- docs/api-reference/memory/search-memories.mdx | 10 ++++---- docs/api-reference/organizations-projects.mdx | 23 +++++++++++++++---- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/docs/api-reference/memory/search-memories.mdx b/docs/api-reference/memory/search-memories.mdx index 8afae23ec..f89b9b909 100644 --- a/docs/api-reference/memory/search-memories.mdx +++ b/docs/api-reference/memory/search-memories.mdx @@ -20,11 +20,11 @@ The `filters` object supports complex logical operations (AND, OR, NOT) and comp ### Search parameter defaults -| Parameter | V1/V2 | V3 | -| --- | --- | --- | -| `top_k` | Supported (default 10) | Supported (1-1000, default 10) | -| `threshold` | V1: not supported / V2: default `0.3` | Default `0.1` (pass `0.0` to disable) | -| `rerank` | Default `false` | Default `false` (pass `true` to enable) | +| Parameter | Default | +| --- | --- | +| `top_k` | `10` (range 1–1000) | +| `threshold` | `0.1` (pass `0.0` to disable) | +| `rerank` | `false` (pass `true` to enable) | ```python Platform API Example diff --git a/docs/api-reference/organizations-projects.mdx b/docs/api-reference/organizations-projects.mdx index 6da59ae7a..3731be514 100644 --- a/docs/api-reference/organizations-projects.mdx +++ b/docs/api-reference/organizations-projects.mdx @@ -101,8 +101,8 @@ client.project.update(multilingual=True) # Set retrieval criteria to control which memories are surfaced in search client.project.update( retrieval_criteria=[ - {"role": "user", "content": "Only retrieve memories relevant to the current topic"}, - {"role": "assistant", "content": "Prioritize recent and frequently accessed memories"} + {"name": "relevance", "description": "How directly relevant this memory is to the current topic or user query", "weight": 3}, + {"name": "access_frequency", "description": "How often this memory has been accessed or surfaced recently", "weight": 1} ] ) @@ -122,13 +122,26 @@ client.project.update( #### Set Retrieval Criteria -`retrieval_criteria` is a per-project list of dictionaries (`List[Dict]`) that shapes how memories are ranked and filtered during search. Each dictionary specifies a criterion that the retrieval engine applies when deciding which memories to surface. Use this to focus retrieval on topic-relevant or role-specific memories: +`retrieval_criteria` is a per-project list of dictionaries (`List[Dict]`) that shapes how memories are ranked and filtered during search. Each dictionary has three fields: `name` (identifier), `description` (interpreted by the LLM to score each memory), and `weight` (relative influence on the final score). Use this to focus retrieval on intent-aligned or signal-specific memories: ```python client.project.update( retrieval_criteria=[ - {"role": "user", "content": "Only retrieve memories directly relevant to the user's current query"}, - {"role": "assistant", "content": "Prefer memories that have been accessed recently"} + { + "name": "joy", + "description": "Measure the intensity of positive emotions such as happiness, excitement, or amusement expressed in the memory. A higher score reflects greater joy.", + "weight": 3 + }, + { + "name": "curiosity", + "description": "Assess the extent to which the memory reflects inquisitiveness or interest in exploring new information. A higher score reflects stronger curiosity.", + "weight": 2 + }, + { + "name": "access_frequency", + "description": "How often this memory has been accessed or surfaced recently.", + "weight": 1 + } ] ) ```