Add memories

Add memories for a specific user.

POST
/
product
/
add
{
  "code": 0,
  "message": "<string>",
  "data": [
    null
  ]
}

Body

application/json
user_id
string

User ID

session_id
string

Session ID. If not provided, a default session will be used.

task_id
string

Task ID for monitering async tasks

writable_cube_ids
string[]

List of cube IDs user can write for multi-cube add

async_mode
string
default: async

Whether to add memory in async mode. Use 'async' to enqueue background add (non-blocking), or 'sync' to add memories in the current call. Default: 'async'.

Enum:"async""sync"
mode
string

(Internal) Add mode used only when async_mode='sync'. If set to 'fast', the handler will use a fast add pipeline. Ignored when async_mode='async'.

Enum:"fast""fine"
custom_tags
string[]

Custom tags for this add request, e.g. ['Travel', 'family']. These tags can be used as filters in search.

info
object

Additional metadata for the add request. All keys can be used as filters in search.

messages
string | object[]

List of messages to store.

chat_history
object[]

Historical chat messages used internally by algorithms. If None, internal stored history will be used; if provided (even an empty list), this value will be used as-is.

is_feedback
boolean
default: false

Whether this request represents user feedback. Default: False.

mem_cube_id
string

(Deprecated) Target cube ID for this add request (optional for developer API).

memory_content
string

(Deprecated) Plain memory content to store. Prefer using `messages`.

doc_path
string

(Deprecated / internal) Path to document to store.

source
string

(Deprecated) Simple source tag of the memory. Prefer using `info.source_type` / `info.source_url`.

operation
object[]

(Internal) Operation definitions for multi-cube write permissions.

Response

application/json

Successful Response

code
number
default: 200

Response status code

message
string
required

Response message

data
any[]

Response data