Compare commits

...

4 Commits

Author SHA1 Message Date
kartik-mem0 a4633aa065 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
2026-06-26 16:48:19 +05:30
kartik-mem0 711f866e59 docs(api-reference): use literal em-dash instead of \u2014 escape in openapi.json 2026-06-26 16:03:50 +05:30
kartik-mem0 46757cb1fb docs(api-reference): document project.update() retrieval_criteria and decay params 2026-06-25 14:02:51 +05:30
kartik-mem0 bbfe0f9bb2 docs(api-reference): align API docs and openapi schema with v3 spec
- create-memory-export.mdx: replace `session_id` filter with `app_id`
  (spec: /v1/exports/ filters = user_id, agent_id, app_id, run_id)
- get-memory-export.mdx: replace stale filter list (session_id removed)
  with correct fields: user_id, agent_id, app_id, run_id, created_at, updated_at
- search-memories.mdx: fix comparison table — rerank V1/V2 default was
  `true`, spec shows `false`; threshold V1 is absent (not "No default"),
  V2 default is 0.3 (not absent)
- organizations-projects.mdx: rewrite Key Capabilities bullet — org/project
  are NOT init params; they resolve automatically from the API key via /v1/ping/
- openapi.json DELETE /v1/batch/: fix request schema from {memory_ids:[uuid]}
  to {memories:[{memory_id:uuid}]} to match Python client.batch_delete()
- openapi.json PUT /v1/batch/: make `text` optional (remove from required),
  add optional `metadata` property — matches Python client.batch_update() docstring
2026-06-25 12:01:24 +05:30
5 changed files with 69 additions and 17 deletions
@@ -4,4 +4,4 @@ description: "Submit an export job to create a structured memory export using a
openapi: post /v1/exports/
---
Submit a job to create a structured export of memories using a customizable Pydantic schema. This process may take some time to complete, especially if you're exporting a large number of memories. You can tailor the export by applying various filters (e.g., `user_id`, `agent_id`, `run_id`, or `session_id`) and by modifying the Pydantic schema to ensure the final data matches your exact needs.
Submit a job to create a structured export of memories using a customizable Pydantic schema. This process may take some time to complete, especially if you're exporting a large number of memories. You can tailor the export by applying various filters (e.g., `user_id`, `agent_id`, `app_id`, or `run_id`) and by modifying the Pydantic schema to ensure the final data matches your exact needs.
@@ -4,4 +4,4 @@ description: "Retrieve the latest structured memory export after submitting an e
openapi: post /v1/exports/get
---
Retrieve the latest structured memory export after submitting an export job. You can filter the export by `user_id`, `run_id`, `session_id`, or `app_id` to get the most recent export matching your filters.
Retrieve the latest structured memory export after submitting an export job. You can filter the export by `user_id`, `agent_id`, `app_id`, `run_id`, `created_at`, or `updated_at` to get the most recent export matching your filters.
@@ -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` | No default | Default `0.1` (pass `0.0` to disable) |
| `rerank` | Default `true` | 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) |
<CodeGroup>
```python Platform API Example
+41 -2
View File
@@ -14,7 +14,7 @@ Organizations and projects are **optional** features. You can use Mem0 without t
## Key Capabilities
- **Multi-org/project Support**: Specify organization and project when initializing the Mem0 client to attribute API usage appropriately
- **Multi-org/project Support**: Organization and project are resolved automatically from your API key via `/v1/ping/` — no org or project params are accepted by `MemoryClient.__init__`. Use a project-specific API key to target a particular project.
- **Member Management**: Control access to data through organization and project membership
- **Access Control**: Only members can access memories and data within their organization/project scope
- **Team Isolation**: Maintain data separation between different teams and projects for secure collaboration
@@ -79,7 +79,7 @@ new_project = client.project.create(
### Update Project Settings
Modify project configuration including custom instructions, categories, and language preferences:
Modify project configuration including custom instructions, categories, language preferences, retrieval criteria, and memory decay:
```python
# Update project with custom categories
@@ -98,6 +98,17 @@ client.project.update(
# Use the input language for memory storage and retrieval
client.project.update(multilingual=True)
# Set retrieval criteria to control which memories are surfaced in search
client.project.update(
retrieval_criteria=[
{"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}
]
)
# Enable Memory Decay (boosts recently-accessed memories at search time)
client.project.update(decay=True)
# Update multiple settings at once
client.project.update(
custom_instructions="...",
@@ -109,6 +120,34 @@ 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 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=[
{
"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
}
]
)
```
Pass an empty list to clear all criteria and restore default retrieval behaviour.
#### Toggle Memory Decay
`decay` is a per-project boolean that turns on [Memory Decay](/platform/features/memory-decay) — a search-time ranking bias that reinforces recently-accessed memories and gently dampens stale ones. The flag is `false` by default; set it via the same project-update endpoint:
+21 -8
View File
@@ -4861,8 +4861,7 @@
"items": {
"type": "object",
"required": [
"memory_id",
"text"
"memory_id"
],
"properties": {
"memory_id": {
@@ -4873,6 +4872,11 @@
"text": {
"type": "string",
"description": "The new text content for the memory"
},
"metadata": {
"type": "object",
"additionalProperties": true,
"description": "Updated metadata to associate with the memory."
}
}
},
@@ -4948,18 +4952,27 @@
"schema": {
"type": "object",
"properties": {
"memory_ids": {
"memories": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
"type": "object",
"properties": {
"memory_id": {
"type": "string",
"format": "uuid",
"description": "The unique identifier of the memory to delete."
}
},
"required": [
"memory_id"
]
},
"maxItems": 1000,
"description": "Array of memory IDs to delete."
"description": "Array of memory objects to delete."
}
},
"required": [
"memory_ids"
"memories"
]
}
}
@@ -6256,4 +6269,4 @@
}
},
"x-original-swagger-version": "2.0"
}
}