cURL
Asynchronously stores user conversations as memories. The API returns an event ID immediately while memory extraction runs in the background. Use GetEvent to query execution status and results. Compared with the synchronous AddMemory, the async API does not wait for extraction to finish within the request, making it suitable for long conversations with many turns.
Replace
Before calling, ensure you have obtained an API Key. See Authentication.
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | string | Yes | Memory entity ID, used to identify the owning object, max 64 characters |
messages | array | Yes* | Conversation message list, up to 50 entries. role supports user / assistant / tool; content supports a text string or a multimodal array in standard OpenAI format; assistant messages may carry tool_calls; messages with role set to tool must carry the corresponding tool_call_id |
custom_content | string | Yes* | Custom content, max 512 characters. Mutually exclusive with messages, and can only be bound to one project_id |
profile_schema | string | No | Profile schema ID. If omitted, no user profile is extracted |
memory_library_id | string | No | Memory library ID. If not provided, the default library is used |
project_id | string | No | Custom project ID for secondary memory isolation. Mutually exclusive with project_ids |
project_ids | array[string] | No | Multiple custom project IDs. Mutually exclusive with project_id |
skill_name | string | No | Name of the skill content |
skill_description | string | No | Description of the skill content |
skill_tags | array[string] | No | Tags of the skill content |
meta_data | object | No | User-defined information |
messages and custom_content are mutually exclusive. When custom_content is provided, messages is ignored.Response
| Field | Type | Description |
|---|---|---|
request_id | string | Request ID |
event_id | string | ID of the execution event |
events | array | List of execution tasks. A single call may produce multiple tasks, for example one for factual memories and one for the user profile |
events[].event_id | string | Event ID |
events[].event_type | string | Event type, for example ADD_ASYNC |
events[].resource_type | string | Task source type: observation / skill / profile |
events[].resource_id | string | Task source ID, the corresponding project or profile ID |
events[].memory_library_id | string | Memory library ID of the task |
events[].user_id | string | Memory entity ID of the task |
events[].status | string | Task status: PENDING / SUCCEEDED / FAILED / UNRECORDED |
events[].created_at | integer | Task creation timestamp |
events[].updated_at | integer | Timestamp of the last task status update |
Code examples
Replace {workspaceId} with your actual workspace ID.
cURL
Authorizations
string
header
required
Body
application/jsonstring
required
记忆实体 ID,最大 64 字符
object[]
对话消息列表,最多 50 条。与 custom_content 互斥
string
自定义内容,最大 512 字符。与 messages 互斥,只能绑定到一个 project_id
string
画像模板 ID。不传则不提取用户画像
string
记忆库 ID,不传则使用默认记忆库
string
自定义项目 ID,与 project_ids 互斥
string[]
多个自定义项目 ID,与 project_id 互斥
string
skill 内容名称。project 为 skill 且传入 custom_content 时必传
string
skill 内容描述。project 为 skill 且传入 custom_content 时必传
string[]
skill 内容标签。project 为 skill 且传入 custom_content 时必传
object
用户自定义信息