docs(api-reference): align API docs & openapi.json with v3 spec (#5848)
This commit is contained in:
@@ -4,4 +4,4 @@ description: "Submit an export job to create a structured memory export using a
|
|||||||
openapi: post /v1/exports/
|
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
|
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.
|
||||||
@@ -24,11 +24,11 @@ The `filters` object supports complex logical operations (AND, OR, NOT) and comp
|
|||||||
|
|
||||||
### Search parameter defaults
|
### Search parameter defaults
|
||||||
|
|
||||||
| Parameter | V1/V2 | V3 |
|
| Parameter | Default |
|
||||||
| --- | --- | --- |
|
| --- | --- |
|
||||||
| `top_k` | Supported (default 10) | Supported (1-1000, default 10) |
|
| `top_k` | `10` (range 1–1000) |
|
||||||
| `threshold` | No default | Default `0.1` (pass `0.0` to disable) |
|
| `threshold` | `0.1` (pass `0.0` to disable) |
|
||||||
| `rerank` | Default `true` | Default `false` (pass `true` to enable) |
|
| `rerank` | `false` (pass `true` to enable) |
|
||||||
|
|
||||||
<CodeGroup>
|
<CodeGroup>
|
||||||
```python Platform API Example
|
```python Platform API Example
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Organizations and projects are **optional** features. You can use Mem0 without t
|
|||||||
|
|
||||||
## Key Capabilities
|
## 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
|
- **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
|
- **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
|
- **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
|
### 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
|
```python
|
||||||
# Update project with custom categories
|
# Update project with custom categories
|
||||||
@@ -98,6 +98,17 @@ client.project.update(
|
|||||||
# Use the input language for memory storage and retrieval
|
# Use the input language for memory storage and retrieval
|
||||||
client.project.update(multilingual=True)
|
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
|
# Update multiple settings at once
|
||||||
client.project.update(
|
client.project.update(
|
||||||
custom_instructions="...",
|
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
|
#### 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:
|
`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:
|
||||||
|
|||||||
+20
-7
@@ -4883,8 +4883,7 @@
|
|||||||
"items": {
|
"items": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"memory_id",
|
"memory_id"
|
||||||
"text"
|
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"memory_id": {
|
"memory_id": {
|
||||||
@@ -4895,6 +4894,11 @@
|
|||||||
"text": {
|
"text": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The new text content for the memory"
|
"description": "The new text content for the memory"
|
||||||
|
},
|
||||||
|
"metadata": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": true,
|
||||||
|
"description": "Updated metadata to associate with the memory."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -4970,18 +4974,27 @@
|
|||||||
"schema": {
|
"schema": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"memory_ids": {
|
"memories": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string",
|
"type": "object",
|
||||||
"format": "uuid"
|
"properties": {
|
||||||
|
"memory_id": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "uuid",
|
||||||
|
"description": "The unique identifier of the memory to delete."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"memory_id"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"maxItems": 1000,
|
"maxItems": 1000,
|
||||||
"description": "Array of memory IDs to delete."
|
"description": "Array of memory objects to delete."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
"memory_ids"
|
"memories"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user