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"
},
"llmBaseUrl": {
"anyOf": [
{
"format": "uri",
"maxLength": 2083,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"description": "Chat API url to use for memory extraction.",
"title": "Llmbaseurl"
},
"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"
},
"llmBaseUrl": {
"anyOf": [
{
"format": "uri",
"maxLength": 2083,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"description": "Chat API url to use for memory extraction.",
"title": "Llmbaseurl"
},
"llmModelName": {
"anyOf": [
{
"maxLength": 200,
"type": "string"
},
{
"type": "null"
}
],
"description": "Name of the LLM model to use for memory extraction. non-reasoning models such as ``gpt-4o`` are recommended. reasoning-capable models are significantly slower for fact extraction without producing meaningfully better results.",
"title": "Llmmodelname"
}
},
"title": "CreateMemorySpaceRequest",
"type": "object"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | CreateMemorySpaceRequest | false | 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"
},
"llmBaseUrl": {
"anyOf": [
{
"format": "uri",
"maxLength": 2083,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"description": "Chat API url to use for memory extraction.",
"title": "Llmbaseurl"
},
"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 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 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"
},
"llmBaseUrl": {
"anyOf": [
{
"format": "uri",
"maxLength": 2083,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"description": "Chat API url to use for memory extraction.",
"title": "Llmbaseurl"
},
"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 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"
},
"llmBaseUrl": {
"anyOf": [
{
"format": "uri",
"maxLength": 2083,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"description": "Chat API url to use for memory extraction.",
"title": "Llmbaseurl"
},
"llmModelName": {
"anyOf": [
{
"maxLength": 200,
"type": "string"
},
{
"type": "null"
}
],
"description": "Updated LLM model name. non-reasoning models such as ``gpt-4o`` are recommended. reasoning-capable models are significantly slower for fact extraction without producing meaningfully better results.",
"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"
},
"llmBaseUrl": {
"anyOf": [
{
"format": "uri",
"maxLength": 2083,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"description": "Chat API url to use for memory extraction.",
"title": "Llmbaseurl"
},
"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 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 (case-insensitive substring match). Must be at least 3 characters. |
| deduplicationKey | query | any | false | Filter sessions by deduplication key (exact match). |
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"
},
"deduplicationKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Deduplication key, unique within the memory space, if one was set.",
"title": "Deduplicationkey"
},
"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. execution status is tracked in the strategy_executions table and can be queried 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). fires 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. fires 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. fires when the session's total token count reaches or exceeds the configured threshold. tokens 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. fires 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"
},
"version": {
"default": 1,
"description": "Monotonic version for optimistic concurrency. echo back as `if-match: \"<version>\"` on patch to detect lost updates.",
"minimum": 1,
"title": "Version",
"type": "integer"
}
},
"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 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"
},
"deduplicationKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Deduplication key, unique within the memory space, if one was set.",
"title": "Deduplicationkey"
},
"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. execution status is tracked in the strategy_executions table and can be queried 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). fires 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. fires 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. fires when the session's total token count reaches or exceeds the configured threshold. tokens 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. fires 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"
},
"version": {
"default": 1,
"description": "Monotonic version for optimistic concurrency. echo back as `if-match: \"<version>\"` on patch to detect lost updates.",
"minimum": 1,
"title": "Version",
"type": "integer"
}
},
"required": [
"id",
"participants",
"createdAt"
],
"title": "SessionResponse",
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | Successful Response | SessionResponse |
| 409 | Conflict | A session with this deduplicationKey already exists in the memory space. Body carries existingSessionId / existingSessionUrl when the live winner can be resolved; the response also sets a Location header to its absolute URL. |
SessionDeduplicationErrorResponse |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Delete Session By Memory_space_ Id 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 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"
},
"deduplicationKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Deduplication key, unique within the memory space, if one was set.",
"title": "Deduplicationkey"
},
"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. execution status is tracked in the strategy_executions table and can be queried 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). fires 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. fires 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. fires when the session's total token count reaches or exceeds the configured threshold. tokens 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. fires 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"
},
"version": {
"default": 1,
"description": "Monotonic version for optimistic concurrency. echo back as `if-match: \"<version>\"` on patch to detect lost updates.",
"minimum": 1,
"title": "Version",
"type": "integer"
}
},
"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 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 |
| If-Match | header | any | false | Optional optimistic-concurrency precondition. Supply the version from the prior response (quoted or bare integer, e.g. "3" or 3). Returns 409 if the stored version no longer matches. |
| 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"
},
"deduplicationKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Deduplication key, unique within the memory space, if one was set.",
"title": "Deduplicationkey"
},
"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. execution status is tracked in the strategy_executions table and can be queried 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). fires 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. fires 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. fires when the session's total token count reaches or exceeds the configured threshold. tokens 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. fires 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"
},
"version": {
"default": 1,
"description": "Monotonic version for optimistic concurrency. echo back as `if-match: \"<version>\"` on patch to detect lost updates.",
"minimum": 1,
"title": "Version",
"type": "integer"
}
},
"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 |
| 409 | Conflict | Session version does not match If-Match precondition | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
List events By Memory_space_ Id 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 | any | false | Filter session events by type. Omit to return events of all types. |
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 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 events Batch By Memory_space_ Id by memory_space_ ID¶
Operation path: PATCH /{memory_space_id}/sessions/{session_id}/events/batch/
Update up to MAX_BATCH_SIZE events atomically; any failure rolls back the batch.
Body parameter¶
{
"description": "Schema for batch event update.",
"properties": {
"events": {
"description": "Events to update.",
"items": {
"description": "A single item of a batch update: identifies the target event by sequence_id. inherits the mutable body/type/emitter fields from updateeventrequest. the inherited \"at least one field present\" validator is overridden below because the always-present sequence_id would otherwise satisfy it vacuously.",
"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."
},
"createdAt": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"description": "Optional per-item version check: must match the target event's timestamp.",
"title": "Createdat"
},
"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."
},
"sequenceId": {
"description": "Target event sequence id within the session.",
"minimum": 0,
"title": "Sequenceid",
"type": "integer"
},
"type": {
"anyOf": [
{
"enum": [
"message",
"tool_output",
"status"
],
"title": "EventType",
"type": "string"
},
{
"type": "null"
}
],
"description": "Updated event type."
}
},
"required": [
"sequenceId"
],
"title": "BatchUpdateEventItem",
"type": "object"
},
"maxItems": 200,
"minItems": 1,
"title": "Events",
"type": "array"
}
},
"required": [
"events"
],
"title": "BatchUpdateEventRequest",
"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 | BatchUpdateEventRequest | true | none |
Example responses¶
200 Response
{
"description": "Envelope wrapping a list of event responses for batch endpoints. per the datarobot API design policy enforced by adipose, every JSON response must be an object. the single-event endpoints already satisfy this; the batch endpoints wrap their list in this envelope so the same rule holds.",
"properties": {
"items": {
"description": "Events processed by the batch operation.",
"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": 200,
"title": "Items",
"type": "array"
}
},
"required": [
"items"
],
"title": "BatchEventResponse",
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successful Response | BatchEventResponse |
| 400 | Bad Request | An event emitter is not a session participant | None |
| 404 | Not Found | Session or one of the events was not found | None |
| 422 | Unprocessable Entity | Tried to update an outdated version of an event | None |
Create events Batch By Memory_space_ Id by memory_space_ ID¶
Operation path: POST /{memory_space_id}/sessions/{session_id}/events/batch/
Append up to MAX_BATCH_SIZE events to a session atomically.
Body parameter¶
{
"description": "Schema for batch event creation. events are appended in list order.",
"properties": {
"events": {
"description": "Events to append, in order.",
"items": {
"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"
},
"maxItems": 200,
"minItems": 1,
"title": "Events",
"type": "array"
}
},
"required": [
"events"
],
"title": "BatchCreateEventRequest",
"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 | BatchCreateEventRequest | true | none |
Example responses¶
201 Response
{
"description": "Envelope wrapping a list of event responses for batch endpoints. per the datarobot API design policy enforced by adipose, every JSON response must be an object. the single-event endpoints already satisfy this; the batch endpoints wrap their list in this envelope so the same rule holds.",
"properties": {
"items": {
"description": "Events processed by the batch operation.",
"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": 200,
"title": "Items",
"type": "array"
}
},
"required": [
"items"
],
"title": "BatchEventResponse",
"type": "object"
}
Responses¶
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | Successful Response | BatchEventResponse |
| 400 | Bad Request | An event emitter is not a session participant | None |
| 404 | Not Found | Session not found | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Delete Event By Memory_space_ Id by memory_space_ ID¶
Operation path: DELETE /{memory_space_id}/sessions/{session_id}/events/{sequence_id}/
Soft-delete one session event by sequence id.
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 |
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 or event not found | None |
| 422 | Unprocessable Entity | Validation Error | HTTPValidationError |
Update Event By Memory_space_ Id 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 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 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 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"
},
"infer": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Infer"
},
"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 |
| 409 | Conflict | Immutable memory with the same content already exists. | None |
| 422 | Unprocessable Entity | Validation error (request body) or domain conflict (content mismatch). | Inline |
| 503 | Service Unavailable | Transient condition (insert conflict or upstream LLM rate limit); retry advised. | None |
Response Schema¶
Response Headers¶
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 503 | Retry-After | integer | none |
Search Memories V1 By Memory_space_ Id 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/ extra=\"ignore\" is set because the mem0 client injects org_id/project_id fields 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"
},
"rerank": {
"default": true,
"title": "Rerank",
"type": "boolean"
},
"runId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Runid"
},
"threshold": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Threshold"
},
"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 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 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 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}. metadata 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 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 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 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 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 extra=\"ignore\" is set because the mem0 client injects org_id/project_id fields 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 | Validation error (request body) or domain conflict (content mismatch). | Inline |
Response Schema¶
Search Memories V2 By Memory_space_ Id 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/ extra=\"ignore\" is set because the mem0 client injects org_id/project_id fields 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"
},
"rerank": {
"default": true,
"title": "Rerank",
"type": "boolean"
},
"runId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Runid"
},
"threshold": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Threshold"
},
"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 | Validation error (request body) or domain conflict (content mismatch). | Inline |
Response Schema¶
Schemas¶
BatchCreateEventRequest
{
"description": "Schema for batch event creation. events are appended in list order.",
"properties": {
"events": {
"description": "Events to append, in order.",
"items": {
"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"
},
"maxItems": 200,
"minItems": 1,
"title": "Events",
"type": "array"
}
},
"required": [
"events"
],
"title": "BatchCreateEventRequest",
"type": "object"
}
BatchCreateEventRequest
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| events | [CreateEventRequest] | true | maxItems: 200 minItems: 1 |
Events to append, in order. |
BatchEventResponse
{
"description": "Envelope wrapping a list of event responses for batch endpoints. per the datarobot API design policy enforced by adipose, every JSON response must be an object. the single-event endpoints already satisfy this; the batch endpoints wrap their list in this envelope so the same rule holds.",
"properties": {
"items": {
"description": "Events processed by the batch operation.",
"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": 200,
"title": "Items",
"type": "array"
}
},
"required": [
"items"
],
"title": "BatchEventResponse",
"type": "object"
}
BatchEventResponse
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| items | [EventResponse] | true | maxItems: 200 |
Events processed by the batch operation. |
BatchUpdateEventItem
{
"description": "A single item of a batch update: identifies the target event by sequence_id. inherits the mutable body/type/emitter fields from updateeventrequest. the inherited \"at least one field present\" validator is overridden below because the always-present sequence_id would otherwise satisfy it vacuously.",
"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."
},
"createdAt": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"description": "Optional per-item version check: must match the target event's timestamp.",
"title": "Createdat"
},
"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."
},
"sequenceId": {
"description": "Target event sequence id within the session.",
"minimum": 0,
"title": "Sequenceid",
"type": "integer"
},
"type": {
"anyOf": [
{
"enum": [
"message",
"tool_output",
"status"
],
"title": "EventType",
"type": "string"
},
{
"type": "null"
}
],
"description": "Updated event type."
}
},
"required": [
"sequenceId"
],
"title": "BatchUpdateEventItem",
"type": "object"
}
BatchUpdateEventItem
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 |
|---|---|---|---|---|
| createdAt | any | false | Optional per-item version check: must match the target event's 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 |
|---|---|---|---|---|
| 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 |
|---|---|---|---|---|
| sequenceId | integer | true | minimum: 0 |
Target event sequence id within the session. |
| 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 |
BatchUpdateEventRequest
{
"description": "Schema for batch event update.",
"properties": {
"events": {
"description": "Events to update.",
"items": {
"description": "A single item of a batch update: identifies the target event by sequence_id. inherits the mutable body/type/emitter fields from updateeventrequest. the inherited \"at least one field present\" validator is overridden below because the always-present sequence_id would otherwise satisfy it vacuously.",
"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."
},
"createdAt": {
"anyOf": [
{
"format": "date-time",
"type": "string"
},
{
"type": "null"
}
],
"description": "Optional per-item version check: must match the target event's timestamp.",
"title": "Createdat"
},
"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."
},
"sequenceId": {
"description": "Target event sequence id within the session.",
"minimum": 0,
"title": "Sequenceid",
"type": "integer"
},
"type": {
"anyOf": [
{
"enum": [
"message",
"tool_output",
"status"
],
"title": "EventType",
"type": "string"
},
{
"type": "null"
}
],
"description": "Updated event type."
}
},
"required": [
"sequenceId"
],
"title": "BatchUpdateEventItem",
"type": "object"
},
"maxItems": 200,
"minItems": 1,
"title": "Events",
"type": "array"
}
},
"required": [
"events"
],
"title": "BatchUpdateEventRequest",
"type": "object"
}
BatchUpdateEventRequest
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| events | [BatchUpdateEventItem] | true | maxItems: 200 minItems: 1 |
Events to update. |
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"
},
"llmBaseUrl": {
"anyOf": [
{
"format": "uri",
"maxLength": 2083,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"description": "Chat API url to use for memory extraction.",
"title": "Llmbaseurl"
},
"llmModelName": {
"anyOf": [
{
"maxLength": 200,
"type": "string"
},
{
"type": "null"
}
],
"description": "Name of the LLM model to use for memory extraction. non-reasoning models such as ``gpt-4o`` are recommended. reasoning-capable models are significantly slower for fact extraction without producing meaningfully better results.",
"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 |
|---|---|---|---|---|
| llmBaseUrl | any | false | Chat API url to use for memory extraction. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string(uri) | false | maxLength: 2083 minLength: 1 minLength: 1 |
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. non-reasoning models such as gpt-4o are recommended. reasoning-capable models are significantly slower for fact extraction without producing meaningfully better results. |
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 |
|---|---|---|---|---|
| deduplicationKey | any | false | Optional key, unique within the memory space, for idempotent session creation by coordinating ha agents. a second create with the same key returns 409. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | maxLength: 72 minLength: 1 minLength: 1 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| 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. fires 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. fires 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. execution status is tracked in the strategy_executions table and can be queried 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). fires 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. fires 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. fires when the session's total token count reaches or exceeds the configured threshold. tokens 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. fires 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"
},
"infer": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"title": "Infer"
},
"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 |
|---|---|---|---|---|
| infer | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | boolean | false | 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 extra=\"ignore\" is set because the mem0 client injects org_id/project_id fields 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/ extra=\"ignore\" is set because the mem0 client injects org_id/project_id fields 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"
},
"rerank": {
"default": true,
"title": "Rerank",
"type": "boolean"
},
"runId": {
"anyOf": [
{
"maxLength": 64,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"title": "Runid"
},
"threshold": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Threshold"
},
"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 |
| rerank | boolean | false | 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 |
|---|---|---|---|---|
| threshold | any | false | none |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | number | false | 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"
},
"llmBaseUrl": {
"anyOf": [
{
"format": "uri",
"maxLength": 2083,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"description": "Chat API url to use for memory extraction.",
"title": "Llmbaseurl"
},
"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 |
|---|---|---|---|---|
| llmBaseUrl | any | false | Chat API url to use for memory extraction. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string(uri) | false | maxLength: 2083 minLength: 1 minLength: 1 |
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}. metadata 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"
},
"llmBaseUrl": {
"anyOf": [
{
"format": "uri",
"maxLength": 2083,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"description": "Chat API url to use for memory extraction.",
"title": "Llmbaseurl"
},
"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"
},
"deduplicationKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Deduplication key, unique within the memory space, if one was set.",
"title": "Deduplicationkey"
},
"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. execution status is tracked in the strategy_executions table and can be queried 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). fires 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. fires 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. fires when the session's total token count reaches or exceeds the configured threshold. tokens 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. fires 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"
},
"version": {
"default": 1,
"description": "Monotonic version for optimistic concurrency. echo back as `if-match: \"<version>\"` on patch to detect lost updates.",
"minimum": 1,
"title": "Version",
"type": "integer"
}
},
"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. |
SessionDeduplicationErrorResponse
{
"description": "Body returned with HTTP 409 when a session create collides on `deduplicationkey`. carries enough context for an ha-replica caller to adopt the existing winner without a second round-trip: the live session's id and a path to it.",
"properties": {
"deduplicationKey": {
"description": "The deduplication key that triggered the conflict.",
"title": "Deduplicationkey",
"type": "string"
},
"detail": {
"description": "Human-readable explanation of the conflict.",
"title": "Detail",
"type": "string"
},
"errorName": {
"const": "SessionDeduplicationConflict",
"default": "SessionDeduplicationConflict",
"description": "Stable machine-readable error name. clients should switch on this, not detail.",
"title": "Errorname",
"type": "string"
},
"existingSessionId": {
"anyOf": [
{
"format": "uuid",
"type": "string"
},
{
"type": "null"
}
],
"description": "Id of the live session already holding the key, or null if it could not be resolved (e.g. concurrently soft-deleted).",
"title": "Existingsessionid"
},
"existingSessionUrl": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Path to get the existing session. null when `existingsessionid` is null. mirrors the `location` response header (which is absolute).",
"title": "Existingsessionurl"
}
},
"required": [
"detail",
"deduplicationKey"
],
"title": "SessionDeduplicationErrorResponse",
"type": "object"
}
SessionDeduplicationErrorResponse
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| deduplicationKey | string | true | The deduplication key that triggered the conflict. | |
| detail | string | true | Human-readable explanation of the conflict. | |
| errorName | string | false | Stable machine-readable error name. clients should switch on this, not detail. | |
| existingSessionId | any | false | Id of the live session already holding the key, or null if it could not be resolved (e.g. concurrently soft-deleted). |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string(uuid) | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| existingSessionUrl | any | false | Path to get the existing session. null when existingsessionid is null. mirrors the location response header (which is absolute). |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
SessionResponse
{
"description": "Schema for session response.",
"properties": {
"createdAt": {
"description": "Session creation timestamp.",
"format": "date-time",
"title": "Createdat",
"type": "string"
},
"deduplicationKey": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Deduplication key, unique within the memory space, if one was set.",
"title": "Deduplicationkey"
},
"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. execution status is tracked in the strategy_executions table and can be queried 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). fires 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. fires 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. fires when the session's total token count reaches or exceeds the configured threshold. tokens 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. fires 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"
},
"version": {
"default": 1,
"description": "Monotonic version for optimistic concurrency. echo back as `if-match: \"<version>\"` on patch to detect lost updates.",
"minimum": 1,
"title": "Version",
"type": "integer"
}
},
"required": [
"id",
"participants",
"createdAt"
],
"title": "SessionResponse",
"type": "object"
}
SessionResponse
Properties¶
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| createdAt | string(date-time) | true | Session creation timestamp. | |
| deduplicationKey | any | false | Deduplication key, unique within the memory space, if one was set. |
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 | 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. |
| version | integer | false | minimum: 1 |
Monotonic version for optimistic concurrency. echo back as if-match: "<version>" on patch to detect lost updates. |
TTLTrigger
{
"additionalProperties": false,
"description": "Trigger based on time-to-live (session age). fires 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. fires when the session's total token count reaches or exceeds the configured threshold. tokens 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"
},
"llmBaseUrl": {
"anyOf": [
{
"format": "uri",
"maxLength": 2083,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"description": "Chat API url to use for memory extraction.",
"title": "Llmbaseurl"
},
"llmModelName": {
"anyOf": [
{
"maxLength": 200,
"type": "string"
},
{
"type": "null"
}
],
"description": "Updated LLM model name. non-reasoning models such as ``gpt-4o`` are recommended. reasoning-capable models are significantly slower for fact extraction without producing meaningfully better results.",
"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 |
|---|---|---|---|---|
| llmBaseUrl | any | false | Chat API url to use for memory extraction. |
anyOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string(uri) | false | maxLength: 2083 minLength: 1 minLength: 1 |
none |
or
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | null | false | none |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| llmModelName | any | false | Updated LLM model name. non-reasoning models such as gpt-4o are recommended. reasoning-capable models are significantly slower for fact extraction without producing meaningfully better results. |
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. |