Agentic Memory¶
Endpoints for managing agentic memory spaces, sessions, and events.
List Memory Spaces¶
Operation path: GET /
List all Memory Spaces accessible by the authenticated user
- Returns offset/limit pagination with a total count.
- Soft-deleted spaces are excluded.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| offset | query | integer | false | Skip the specified number of values. |
| limit | query | integer | false | Retrieve only the specified number of values. |
Example responses¶
200 Response
{
"properties": {
"items": {
"description": "List of items for the current page",
"items": {
"description": "Response schema for a single Memory Space",
"properties": {
"createdAt": {
"description": "Memory space creation timestamp.",
"format": "date-time",
"title": "Createdat",
"type": "string"
},
"customInstructions": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Custom prompt instructions used for fact extraction. Null means the default mem0 extraction prompt is used.",
"title": "Custominstructions"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Memory space description.",
"title": "Description"
},
"llmModelName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "LLM model configured for memory extraction.",
"title": "Llmmodelname"
},
"memorySpaceId": {
"description": "Unique memory space identifier.",
"format": "uuid",
"title": "Memoryspaceid",
"type": "string"
},
"tenantId": {
"description": "Tenant identifier.",
"format": "uuid",
"title": "Tenantid",
"type": "string"
},
"userId": {
"description": "ID of the user who owns this memory space.",
"title": "Userid",
"type": "string"
}
},
"required": [
"memorySpaceId",
"userId",
"tenantId",
"createdAt"
],
"title": "MemorySpaceResponse",
"type": "object"
},
"maxItems": 100,
"title": "Items",
"type": "array"
},
"limit": {
"description": "Maximum number of returned items",
"exclusiveMinimum": 0,
"title": "Limit",
"type": "integer"
},
"offset": {
"description": "Number of skipped items",
"minimum": 0,
"title": "Offset",
"type": "integer"
},
"total": {
"description": "Total number of matching items",
"title": "Total",
"type": "integer"
}
},
"required": [
"items",
"offset",
"limit",
"total"
],
"title": "PaginatedResponse[MemorySpaceResponse]",
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | PaginatedResponse_MemorySpaceResponse_ |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Create Memory Space¶
Operation path: POST /new/
Create a new Memory Space
tenant_id is bound from the authenticated user's context; clients cannot set or override it.
Body parameter¶
{
"description": "Request body for creating a Memory Space",
"properties": {
"customInstructions": {
"anyOf": [
{
"maxLength": 10000,
"type": "string"
},
{
"type": "null"
}
],
"description": "Custom prompt instructions used for fact extraction Null leaves mem0 on its default extraction prompt.",
"title": "Custominstructions"
},
"description": {
"anyOf": [
{
"maxLength": 1000,
"type": "string"
},
{
"type": "null"
}
],
"description": "Optional description for the memory space.",
"title": "Description"
},
"llmModelName": {
"anyOf": [
{
"maxLength": 200,
"type": "string"
},
{
"type": "null"
}
],
"description": "Name of the LLM model to use for memory extraction.",
"title": "Llmmodelname"
}
},
"title": "CreateMemorySpaceRequest",
"type": "object"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | CreateMemorySpaceRequest | true | none |
Example responses¶
201 Response
{
"description": "Response schema for a single Memory Space",
"properties": {
"createdAt": {
"description": "Memory space creation timestamp.",
"format": "date-time",
"title": "Createdat",
"type": "string"
},
"customInstructions": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Custom prompt instructions used for fact extraction. Null means the default mem0 extraction prompt is used.",
"title": "Custominstructions"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Memory space description.",
"title": "Description"
},
"llmModelName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "LLM model configured for memory extraction.",
"title": "Llmmodelname"
},
"memorySpaceId": {
"description": "Unique memory space identifier.",
"format": "uuid",
"title": "Memoryspaceid",
"type": "string"
},
"tenantId": {
"description": "Tenant identifier.",
"format": "uuid",
"title": "Tenantid",
"type": "string"
},
"userId": {
"description": "ID of the user who owns this memory space.",
"title": "Userid",
"type": "string"
}
},
"required": [
"memorySpaceId",
"userId",
"tenantId",
"createdAt"
],
"title": "MemorySpaceResponse",
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | Successful Response | MemorySpaceResponse |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Delete Memory Space by memory_space_ ID¶
Operation path: DELETE /{memory_space_id}/
Delete a Memory Space
Returns 404 if already deleted or not accessible by the caller.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| memory_space_id | path | string | true | Memory Space ID |
Example responses¶
422 Response
{
"properties": {
"detail": {
"description": "List of validation errors.",
"items": {
"properties": {
"ctx": {
"description": "Additional context about the validation error.",
"title": "Context",
"type": "object"
},
"input": {
"additionalProperties": true,
"description": "The input value that caused the validation error.",
"title": "Input",
"type": "object"
},
"loc": {
"description": "The location in the request where the validation error occurred.",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"maxItems": 100,
"title": "Location",
"type": "array"
},
"msg": {
"description": "A human-readable description of the validation error.",
"title": "Message",
"type": "string"
},
"type": {
"description": "A machine-readable error type identifier.",
"title": "Error Type",
"type": "string"
}
},
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError",
"type": "object"
},
"maxItems": 100,
"title": "Detail",
"type": "array"
}
},
"title": "HTTPValidationError",
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | Successful Response | None |
| 404 | Not Found | Memory Space not found | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Get Memory Space by memory_space_ ID¶
Operation path: GET /{memory_space_id}/
Get a Memory Space by ID
Returns 404 if the space does not exist, is soft-deleted, or not accessible by a user.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| memory_space_id | path | string | true | Memory Space ID |
Example responses¶
200 Response
{
"description": "Response schema for a single Memory Space",
"properties": {
"createdAt": {
"description": "Memory space creation timestamp.",
"format": "date-time",
"title": "Createdat",
"type": "string"
},
"customInstructions": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Custom prompt instructions used for fact extraction. Null means the default mem0 extraction prompt is used.",
"title": "Custominstructions"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Memory space description.",
"title": "Description"
},
"llmModelName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "LLM model configured for memory extraction.",
"title": "Llmmodelname"
},
"memorySpaceId": {
"description": "Unique memory space identifier.",
"format": "uuid",
"title": "Memoryspaceid",
"type": "string"
},
"tenantId": {
"description": "Tenant identifier.",
"format": "uuid",
"title": "Tenantid",
"type": "string"
},
"userId": {
"description": "ID of the user who owns this memory space.",
"title": "Userid",
"type": "string"
}
},
"required": [
"memorySpaceId",
"userId",
"tenantId",
"createdAt"
],
"title": "MemorySpaceResponse",
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | MemorySpaceResponse |
| 404 | Not Found | Memory Space not found | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Update Memory Space by memory_space_ ID¶
Operation path: PATCH /{memory_space_id}/
Partially update a Memory Space.
Body parameter¶
{
"additionalProperties": false,
"description": "Request body for partially updating a Memory Space",
"properties": {
"customInstructions": {
"anyOf": [
{
"maxLength": 10000,
"type": "string"
},
{
"type": "null"
}
],
"description": "Updated custom prompt instructions used for fact extraction. Pass null to clear and revert to mem0's default extraction prompt.",
"title": "Custominstructions"
},
"description": {
"anyOf": [
{
"maxLength": 1000,
"type": "string"
},
{
"type": "null"
}
],
"description": "Updated description for the memory space.",
"title": "Description"
},
"llmModelName": {
"anyOf": [
{
"maxLength": 200,
"type": "string"
},
{
"type": "null"
}
],
"description": "Updated LLM model name.",
"title": "Llmmodelname"
}
},
"title": "UpdateMemorySpaceRequest",
"type": "object"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| memory_space_id | path | string | true | Memory Space ID |
| body | body | UpdateMemorySpaceRequest | true | none |
Example responses¶
200 Response
{
"description": "Response schema for a single Memory Space",
"properties": {
"createdAt": {
"description": "Memory space creation timestamp.",
"format": "date-time",
"title": "Createdat",
"type": "string"
},
"customInstructions": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Custom prompt instructions used for fact extraction. Null means the default mem0 extraction prompt is used.",
"title": "Custominstructions"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Memory space description.",
"title": "Description"
},
"llmModelName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "LLM model configured for memory extraction.",
"title": "Llmmodelname"
},
"memorySpaceId": {
"description": "Unique memory space identifier.",
"format": "uuid",
"title": "Memoryspaceid",
"type": "string"
},
"tenantId": {
"description": "Tenant identifier.",
"format": "uuid",
"title": "Tenantid",
"type": "string"
},
"userId": {
"description": "ID of the user who owns this memory space.",
"title": "Userid",
"type": "string"
}
},
"required": [
"memorySpaceId",
"userId",
"tenantId",
"createdAt"
],
"title": "MemorySpaceResponse",
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | MemorySpaceResponse |
| 404 | Not Found | Memory Space not found | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
List Sessions by memory_space_ ID¶
Operation path: GET /{memory_space_id}/sessions/
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| memory_space_id | path | string | true | Memory Space ID |
| offset | query | integer | false | Skip the specified number of values. |
| limit | query | integer | false | Retrieve only the specified number of values. |
| participants | query | any | false | Filter sessions by participant IDs (ObjectId format). |
| description | query | any | false | Filter sessions by description. |
Example responses¶
200 Response
{
"properties": {
"items": {
"description": "List of items for the current page",
"items": {
"description": "Schema for session response.",
"properties": {
"createdAt": {
"description": "Session creation timestamp.",
"format": "date-time",
"title": "Createdat",
"type": "string"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Session description.",
"title": "Description"
},
"id": {
"description": "Session ID.",
"format": "uuid",
"title": "Id",
"type": "string"
},
"lifecycleStrategies": {
"description": "Lifecycle strategies associated with this session.",
"items": {
"description": "Schema for lifecycle strategy in response.\n\nExecution status is tracked in the strategy_executions table and can be\nqueried separately if needed.",
"properties": {
"opts": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"description": "Strategy-specific configuration parameters.",
"title": "Opts"
},
"trigger": {
"anyOf": [
{
"additionalProperties": false,
"description": "Trigger based on time-to-live (session age).\n\nFires when the session age exceeds the configured TTL threshold.",
"properties": {
"ttl": {
"description": "Time-to-live in seconds",
"exclusiveMinimum": 0,
"maximum": 63072000,
"title": "Ttl",
"type": "integer"
}
},
"required": [
"ttl"
],
"title": "TTLTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on event count.\n\nFires when the session's event count reaches or exceeds the configured threshold.",
"properties": {
"eventCount": {
"description": "Event count threshold",
"exclusiveMinimum": 0,
"maximum": 1000000,
"title": "Eventcount",
"type": "integer"
}
},
"required": [
"eventCount"
],
"title": "EventCountTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on token count.\n\nFires when the session's total token count reaches or exceeds the configured threshold.\nTokens are calculated from event message content using tiktoken.",
"properties": {
"tokenCount": {
"description": "Token count threshold",
"exclusiveMinimum": 0,
"maximum": 100000000,
"title": "Tokencount",
"type": "integer"
}
},
"required": [
"tokenCount"
],
"title": "TokenCountTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on time since the last event in the session.\n\nFires when no new events were added to the session within the configured TTL.",
"properties": {
"idle": {
"description": "Time in seconds since last event",
"exclusiveMinimum": 0,
"maximum": 63072000,
"title": "Idle",
"type": "integer"
}
},
"required": [
"idle"
],
"title": "IdleTimeoutTrigger",
"type": "object"
}
],
"description": "Trigger condition.",
"title": "Trigger"
},
"type": {
"description": "Strategy type.",
"enum": [
"soft_delete",
"extract_memories"
],
"title": "Type",
"type": "string"
}
},
"required": [
"type",
"trigger"
],
"title": "LifecycleStrategyResponse",
"type": "object"
},
"maxItems": 5,
"title": "Lifecyclestrategies",
"type": "array"
},
"metadata": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"description": "Custom metadata as key-value pairs for storing application-specific data",
"title": "Metadata"
},
"participants": {
"description": "List of participant IDs.",
"items": {
"type": "string"
},
"maxItems": 1,
"title": "Participants",
"type": "array"
}
},
"required": [
"id",
"participants",
"createdAt"
],
"title": "SessionResponse",
"type": "object"
},
"maxItems": 100,
"title": "Items",
"type": "array"
},
"limit": {
"description": "Maximum number of returned items",
"exclusiveMinimum": 0,
"title": "Limit",
"type": "integer"
},
"offset": {
"description": "Number of skipped items",
"minimum": 0,
"title": "Offset",
"type": "integer"
},
"total": {
"description": "Total number of matching items",
"title": "Total",
"type": "integer"
}
},
"required": [
"items",
"offset",
"limit",
"total"
],
"title": "PaginatedResponse[SessionResponse]",
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | PaginatedResponse_SessionResponse_ |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Create Session by memory_space_ ID¶
Operation path: POST /{memory_space_id}/sessions/
Body parameter¶
{
"description": "Customer support conversation",
"lifecycleStrategies": [
{
"trigger": {
"ttl": 604800
},
"type": "soft_delete"
}
],
"metadata": {
"department": "sales",
"priority": "high",
"region": "us-east"
},
"participants": [
"507f1f77bcf86cd799439011"
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| memory_space_id | path | string | true | Memory Space ID |
| body | body | CreateSessionRequest | true | none |
Example responses¶
201 Response
{
"description": "Schema for session response.",
"properties": {
"createdAt": {
"description": "Session creation timestamp.",
"format": "date-time",
"title": "Createdat",
"type": "string"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Session description.",
"title": "Description"
},
"id": {
"description": "Session ID.",
"format": "uuid",
"title": "Id",
"type": "string"
},
"lifecycleStrategies": {
"description": "Lifecycle strategies associated with this session.",
"items": {
"description": "Schema for lifecycle strategy in response.\n\nExecution status is tracked in the strategy_executions table and can be\nqueried separately if needed.",
"properties": {
"opts": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"description": "Strategy-specific configuration parameters.",
"title": "Opts"
},
"trigger": {
"anyOf": [
{
"additionalProperties": false,
"description": "Trigger based on time-to-live (session age).\n\nFires when the session age exceeds the configured TTL threshold.",
"properties": {
"ttl": {
"description": "Time-to-live in seconds",
"exclusiveMinimum": 0,
"maximum": 63072000,
"title": "Ttl",
"type": "integer"
}
},
"required": [
"ttl"
],
"title": "TTLTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on event count.\n\nFires when the session's event count reaches or exceeds the configured threshold.",
"properties": {
"eventCount": {
"description": "Event count threshold",
"exclusiveMinimum": 0,
"maximum": 1000000,
"title": "Eventcount",
"type": "integer"
}
},
"required": [
"eventCount"
],
"title": "EventCountTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on token count.\n\nFires when the session's total token count reaches or exceeds the configured threshold.\nTokens are calculated from event message content using tiktoken.",
"properties": {
"tokenCount": {
"description": "Token count threshold",
"exclusiveMinimum": 0,
"maximum": 100000000,
"title": "Tokencount",
"type": "integer"
}
},
"required": [
"tokenCount"
],
"title": "TokenCountTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on time since the last event in the session.\n\nFires when no new events were added to the session within the configured TTL.",
"properties": {
"idle": {
"description": "Time in seconds since last event",
"exclusiveMinimum": 0,
"maximum": 63072000,
"title": "Idle",
"type": "integer"
}
},
"required": [
"idle"
],
"title": "IdleTimeoutTrigger",
"type": "object"
}
],
"description": "Trigger condition.",
"title": "Trigger"
},
"type": {
"description": "Strategy type.",
"enum": [
"soft_delete",
"extract_memories"
],
"title": "Type",
"type": "string"
}
},
"required": [
"type",
"trigger"
],
"title": "LifecycleStrategyResponse",
"type": "object"
},
"maxItems": 5,
"title": "Lifecyclestrategies",
"type": "array"
},
"metadata": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"description": "Custom metadata as key-value pairs for storing application-specific data",
"title": "Metadata"
},
"participants": {
"description": "List of participant IDs.",
"items": {
"type": "string"
},
"maxItems": 1,
"title": "Participants",
"type": "array"
}
},
"required": [
"id",
"participants",
"createdAt"
],
"title": "SessionResponse",
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | Successful Response | SessionResponse |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Delete Session by memory_space_ ID¶
Operation path: DELETE /{memory_space_id}/sessions/{session_id}/
Delete a session.
Performs a soft-delete by setting the deleted_at timestamp.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| session_id | path | string(uuid) | true | Session ID |
| memory_space_id | path | string | true | Memory Space ID |
Example responses¶
422 Response
{
"properties": {
"detail": {
"description": "List of validation errors.",
"items": {
"properties": {
"ctx": {
"description": "Additional context about the validation error.",
"title": "Context",
"type": "object"
},
"input": {
"additionalProperties": true,
"description": "The input value that caused the validation error.",
"title": "Input",
"type": "object"
},
"loc": {
"description": "The location in the request where the validation error occurred.",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"maxItems": 100,
"title": "Location",
"type": "array"
},
"msg": {
"description": "A human-readable description of the validation error.",
"title": "Message",
"type": "string"
},
"type": {
"description": "A machine-readable error type identifier.",
"title": "Error Type",
"type": "string"
}
},
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError",
"type": "object"
},
"maxItems": 100,
"title": "Detail",
"type": "array"
}
},
"title": "HTTPValidationError",
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | Successful Response | None |
| 404 | Not Found | Session not found | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Get Session by memory_space_ ID¶
Operation path: GET /{memory_space_id}/sessions/{session_id}/
Get a single session by ID.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| session_id | path | string(uuid) | true | Session ID |
| memory_space_id | path | string | true | Memory Space ID |
Example responses¶
200 Response
{
"description": "Schema for session response.",
"properties": {
"createdAt": {
"description": "Session creation timestamp.",
"format": "date-time",
"title": "Createdat",
"type": "string"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Session description.",
"title": "Description"
},
"id": {
"description": "Session ID.",
"format": "uuid",
"title": "Id",
"type": "string"
},
"lifecycleStrategies": {
"description": "Lifecycle strategies associated with this session.",
"items": {
"description": "Schema for lifecycle strategy in response.\n\nExecution status is tracked in the strategy_executions table and can be\nqueried separately if needed.",
"properties": {
"opts": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"description": "Strategy-specific configuration parameters.",
"title": "Opts"
},
"trigger": {
"anyOf": [
{
"additionalProperties": false,
"description": "Trigger based on time-to-live (session age).\n\nFires when the session age exceeds the configured TTL threshold.",
"properties": {
"ttl": {
"description": "Time-to-live in seconds",
"exclusiveMinimum": 0,
"maximum": 63072000,
"title": "Ttl",
"type": "integer"
}
},
"required": [
"ttl"
],
"title": "TTLTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on event count.\n\nFires when the session's event count reaches or exceeds the configured threshold.",
"properties": {
"eventCount": {
"description": "Event count threshold",
"exclusiveMinimum": 0,
"maximum": 1000000,
"title": "Eventcount",
"type": "integer"
}
},
"required": [
"eventCount"
],
"title": "EventCountTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on token count.\n\nFires when the session's total token count reaches or exceeds the configured threshold.\nTokens are calculated from event message content using tiktoken.",
"properties": {
"tokenCount": {
"description": "Token count threshold",
"exclusiveMinimum": 0,
"maximum": 100000000,
"title": "Tokencount",
"type": "integer"
}
},
"required": [
"tokenCount"
],
"title": "TokenCountTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on time since the last event in the session.\n\nFires when no new events were added to the session within the configured TTL.",
"properties": {
"idle": {
"description": "Time in seconds since last event",
"exclusiveMinimum": 0,
"maximum": 63072000,
"title": "Idle",
"type": "integer"
}
},
"required": [
"idle"
],
"title": "IdleTimeoutTrigger",
"type": "object"
}
],
"description": "Trigger condition.",
"title": "Trigger"
},
"type": {
"description": "Strategy type.",
"enum": [
"soft_delete",
"extract_memories"
],
"title": "Type",
"type": "string"
}
},
"required": [
"type",
"trigger"
],
"title": "LifecycleStrategyResponse",
"type": "object"
},
"maxItems": 5,
"title": "Lifecyclestrategies",
"type": "array"
},
"metadata": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"description": "Custom metadata as key-value pairs for storing application-specific data",
"title": "Metadata"
},
"participants": {
"description": "List of participant IDs.",
"items": {
"type": "string"
},
"maxItems": 1,
"title": "Participants",
"type": "array"
}
},
"required": [
"id",
"participants",
"createdAt"
],
"title": "SessionResponse",
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | SessionResponse |
| 404 | Not Found | Session not found | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Update Session by memory_space_ ID¶
Operation path: PATCH /{memory_space_id}/sessions/{session_id}/
Patch a session with new description and/or metadata.
Only fields explicitly included in the request body are modified others remain untouched.
Body parameter¶
{
"description": "Schema for session partial patch-updates.",
"properties": {
"description": {
"anyOf": [
{
"maxLength": 1000,
"type": "string"
},
{
"type": "null"
}
],
"description": "New session description.",
"title": "Description"
},
"metadata": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"description": "Custom metadata as key-value pairs for storing application-specific data",
"title": "Metadata"
}
},
"title": "UpdateSessionRequest",
"type": "object"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| session_id | path | string(uuid) | true | Session ID |
| memory_space_id | path | string | true | Memory Space ID |
| body | body | UpdateSessionRequest | true | none |
Example responses¶
200 Response
{
"description": "Schema for session response.",
"properties": {
"createdAt": {
"description": "Session creation timestamp.",
"format": "date-time",
"title": "Createdat",
"type": "string"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Session description.",
"title": "Description"
},
"id": {
"description": "Session ID.",
"format": "uuid",
"title": "Id",
"type": "string"
},
"lifecycleStrategies": {
"description": "Lifecycle strategies associated with this session.",
"items": {
"description": "Schema for lifecycle strategy in response.\n\nExecution status is tracked in the strategy_executions table and can be\nqueried separately if needed.",
"properties": {
"opts": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"description": "Strategy-specific configuration parameters.",
"title": "Opts"
},
"trigger": {
"anyOf": [
{
"additionalProperties": false,
"description": "Trigger based on time-to-live (session age).\n\nFires when the session age exceeds the configured TTL threshold.",
"properties": {
"ttl": {
"description": "Time-to-live in seconds",
"exclusiveMinimum": 0,
"maximum": 63072000,
"title": "Ttl",
"type": "integer"
}
},
"required": [
"ttl"
],
"title": "TTLTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on event count.\n\nFires when the session's event count reaches or exceeds the configured threshold.",
"properties": {
"eventCount": {
"description": "Event count threshold",
"exclusiveMinimum": 0,
"maximum": 1000000,
"title": "Eventcount",
"type": "integer"
}
},
"required": [
"eventCount"
],
"title": "EventCountTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on token count.\n\nFires when the session's total token count reaches or exceeds the configured threshold.\nTokens are calculated from event message content using tiktoken.",
"properties": {
"tokenCount": {
"description": "Token count threshold",
"exclusiveMinimum": 0,
"maximum": 100000000,
"title": "Tokencount",
"type": "integer"
}
},
"required": [
"tokenCount"
],
"title": "TokenCountTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on time since the last event in the session.\n\nFires when no new events were added to the session within the configured TTL.",
"properties": {
"idle": {
"description": "Time in seconds since last event",
"exclusiveMinimum": 0,
"maximum": 63072000,
"title": "Idle",
"type": "integer"
}
},
"required": [
"idle"
],
"title": "IdleTimeoutTrigger",
"type": "object"
}
],
"description": "Trigger condition.",
"title": "Trigger"
},
"type": {
"description": "Strategy type.",
"enum": [
"soft_delete",
"extract_memories"
],
"title": "Type",
"type": "string"
}
},
"required": [
"type",
"trigger"
],
"title": "LifecycleStrategyResponse",
"type": "object"
},
"maxItems": 5,
"title": "Lifecyclestrategies",
"type": "array"
},
"metadata": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"description": "Custom metadata as key-value pairs for storing application-specific data",
"title": "Metadata"
},
"participants": {
"description": "List of participant IDs.",
"items": {
"type": "string"
},
"maxItems": 1,
"title": "Participants",
"type": "array"
}
},
"required": [
"id",
"participants",
"createdAt"
],
"title": "SessionResponse",
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | SessionResponse |
| 404 | Not Found | Session not found | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
List Events by memory_space_ ID¶
Operation path: GET /{memory_space_id}/sessions/{session_id}/events/
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| session_id | path | string(uuid) | true | Session ID |
| memory_space_id | path | string | true | Memory Space ID |
| offset | query | integer | false | Skip the specified number of values. |
| limit | query | integer | false | Retrieve only the specified number of values. |
| lastN | query | any | false | Return the last N events in chronological order. Mutually exclusive with offset |
| eventType | query | EventType | false | Filter session events by type. |
Enumerated Values¶
| Parameter | Value |
|---|---|
| eventType | [message, tool_output, status] |
Example responses¶
200 Response
{
"properties": {
"items": {
"description": "List of items for the current page",
"items": {
"description": "Schema for event response.",
"properties": {
"body": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"description": "Event body content.",
"title": "Body"
},
"createdAt": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"description": "Event creation timestamp.",
"title": "Createdat"
},
"emitterId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Emitter identifier.",
"title": "Emitterid"
},
"emitterType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Emitter type.",
"title": "Emittertype"
},
"eventType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Event type.",
"title": "Eventtype"
},
"sequenceId": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"description": "Event sequence number within the session.",
"title": "Sequenceid"
}
},
"title": "EventResponse",
"type": "object"
},
"maxItems": 100,
"title": "Items",
"type": "array"
},
"limit": {
"description": "Maximum number of returned items",
"exclusiveMinimum": 0,
"title": "Limit",
"type": "integer"
},
"offset": {
"description": "Number of skipped items",
"minimum": 0,
"title": "Offset",
"type": "integer"
},
"total": {
"description": "Total number of matching items",
"title": "Total",
"type": "integer"
}
},
"required": [
"items",
"offset",
"limit",
"total"
],
"title": "PaginatedResponse[EventResponse]",
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | PaginatedResponse_EventResponse_ |
| 404 | Not Found | Session not found | None |
| 422 | Unprocessable Entity | Validation error (e.g. lastN used together with offset) | None |
Create Event by memory_space_ ID¶
Operation path: POST /{memory_space_id}/sessions/{session_id}/events/
Body parameter¶
{
"description": "Schema for create event request.",
"properties": {
"body": {
"additionalProperties": true,
"description": "Body for all event types. Content field is mandatory, any additional fields are allowed.",
"properties": {
"content": {
"description": "Event body content text.",
"maxLength": 100000,
"minLength": 1,
"title": "Content",
"type": "string"
}
},
"required": [
"content"
],
"title": "EventBody",
"type": "object"
},
"emitter": {
"description": "Schema for emitter data.",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Emitter identifier (ObjectId format).",
"title": "Id"
},
"type": {
"description": "Emitter type. One of: 'user', 'agent'.",
"enum": [
"user",
"agent"
],
"title": "Type",
"type": "string"
}
},
"required": [
"type"
],
"title": "EmitterDataModel",
"type": "object"
},
"type": {
"enum": [
"message",
"tool_output",
"status"
],
"title": "EventType",
"type": "string"
}
},
"required": [
"body",
"emitter"
],
"title": "CreateEventRequest",
"type": "object"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| session_id | path | string(uuid) | true | Session ID |
| memory_space_id | path | string | true | Memory Space ID |
| body | body | CreateEventRequest | true | none |
Example responses¶
201 Response
{
"description": "Schema for event response.",
"properties": {
"body": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"description": "Event body content.",
"title": "Body"
},
"createdAt": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"description": "Event creation timestamp.",
"title": "Createdat"
},
"emitterId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Emitter identifier.",
"title": "Emitterid"
},
"emitterType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Emitter type.",
"title": "Emittertype"
},
"eventType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Event type.",
"title": "Eventtype"
},
"sequenceId": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"description": "Event sequence number within the session.",
"title": "Sequenceid"
}
},
"title": "EventResponse",
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | Successful Response | EventResponse |
| 404 | Not Found | Session not found | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Update Event by memory_space_ ID¶
Operation path: PATCH /{memory_space_id}/sessions/{session_id}/events/{sequence_id}/
Body parameter¶
{
"description": "Schema for create event request.",
"properties": {
"body": {
"anyOf": [
{
"additionalProperties": true,
"description": "Body for all event types. Content field is mandatory, any additional fields are allowed.",
"properties": {
"content": {
"description": "Event body content text.",
"maxLength": 100000,
"minLength": 1,
"title": "Content",
"type": "string"
}
},
"required": [
"content"
],
"title": "EventBody",
"type": "object"
},
{
"type": "null"
}
],
"description": "Updated event body."
},
"emitter": {
"anyOf": [
{
"description": "Schema for emitter data.",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Emitter identifier (ObjectId format).",
"title": "Id"
},
"type": {
"description": "Emitter type. One of: 'user', 'agent'.",
"enum": [
"user",
"agent"
],
"title": "Type",
"type": "string"
}
},
"required": [
"type"
],
"title": "EmitterDataModel",
"type": "object"
},
{
"type": "null"
}
],
"description": "Updated emitter information."
},
"type": {
"anyOf": [
{
"enum": [
"message",
"tool_output",
"status"
],
"title": "EventType",
"type": "string"
},
{
"type": "null"
}
],
"description": "Updated event type."
}
},
"title": "UpdateEventRequest",
"type": "object"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| sequence_id | path | integer | true | Event sequence ID |
| session_id | path | string(uuid) | true | Session ID |
| memory_space_id | path | string | true | Memory Space ID |
| createdAt | query | any | false | Verification of target version of event |
| body | body | UpdateEventRequest | true | none |
Example responses¶
200 Response
{
"description": "Schema for event response.",
"properties": {
"body": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"description": "Event body content.",
"title": "Body"
},
"createdAt": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"description": "Event creation timestamp.",
"title": "Createdat"
},
"emitterId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Emitter identifier.",
"title": "Emitterid"
},
"emitterType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Emitter type.",
"title": "Emittertype"
},
"eventType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Event type.",
"title": "Eventtype"
},
"sequenceId": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"description": "Event sequence number within the session.",
"title": "Sequenceid"
}
},
"title": "EventResponse",
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | EventResponse |
| 404 | Not Found | Session or event are not found | None |
| 422 | Unprocessable Entity | Try to update outdated version of event | None |
Delete All Memories by memory_space_ ID¶
Operation path: DELETE /{memory_space_id}/v1/memories/
Delete all memories matching the given filter. At least one filter param is required to prevent accidental deletion of all memories across all identities.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| memory_space_id | path | string | true | Memory Space ID |
| user_id | query | any | false | none |
| agent_id | query | any | false | none |
| run_id | query | any | false | none |
| app_id | query | any | false | none |
Example responses¶
200 Response
{
"additionalProperties": true,
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | Inline |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Response Schema¶
Get All Memories V1 by memory_space_ ID¶
Operation path: GET /{memory_space_id}/v1/memories/
Retrieve all memories matching the given identity filters (v1 query-param interface).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| memory_space_id | path | string | true | Memory Space ID |
| user_id | query | any | false | none |
| agent_id | query | any | false | none |
| run_id | query | any | false | none |
| app_id | query | any | false | none |
| top_k | query | any | false | none |
Example responses¶
200 Response
{
"additionalProperties": true,
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | Inline |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Response Schema¶
Post Memories by memory_space_ ID¶
Operation path: POST /{memory_space_id}/v1/memories/
Extract facts from a conversation and persist them as memories.
Body parameter¶
{
"description": "Request body for POST /v1/memories — extracts facts from a conversation",
"properties": {
"agentId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Agentid"
},
"appId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Appid"
},
"expirationDate": {
"anyOf": [
{
"maxLength": 40,
"type": "string"
},
{
"type": "null"
}
],
"title": "Expirationdate"
},
"messages": {
"items": {
"description": "A single conversation message passed to the POST /v1/memory endpoint",
"properties": {
"content": {
"maxLength": 50000,
"minLength": 1,
"title": "Content",
"type": "string"
},
"role": {
"enum": [
"user",
"assistant",
"system"
],
"title": "Role",
"type": "string"
}
},
"required": [
"role",
"content"
],
"title": "Message",
"type": "object"
},
"maxItems": 100,
"minItems": 1,
"title": "Messages",
"type": "array"
},
"metadata": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Metadata"
},
"runId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Runid"
},
"userId": {
"maxLength": 64,
"minLength": 1,
"title": "Userid",
"type": "string"
}
},
"required": [
"userId",
"messages"
],
"title": "MemoryCreate",
"type": "object"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| memory_space_id | path | string | true | Memory Space ID |
| body | body | MemoryCreate | true | none |
Example responses¶
200 Response
{
"additionalProperties": true,
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | Inline |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Response Schema¶
Search Memories V1 by memory_space_ ID¶
Operation path: POST /{memory_space_id}/v1/memories/search/
Search memories by semantic similarity to a query string.
Body parameter¶
{
"description": "Request body for POST /v2/memories/search/\n\nextra=\"ignore\" is set because the mem0 client injects org_id/project_id\nfields that are not relevant for DataRobot.",
"properties": {
"agentId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Agentid"
},
"appId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Appid"
},
"filters": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Filters"
},
"query": {
"maxLength": 2000,
"minLength": 1,
"title": "Query",
"type": "string"
},
"runId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Runid"
},
"topK": {
"anyOf": [
{
"maximum": 50,
"minimum": 1,
"type": "integer"
},
{
"type": "null"
}
],
"title": "Topk"
},
"userId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Userid"
}
},
"required": [
"query"
],
"title": "MemorySearch",
"type": "object"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| memory_space_id | path | string | true | Memory Space ID |
| body | body | MemorySearch | true | none |
Example responses¶
200 Response
{
"additionalProperties": true,
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | Inline |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Response Schema¶
Delete Memory by memory_space_ ID¶
Operation path: DELETE /{memory_space_id}/v1/memories/{memory_id}/
Delete a single memory by its ID.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| memory_id | path | string(uuid) | true | none |
| memory_space_id | path | string | true | Memory Space ID |
Example responses¶
200 Response
{
"additionalProperties": true,
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | Inline |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Response Schema¶
Get Memory by memory_space_ ID¶
Operation path: GET /{memory_space_id}/v1/memories/{memory_id}/
Retrieve a single memory by its ID. Returns null if the memory does not exist.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| memory_id | path | string(uuid) | true | none |
| memory_space_id | path | string | true | Memory Space ID |
Example responses¶
200 Response
{
"additionalProperties": true,
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | Inline |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Response Schema¶
Put Memory by memory_space_ ID¶
Operation path: PUT /{memory_space_id}/v1/memories/{memory_id}/
Replace the text of an existing memory. Returns 404 if the memory does not exist. Returns 409 if the memory is immutable.
Body parameter¶
{
"description": "Request body for PUT /v1/memories/{memory_id}.\n\nmetadata and timestamp are accepted for mem0 client compatibility but not forwarded.",
"properties": {
"metadata": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Metadata"
},
"text": {
"maxLength": 10000,
"minLength": 1,
"title": "Text",
"type": "string"
},
"timestamp": {
"anyOf": [
{
"maxLength": 40,
"type": "string"
},
{
"type": "null"
}
],
"title": "Timestamp"
}
},
"required": [
"text"
],
"title": "MemoryUpdate",
"type": "object"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| memory_id | path | string(uuid) | true | none |
| memory_space_id | path | string | true | Memory Space ID |
| body | body | MemoryUpdate | true | none |
Example responses¶
200 Response
{
"additionalProperties": true,
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | Inline |
| 404 | Not Found | Memory not found. | None |
| 409 | Conflict | Memory is immutable and cannot be updated. | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Response Schema¶
Get Memory History by memory_space_ ID¶
Operation path: GET /{memory_space_id}/v1/memories/{memory_id}/history/
Retrieve the mutation history (audit trail) for a single memory.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| memory_id | path | string(uuid) | true | none |
| memory_space_id | path | string | true | Memory Space ID |
| limit | query | integer | false | none |
Example responses¶
200 Response
{
"additionalProperties": true,
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | Inline |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Response Schema¶
Ping by memory_space_ ID¶
Operation path: GET /{memory_space_id}/v1/ping/
Health check endpoint returning fake user context for mem0.MemoryClient compatibility.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| memory_space_id | path | string | true | Memory Space ID |
Example responses¶
200 Response
{
"additionalProperties": true,
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | Inline |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Response Schema¶
Reset Memories by memory_space_ ID¶
Operation path: POST /{memory_space_id}/v1/reset/
Delete all memories in the current memory space.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| memory_space_id | path | string | true | Memory Space ID |
Example responses¶
200 Response
{
"additionalProperties": true,
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | Inline |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Response Schema¶
Get All Memories V2 by memory_space_ ID¶
Operation path: POST /{memory_space_id}/v2/memories/
Retrieve all memories matching the given filters.
At least one of user_id, agent_id, or run_id is required (as enforced by mem0's AsyncMemory).
Body parameter¶
{
"description": "Request body for POST /v2/memories\n\nextra=\"ignore\" is set because the mem0 client injects org_id/project_id\nfields that are not relevant for DataRobot.",
"properties": {
"agentId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Agentid"
},
"appId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Appid"
},
"filters": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Filters"
},
"pageSize": {
"anyOf": [
{
"maximum": 50,
"minimum": 1,
"type": "integer"
},
{
"type": "null"
}
],
"title": "Pagesize"
},
"runId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Runid"
},
"topK": {
"anyOf": [
{
"maximum": 50,
"minimum": 1,
"type": "integer"
},
{
"type": "null"
}
],
"title": "Topk"
},
"userId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Userid"
}
},
"title": "MemoryGetAll",
"type": "object"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| memory_space_id | path | string | true | Memory Space ID |
| page_size | query | any | false | none |
| body | body | MemoryGetAll | true | none |
Example responses¶
200 Response
{
"additionalProperties": true,
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | Inline |
| 400 | Bad Request | At least one of user_id, agent_id, or run_id must be provided. | None |
| 422 | Unprocessable Entity | Either unknown filter fields or malformed filter operators. | None |
Response Schema¶
Search Memories V2 by memory_space_ ID¶
Operation path: POST /{memory_space_id}/v2/memories/search/
Search memories by semantic similarity to a query string.
At least one of user_id, agent_id, or run_id is required to scope the search.
Body parameter¶
{
"description": "Request body for POST /v2/memories/search/\n\nextra=\"ignore\" is set because the mem0 client injects org_id/project_id\nfields that are not relevant for DataRobot.",
"properties": {
"agentId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Agentid"
},
"appId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Appid"
},
"filters": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Filters"
},
"query": {
"maxLength": 2000,
"minLength": 1,
"title": "Query",
"type": "string"
},
"runId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Runid"
},
"topK": {
"anyOf": [
{
"maximum": 50,
"minimum": 1,
"type": "integer"
},
{
"type": "null"
}
],
"title": "Topk"
},
"userId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Userid"
}
},
"required": [
"query"
],
"title": "MemorySearch",
"type": "object"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| memory_space_id | path | string | true | Memory Space ID |
| body | body | MemorySearch | true | none |
Example responses¶
200 Response
{
"additionalProperties": true,
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | Inline |
| 400 | Bad Request | At least one of user_id, agent_id, or run_id must be provided. | None |
| 422 | Unprocessable Entity | Either unknown filter fields or malformed filter operators. | None |
Response Schema¶
Schemas¶
CreateEventRequest
{
"description": "Schema for create event request.",
"properties": {
"body": {
"additionalProperties": true,
"description": "Body for all event types. Content field is mandatory, any additional fields are allowed.",
"properties": {
"content": {
"description": "Event body content text.",
"maxLength": 100000,
"minLength": 1,
"title": "Content",
"type": "string"
}
},
"required": [
"content"
],
"title": "EventBody",
"type": "object"
},
"emitter": {
"description": "Schema for emitter data.",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Emitter identifier (ObjectId format).",
"title": "Id"
},
"type": {
"description": "Emitter type. One of: 'user', 'agent'.",
"enum": [
"user",
"agent"
],
"title": "Type",
"type": "string"
}
},
"required": [
"type"
],
"title": "EmitterDataModel",
"type": "object"
},
"type": {
"enum": [
"message",
"tool_output",
"status"
],
"title": "EventType",
"type": "string"
}
},
"required": [
"body",
"emitter"
],
"title": "CreateEventRequest",
"type": "object"
}
CreateEventRequest
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| body | EventBody | true | Event body. | |
| emitter | EmitterDataModel | true | Emitter information. | |
| type | EventType | false | Event type. |
CreateMemorySpaceRequest
{
"description": "Request body for creating a Memory Space",
"properties": {
"customInstructions": {
"anyOf": [
{
"maxLength": 10000,
"type": "string"
},
{
"type": "null"
}
],
"description": "Custom prompt instructions used for fact extraction Null leaves mem0 on its default extraction prompt.",
"title": "Custominstructions"
},
"description": {
"anyOf": [
{
"maxLength": 1000,
"type": "string"
},
{
"type": "null"
}
],
"description": "Optional description for the memory space.",
"title": "Description"
},
"llmModelName": {
"anyOf": [
{
"maxLength": 200,
"type": "string"
},
{
"type": "null"
}
],
"description": "Name of the LLM model to use for memory extraction.",
"title": "Llmmodelname"
}
},
"title": "CreateMemorySpaceRequest",
"type": "object"
}
CreateMemorySpaceRequest
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| customInstructions | any | false | Custom prompt instructions used for fact extraction Null leaves mem0 on its default extraction prompt. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 10000 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| description | any | false | Optional description for the memory space. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 1000 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| llmModelName | any | false | Name of the LLM model to use for memory extraction. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 200 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
CreateSessionRequest
{
"description": "Customer support conversation",
"lifecycleStrategies": [
{
"trigger": {
"ttl": 604800
},
"type": "soft_delete"
}
],
"metadata": {
"department": "sales",
"priority": "high",
"region": "us-east"
},
"participants": [
"507f1f77bcf86cd799439011"
]
}
CreateSessionRequest
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| description | any | false | Optional session description |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 1000 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| lifecycleStrategies | [LifecycleStrategiesDataModel] | true | maxItems: 5 |
Lifecycle strategies that automatically manage session lifecycle |
| metadata | any | false | Custom metadata as key-value pairs for storing application-specific data |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | object | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| participants | [string] | true | maxItems: 1 minItems: 1 |
List of participant IDs (ObjectId format) |
EmitterDataModel
{
"description": "Schema for emitter data.",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Emitter identifier (ObjectId format).",
"title": "Id"
},
"type": {
"description": "Emitter type. One of: 'user', 'agent'.",
"enum": [
"user",
"agent"
],
"title": "Type",
"type": "string"
}
},
"required": [
"type"
],
"title": "EmitterDataModel",
"type": "object"
}
EmitterDataModel
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| id | any | false | Emitter identifier (ObjectId format). |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| type | string | true | Emitter type. One of: 'user', 'agent'. |
Enumerated Values¶
| Property | Value |
|---|---|
| type | [user, agent] |
EventBody
{
"additionalProperties": true,
"description": "Body for all event types. Content field is mandatory, any additional fields are allowed.",
"properties": {
"content": {
"description": "Event body content text.",
"maxLength": 100000,
"minLength": 1,
"title": "Content",
"type": "string"
}
},
"required": [
"content"
],
"title": "EventBody",
"type": "object"
}
EventBody
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| content | string | true | maxLength: 100000 minLength: 1 minLength: 1 |
Event body content text. |
EventCountTrigger
{
"additionalProperties": false,
"description": "Trigger based on event count.\n\nFires when the session's event count reaches or exceeds the configured threshold.",
"properties": {
"eventCount": {
"description": "Event count threshold",
"exclusiveMinimum": 0,
"maximum": 1000000,
"title": "Eventcount",
"type": "integer"
}
},
"required": [
"eventCount"
],
"title": "EventCountTrigger",
"type": "object"
}
EventCountTrigger
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| eventCount | integer | true | maximum: 1000000 |
Event count threshold |
EventResponse
{
"description": "Schema for event response.",
"properties": {
"body": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"description": "Event body content.",
"title": "Body"
},
"createdAt": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"description": "Event creation timestamp.",
"title": "Createdat"
},
"emitterId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Emitter identifier.",
"title": "Emitterid"
},
"emitterType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Emitter type.",
"title": "Emittertype"
},
"eventType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Event type.",
"title": "Eventtype"
},
"sequenceId": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"description": "Event sequence number within the session.",
"title": "Sequenceid"
}
},
"title": "EventResponse",
"type": "object"
}
EventResponse
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| body | any | false | Event body content. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | object | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| createdAt | any | false | Event creation timestamp. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string(date-time) | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| emitterId | any | false | Emitter identifier. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| emitterType | any | false | Emitter type. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| eventType | any | false | Event type. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| sequenceId | any | false | Event sequence number within the session. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | integer | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
EventType
{
"enum": [
"message",
"tool_output",
"status"
],
"title": "EventType",
"type": "string"
}
EventType
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| EventType | string | false | none |
Enumerated Values¶
| Property | Value |
|---|---|
| EventType | [message, tool_output, status] |
HTTPValidationError
{
"properties": {
"detail": {
"description": "List of validation errors.",
"items": {
"properties": {
"ctx": {
"description": "Additional context about the validation error.",
"title": "Context",
"type": "object"
},
"input": {
"additionalProperties": true,
"description": "The input value that caused the validation error.",
"title": "Input",
"type": "object"
},
"loc": {
"description": "The location in the request where the validation error occurred.",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"maxItems": 100,
"title": "Location",
"type": "array"
},
"msg": {
"description": "A human-readable description of the validation error.",
"title": "Message",
"type": "string"
},
"type": {
"description": "A machine-readable error type identifier.",
"title": "Error Type",
"type": "string"
}
},
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError",
"type": "object"
},
"maxItems": 100,
"title": "Detail",
"type": "array"
}
},
"title": "HTTPValidationError",
"type": "object"
}
HTTPValidationError
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| detail | [ValidationError] | false | maxItems: 100 |
List of validation errors. |
IdleTimeoutTrigger
{
"additionalProperties": false,
"description": "Trigger based on time since the last event in the session.\n\nFires when no new events were added to the session within the configured TTL.",
"properties": {
"idle": {
"description": "Time in seconds since last event",
"exclusiveMinimum": 0,
"maximum": 63072000,
"title": "Idle",
"type": "integer"
}
},
"required": [
"idle"
],
"title": "IdleTimeoutTrigger",
"type": "object"
}
IdleTimeoutTrigger
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| idle | integer | true | maximum: 63072000 |
Time in seconds since last event |
LifecycleStrategiesDataModel
{
"trigger": {
"ttl": 86400
},
"type": "soft_delete"
}
LifecycleStrategiesDataModel
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| opts | any | false | Optional strategy-specific configuration parameters |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | object | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| trigger | any | true | Trigger condition. Available: 'ttl' (time in seconds), 'eventCount', 'tokenCount', 'idle' |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | TTLTrigger | false | Trigger based on time-to-live (session age). Fires when the session age exceeds the configured TTL threshold. |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | EventCountTrigger | false | Trigger based on event count. Fires when the session's event count reaches or exceeds the configured threshold. |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | TokenCountTrigger | false | Trigger based on token count. Fires when the session's total token count reaches or exceeds the configured threshold. Tokens are calculated from event message content using tiktoken. |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | IdleTimeoutTrigger | false | Trigger based on time since the last event in the session. Fires when no new events were added to the session within the configured TTL. |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| type | string | true | Strategy type. Available: 'soft_delete' |
Enumerated Values¶
| Property | Value |
|---|---|
| type | [soft_delete, extract_memories] |
LifecycleStrategyResponse
{
"description": "Schema for lifecycle strategy in response.\n\nExecution status is tracked in the strategy_executions table and can be\nqueried separately if needed.",
"properties": {
"opts": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"description": "Strategy-specific configuration parameters.",
"title": "Opts"
},
"trigger": {
"anyOf": [
{
"additionalProperties": false,
"description": "Trigger based on time-to-live (session age).\n\nFires when the session age exceeds the configured TTL threshold.",
"properties": {
"ttl": {
"description": "Time-to-live in seconds",
"exclusiveMinimum": 0,
"maximum": 63072000,
"title": "Ttl",
"type": "integer"
}
},
"required": [
"ttl"
],
"title": "TTLTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on event count.\n\nFires when the session's event count reaches or exceeds the configured threshold.",
"properties": {
"eventCount": {
"description": "Event count threshold",
"exclusiveMinimum": 0,
"maximum": 1000000,
"title": "Eventcount",
"type": "integer"
}
},
"required": [
"eventCount"
],
"title": "EventCountTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on token count.\n\nFires when the session's total token count reaches or exceeds the configured threshold.\nTokens are calculated from event message content using tiktoken.",
"properties": {
"tokenCount": {
"description": "Token count threshold",
"exclusiveMinimum": 0,
"maximum": 100000000,
"title": "Tokencount",
"type": "integer"
}
},
"required": [
"tokenCount"
],
"title": "TokenCountTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on time since the last event in the session.\n\nFires when no new events were added to the session within the configured TTL.",
"properties": {
"idle": {
"description": "Time in seconds since last event",
"exclusiveMinimum": 0,
"maximum": 63072000,
"title": "Idle",
"type": "integer"
}
},
"required": [
"idle"
],
"title": "IdleTimeoutTrigger",
"type": "object"
}
],
"description": "Trigger condition.",
"title": "Trigger"
},
"type": {
"description": "Strategy type.",
"enum": [
"soft_delete",
"extract_memories"
],
"title": "Type",
"type": "string"
}
},
"required": [
"type",
"trigger"
],
"title": "LifecycleStrategyResponse",
"type": "object"
}
LifecycleStrategyResponse
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| opts | any | false | Strategy-specific configuration parameters. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | object | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| trigger | any | true | Trigger condition. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | TTLTrigger | false | Trigger based on time-to-live (session age). Fires when the session age exceeds the configured TTL threshold. |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | EventCountTrigger | false | Trigger based on event count. Fires when the session's event count reaches or exceeds the configured threshold. |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | TokenCountTrigger | false | Trigger based on token count. Fires when the session's total token count reaches or exceeds the configured threshold. Tokens are calculated from event message content using tiktoken. |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | IdleTimeoutTrigger | false | Trigger based on time since the last event in the session. Fires when no new events were added to the session within the configured TTL. |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| type | string | true | Strategy type. |
Enumerated Values¶
| Property | Value |
|---|---|
| type | [soft_delete, extract_memories] |
MemoryCreate
{
"description": "Request body for POST /v1/memories — extracts facts from a conversation",
"properties": {
"agentId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Agentid"
},
"appId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Appid"
},
"expirationDate": {
"anyOf": [
{
"maxLength": 40,
"type": "string"
},
{
"type": "null"
}
],
"title": "Expirationdate"
},
"messages": {
"items": {
"description": "A single conversation message passed to the POST /v1/memory endpoint",
"properties": {
"content": {
"maxLength": 50000,
"minLength": 1,
"title": "Content",
"type": "string"
},
"role": {
"enum": [
"user",
"assistant",
"system"
],
"title": "Role",
"type": "string"
}
},
"required": [
"role",
"content"
],
"title": "Message",
"type": "object"
},
"maxItems": 100,
"minItems": 1,
"title": "Messages",
"type": "array"
},
"metadata": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Metadata"
},
"runId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Runid"
},
"userId": {
"maxLength": 64,
"minLength": 1,
"title": "Userid",
"type": "string"
}
},
"required": [
"userId",
"messages"
],
"title": "MemoryCreate",
"type": "object"
}
MemoryCreate
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| agentId | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 64 minLength: 1 minLength: 1 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| appId | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 64 minLength: 1 minLength: 1 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| expirationDate | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 40 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| messages | [Message] | true | maxItems: 100 minItems: 1 |
[A single conversation message passed to the POST /v1/memory endpoint] |
| metadata | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | object | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| runId | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 64 minLength: 1 minLength: 1 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| userId | string | true | maxLength: 64 minLength: 1 minLength: 1 |
none |
MemoryGetAll
{
"description": "Request body for POST /v2/memories\n\nextra=\"ignore\" is set because the mem0 client injects org_id/project_id\nfields that are not relevant for DataRobot.",
"properties": {
"agentId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Agentid"
},
"appId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Appid"
},
"filters": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Filters"
},
"pageSize": {
"anyOf": [
{
"maximum": 50,
"minimum": 1,
"type": "integer"
},
{
"type": "null"
}
],
"title": "Pagesize"
},
"runId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Runid"
},
"topK": {
"anyOf": [
{
"maximum": 50,
"minimum": 1,
"type": "integer"
},
{
"type": "null"
}
],
"title": "Topk"
},
"userId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Userid"
}
},
"title": "MemoryGetAll",
"type": "object"
}
MemoryGetAll
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| agentId | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 64 minLength: 1 minLength: 1 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| appId | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 64 minLength: 1 minLength: 1 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| filters | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | object | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| pageSize | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | integer | false | maximum: 50 minimum: 1 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| runId | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 64 minLength: 1 minLength: 1 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| topK | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | integer | false | maximum: 50 minimum: 1 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| userId | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 64 minLength: 1 minLength: 1 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
MemorySearch
{
"description": "Request body for POST /v2/memories/search/\n\nextra=\"ignore\" is set because the mem0 client injects org_id/project_id\nfields that are not relevant for DataRobot.",
"properties": {
"agentId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Agentid"
},
"appId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Appid"
},
"filters": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Filters"
},
"query": {
"maxLength": 2000,
"minLength": 1,
"title": "Query",
"type": "string"
},
"runId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Runid"
},
"topK": {
"anyOf": [
{
"maximum": 50,
"minimum": 1,
"type": "integer"
},
{
"type": "null"
}
],
"title": "Topk"
},
"userId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Userid"
}
},
"required": [
"query"
],
"title": "MemorySearch",
"type": "object"
}
MemorySearch
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| agentId | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 64 minLength: 1 minLength: 1 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| appId | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 64 minLength: 1 minLength: 1 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| filters | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | object | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| query | string | true | maxLength: 2000 minLength: 1 minLength: 1 |
none |
| runId | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 64 minLength: 1 minLength: 1 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| topK | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | integer | false | maximum: 50 minimum: 1 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| userId | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 64 minLength: 1 minLength: 1 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
MemorySpaceResponse
{
"description": "Response schema for a single Memory Space",
"properties": {
"createdAt": {
"description": "Memory space creation timestamp.",
"format": "date-time",
"title": "Createdat",
"type": "string"
},
"customInstructions": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Custom prompt instructions used for fact extraction. Null means the default mem0 extraction prompt is used.",
"title": "Custominstructions"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Memory space description.",
"title": "Description"
},
"llmModelName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "LLM model configured for memory extraction.",
"title": "Llmmodelname"
},
"memorySpaceId": {
"description": "Unique memory space identifier.",
"format": "uuid",
"title": "Memoryspaceid",
"type": "string"
},
"tenantId": {
"description": "Tenant identifier.",
"format": "uuid",
"title": "Tenantid",
"type": "string"
},
"userId": {
"description": "ID of the user who owns this memory space.",
"title": "Userid",
"type": "string"
}
},
"required": [
"memorySpaceId",
"userId",
"tenantId",
"createdAt"
],
"title": "MemorySpaceResponse",
"type": "object"
}
MemorySpaceResponse
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| createdAt | string(date-time) | true | Memory space creation timestamp. | |
| customInstructions | any | false | Custom prompt instructions used for fact extraction. Null means the default mem0 extraction prompt is used. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| description | any | false | Memory space description. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| llmModelName | any | false | LLM model configured for memory extraction. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| memorySpaceId | string(uuid) | true | Unique memory space identifier. | |
| tenantId | string(uuid) | true | Tenant identifier. | |
| userId | string | true | ID of the user who owns this memory space. |
MemoryUpdate
{
"description": "Request body for PUT /v1/memories/{memory_id}.\n\nmetadata and timestamp are accepted for mem0 client compatibility but not forwarded.",
"properties": {
"metadata": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Metadata"
},
"text": {
"maxLength": 10000,
"minLength": 1,
"title": "Text",
"type": "string"
},
"timestamp": {
"anyOf": [
{
"maxLength": 40,
"type": "string"
},
{
"type": "null"
}
],
"title": "Timestamp"
}
},
"required": [
"text"
],
"title": "MemoryUpdate",
"type": "object"
}
MemoryUpdate
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| metadata | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | object | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| text | string | true | maxLength: 10000 minLength: 1 minLength: 1 |
none |
| timestamp | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 40 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
Message
{
"description": "A single conversation message passed to the POST /v1/memory endpoint",
"properties": {
"content": {
"maxLength": 50000,
"minLength": 1,
"title": "Content",
"type": "string"
},
"role": {
"enum": [
"user",
"assistant",
"system"
],
"title": "Role",
"type": "string"
}
},
"required": [
"role",
"content"
],
"title": "Message",
"type": "object"
}
Message
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| content | string | true | maxLength: 50000 minLength: 1 minLength: 1 |
none |
| role | string | true | none |
Enumerated Values¶
| Property | Value |
|---|---|
| role | [user, assistant, system] |
PaginatedResponse_EventResponse_
{
"properties": {
"items": {
"description": "List of items for the current page",
"items": {
"description": "Schema for event response.",
"properties": {
"body": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"description": "Event body content.",
"title": "Body"
},
"createdAt": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"description": "Event creation timestamp.",
"title": "Createdat"
},
"emitterId": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Emitter identifier.",
"title": "Emitterid"
},
"emitterType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Emitter type.",
"title": "Emittertype"
},
"eventType": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Event type.",
"title": "Eventtype"
},
"sequenceId": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"description": "Event sequence number within the session.",
"title": "Sequenceid"
}
},
"title": "EventResponse",
"type": "object"
},
"maxItems": 100,
"title": "Items",
"type": "array"
},
"limit": {
"description": "Maximum number of returned items",
"exclusiveMinimum": 0,
"title": "Limit",
"type": "integer"
},
"offset": {
"description": "Number of skipped items",
"minimum": 0,
"title": "Offset",
"type": "integer"
},
"total": {
"description": "Total number of matching items",
"title": "Total",
"type": "integer"
}
},
"required": [
"items",
"offset",
"limit",
"total"
],
"title": "PaginatedResponse[EventResponse]",
"type": "object"
}
PaginatedResponse[EventResponse]
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| items | [EventResponse] | true | maxItems: 100 |
List of items for the current page |
| limit | integer | true | Maximum number of returned items | |
| offset | integer | true | minimum: 0 |
Number of skipped items |
| total | integer | true | Total number of matching items |
PaginatedResponse_MemorySpaceResponse_
{
"properties": {
"items": {
"description": "List of items for the current page",
"items": {
"description": "Response schema for a single Memory Space",
"properties": {
"createdAt": {
"description": "Memory space creation timestamp.",
"format": "date-time",
"title": "Createdat",
"type": "string"
},
"customInstructions": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Custom prompt instructions used for fact extraction. Null means the default mem0 extraction prompt is used.",
"title": "Custominstructions"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Memory space description.",
"title": "Description"
},
"llmModelName": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "LLM model configured for memory extraction.",
"title": "Llmmodelname"
},
"memorySpaceId": {
"description": "Unique memory space identifier.",
"format": "uuid",
"title": "Memoryspaceid",
"type": "string"
},
"tenantId": {
"description": "Tenant identifier.",
"format": "uuid",
"title": "Tenantid",
"type": "string"
},
"userId": {
"description": "ID of the user who owns this memory space.",
"title": "Userid",
"type": "string"
}
},
"required": [
"memorySpaceId",
"userId",
"tenantId",
"createdAt"
],
"title": "MemorySpaceResponse",
"type": "object"
},
"maxItems": 100,
"title": "Items",
"type": "array"
},
"limit": {
"description": "Maximum number of returned items",
"exclusiveMinimum": 0,
"title": "Limit",
"type": "integer"
},
"offset": {
"description": "Number of skipped items",
"minimum": 0,
"title": "Offset",
"type": "integer"
},
"total": {
"description": "Total number of matching items",
"title": "Total",
"type": "integer"
}
},
"required": [
"items",
"offset",
"limit",
"total"
],
"title": "PaginatedResponse[MemorySpaceResponse]",
"type": "object"
}
PaginatedResponse[MemorySpaceResponse]
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| items | [MemorySpaceResponse] | true | maxItems: 100 |
List of items for the current page |
| limit | integer | true | Maximum number of returned items | |
| offset | integer | true | minimum: 0 |
Number of skipped items |
| total | integer | true | Total number of matching items |
PaginatedResponse_SessionResponse_
{
"properties": {
"items": {
"description": "List of items for the current page",
"items": {
"description": "Schema for session response.",
"properties": {
"createdAt": {
"description": "Session creation timestamp.",
"format": "date-time",
"title": "Createdat",
"type": "string"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Session description.",
"title": "Description"
},
"id": {
"description": "Session ID.",
"format": "uuid",
"title": "Id",
"type": "string"
},
"lifecycleStrategies": {
"description": "Lifecycle strategies associated with this session.",
"items": {
"description": "Schema for lifecycle strategy in response.\n\nExecution status is tracked in the strategy_executions table and can be\nqueried separately if needed.",
"properties": {
"opts": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"description": "Strategy-specific configuration parameters.",
"title": "Opts"
},
"trigger": {
"anyOf": [
{
"additionalProperties": false,
"description": "Trigger based on time-to-live (session age).\n\nFires when the session age exceeds the configured TTL threshold.",
"properties": {
"ttl": {
"description": "Time-to-live in seconds",
"exclusiveMinimum": 0,
"maximum": 63072000,
"title": "Ttl",
"type": "integer"
}
},
"required": [
"ttl"
],
"title": "TTLTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on event count.\n\nFires when the session's event count reaches or exceeds the configured threshold.",
"properties": {
"eventCount": {
"description": "Event count threshold",
"exclusiveMinimum": 0,
"maximum": 1000000,
"title": "Eventcount",
"type": "integer"
}
},
"required": [
"eventCount"
],
"title": "EventCountTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on token count.\n\nFires when the session's total token count reaches or exceeds the configured threshold.\nTokens are calculated from event message content using tiktoken.",
"properties": {
"tokenCount": {
"description": "Token count threshold",
"exclusiveMinimum": 0,
"maximum": 100000000,
"title": "Tokencount",
"type": "integer"
}
},
"required": [
"tokenCount"
],
"title": "TokenCountTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on time since the last event in the session.\n\nFires when no new events were added to the session within the configured TTL.",
"properties": {
"idle": {
"description": "Time in seconds since last event",
"exclusiveMinimum": 0,
"maximum": 63072000,
"title": "Idle",
"type": "integer"
}
},
"required": [
"idle"
],
"title": "IdleTimeoutTrigger",
"type": "object"
}
],
"description": "Trigger condition.",
"title": "Trigger"
},
"type": {
"description": "Strategy type.",
"enum": [
"soft_delete",
"extract_memories"
],
"title": "Type",
"type": "string"
}
},
"required": [
"type",
"trigger"
],
"title": "LifecycleStrategyResponse",
"type": "object"
},
"maxItems": 5,
"title": "Lifecyclestrategies",
"type": "array"
},
"metadata": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"description": "Custom metadata as key-value pairs for storing application-specific data",
"title": "Metadata"
},
"participants": {
"description": "List of participant IDs.",
"items": {
"type": "string"
},
"maxItems": 1,
"title": "Participants",
"type": "array"
}
},
"required": [
"id",
"participants",
"createdAt"
],
"title": "SessionResponse",
"type": "object"
},
"maxItems": 100,
"title": "Items",
"type": "array"
},
"limit": {
"description": "Maximum number of returned items",
"exclusiveMinimum": 0,
"title": "Limit",
"type": "integer"
},
"offset": {
"description": "Number of skipped items",
"minimum": 0,
"title": "Offset",
"type": "integer"
},
"total": {
"description": "Total number of matching items",
"title": "Total",
"type": "integer"
}
},
"required": [
"items",
"offset",
"limit",
"total"
],
"title": "PaginatedResponse[SessionResponse]",
"type": "object"
}
PaginatedResponse[SessionResponse]
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| items | [SessionResponse] | true | maxItems: 100 |
List of items for the current page |
| limit | integer | true | Maximum number of returned items | |
| offset | integer | true | minimum: 0 |
Number of skipped items |
| total | integer | true | Total number of matching items |
SessionResponse
{
"description": "Schema for session response.",
"properties": {
"createdAt": {
"description": "Session creation timestamp.",
"format": "date-time",
"title": "Createdat",
"type": "string"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Session description.",
"title": "Description"
},
"id": {
"description": "Session ID.",
"format": "uuid",
"title": "Id",
"type": "string"
},
"lifecycleStrategies": {
"description": "Lifecycle strategies associated with this session.",
"items": {
"description": "Schema for lifecycle strategy in response.\n\nExecution status is tracked in the strategy_executions table and can be\nqueried separately if needed.",
"properties": {
"opts": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"description": "Strategy-specific configuration parameters.",
"title": "Opts"
},
"trigger": {
"anyOf": [
{
"additionalProperties": false,
"description": "Trigger based on time-to-live (session age).\n\nFires when the session age exceeds the configured TTL threshold.",
"properties": {
"ttl": {
"description": "Time-to-live in seconds",
"exclusiveMinimum": 0,
"maximum": 63072000,
"title": "Ttl",
"type": "integer"
}
},
"required": [
"ttl"
],
"title": "TTLTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on event count.\n\nFires when the session's event count reaches or exceeds the configured threshold.",
"properties": {
"eventCount": {
"description": "Event count threshold",
"exclusiveMinimum": 0,
"maximum": 1000000,
"title": "Eventcount",
"type": "integer"
}
},
"required": [
"eventCount"
],
"title": "EventCountTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on token count.\n\nFires when the session's total token count reaches or exceeds the configured threshold.\nTokens are calculated from event message content using tiktoken.",
"properties": {
"tokenCount": {
"description": "Token count threshold",
"exclusiveMinimum": 0,
"maximum": 100000000,
"title": "Tokencount",
"type": "integer"
}
},
"required": [
"tokenCount"
],
"title": "TokenCountTrigger",
"type": "object"
},
{
"additionalProperties": false,
"description": "Trigger based on time since the last event in the session.\n\nFires when no new events were added to the session within the configured TTL.",
"properties": {
"idle": {
"description": "Time in seconds since last event",
"exclusiveMinimum": 0,
"maximum": 63072000,
"title": "Idle",
"type": "integer"
}
},
"required": [
"idle"
],
"title": "IdleTimeoutTrigger",
"type": "object"
}
],
"description": "Trigger condition.",
"title": "Trigger"
},
"type": {
"description": "Strategy type.",
"enum": [
"soft_delete",
"extract_memories"
],
"title": "Type",
"type": "string"
}
},
"required": [
"type",
"trigger"
],
"title": "LifecycleStrategyResponse",
"type": "object"
},
"maxItems": 5,
"title": "Lifecyclestrategies",
"type": "array"
},
"metadata": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"description": "Custom metadata as key-value pairs for storing application-specific data",
"title": "Metadata"
},
"participants": {
"description": "List of participant IDs.",
"items": {
"type": "string"
},
"maxItems": 1,
"title": "Participants",
"type": "array"
}
},
"required": [
"id",
"participants",
"createdAt"
],
"title": "SessionResponse",
"type": "object"
}
SessionResponse
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| createdAt | string(date-time) | true | Session creation timestamp. | |
| description | any | false | Session description. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| id | string(uuid) | true | Session ID. | |
| lifecycleStrategies | [LifecycleStrategyResponse] | false | maxItems: 5 |
Lifecycle strategies associated with this session. |
| metadata | any | false | Custom metadata as key-value pairs for storing application-specific data |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | object | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| participants | [string] | true | maxItems: 1 |
List of participant IDs. |
TTLTrigger
{
"additionalProperties": false,
"description": "Trigger based on time-to-live (session age).\n\nFires when the session age exceeds the configured TTL threshold.",
"properties": {
"ttl": {
"description": "Time-to-live in seconds",
"exclusiveMinimum": 0,
"maximum": 63072000,
"title": "Ttl",
"type": "integer"
}
},
"required": [
"ttl"
],
"title": "TTLTrigger",
"type": "object"
}
TTLTrigger
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| ttl | integer | true | maximum: 63072000 |
Time-to-live in seconds |
TokenCountTrigger
{
"additionalProperties": false,
"description": "Trigger based on token count.\n\nFires when the session's total token count reaches or exceeds the configured threshold.\nTokens are calculated from event message content using tiktoken.",
"properties": {
"tokenCount": {
"description": "Token count threshold",
"exclusiveMinimum": 0,
"maximum": 100000000,
"title": "Tokencount",
"type": "integer"
}
},
"required": [
"tokenCount"
],
"title": "TokenCountTrigger",
"type": "object"
}
TokenCountTrigger
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| tokenCount | integer | true | maximum: 100000000 |
Token count threshold |
UpdateEventRequest
{
"description": "Schema for create event request.",
"properties": {
"body": {
"anyOf": [
{
"additionalProperties": true,
"description": "Body for all event types. Content field is mandatory, any additional fields are allowed.",
"properties": {
"content": {
"description": "Event body content text.",
"maxLength": 100000,
"minLength": 1,
"title": "Content",
"type": "string"
}
},
"required": [
"content"
],
"title": "EventBody",
"type": "object"
},
{
"type": "null"
}
],
"description": "Updated event body."
},
"emitter": {
"anyOf": [
{
"description": "Schema for emitter data.",
"properties": {
"id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Emitter identifier (ObjectId format).",
"title": "Id"
},
"type": {
"description": "Emitter type. One of: 'user', 'agent'.",
"enum": [
"user",
"agent"
],
"title": "Type",
"type": "string"
}
},
"required": [
"type"
],
"title": "EmitterDataModel",
"type": "object"
},
{
"type": "null"
}
],
"description": "Updated emitter information."
},
"type": {
"anyOf": [
{
"enum": [
"message",
"tool_output",
"status"
],
"title": "EventType",
"type": "string"
},
{
"type": "null"
}
],
"description": "Updated event type."
}
},
"title": "UpdateEventRequest",
"type": "object"
}
UpdateEventRequest
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| body | any | false | Updated event body. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | EventBody | false | Body for all event types. Content field is mandatory, any additional fields are allowed. |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| emitter | any | false | Updated emitter information. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | EmitterDataModel | false | Schema for emitter data. |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| type | any | false | Updated event type. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | EventType | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
UpdateMemorySpaceRequest
{
"additionalProperties": false,
"description": "Request body for partially updating a Memory Space",
"properties": {
"customInstructions": {
"anyOf": [
{
"maxLength": 10000,
"type": "string"
},
{
"type": "null"
}
],
"description": "Updated custom prompt instructions used for fact extraction. Pass null to clear and revert to mem0's default extraction prompt.",
"title": "Custominstructions"
},
"description": {
"anyOf": [
{
"maxLength": 1000,
"type": "string"
},
{
"type": "null"
}
],
"description": "Updated description for the memory space.",
"title": "Description"
},
"llmModelName": {
"anyOf": [
{
"maxLength": 200,
"type": "string"
},
{
"type": "null"
}
],
"description": "Updated LLM model name.",
"title": "Llmmodelname"
}
},
"title": "UpdateMemorySpaceRequest",
"type": "object"
}
UpdateMemorySpaceRequest
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| customInstructions | any | false | Updated custom prompt instructions used for fact extraction. Pass null to clear and revert to mem0's default extraction prompt. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 10000 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| description | any | false | Updated description for the memory space. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 1000 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| llmModelName | any | false | Updated LLM model name. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 200 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
UpdateSessionRequest
{
"description": "Schema for session partial patch-updates.",
"properties": {
"description": {
"anyOf": [
{
"maxLength": 1000,
"type": "string"
},
{
"type": "null"
}
],
"description": "New session description.",
"title": "Description"
},
"metadata": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"description": "Custom metadata as key-value pairs for storing application-specific data",
"title": "Metadata"
}
},
"title": "UpdateSessionRequest",
"type": "object"
}
UpdateSessionRequest
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| description | any | false | New session description. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 1000 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| metadata | any | false | Custom metadata as key-value pairs for storing application-specific data |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | object | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
ValidationError
{
"properties": {
"ctx": {
"description": "Additional context about the validation error.",
"title": "Context",
"type": "object"
},
"input": {
"additionalProperties": true,
"description": "The input value that caused the validation error.",
"title": "Input",
"type": "object"
},
"loc": {
"description": "The location in the request where the validation error occurred.",
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"maxItems": 100,
"title": "Location",
"type": "array"
},
"msg": {
"description": "A human-readable description of the validation error.",
"title": "Message",
"type": "string"
},
"type": {
"description": "A machine-readable error type identifier.",
"title": "Error Type",
"type": "string"
}
},
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError",
"type": "object"
}
ValidationError
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| ctx | object | false | Additional context about the validation error. | |
| input | object | false | The input value that caused the validation error. | |
| loc | [anyOf] | true | maxItems: 100 |
The location in the request where the validation error occurred. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | integer | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| msg | string | true | A human-readable description of the validation error. | |
| type | string | true | A machine-readable error type identifier. |