Skip to main content
POST
/
product
/
search
Search memories
curl --request POST \
  --url https://api.example.com/product/search \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "user_id": "<string>",
  "readable_cube_ids": [
    "<string>"
  ],
  "mode": "fast",
  "session_id": "<string>",
  "top_k": 10,
  "pref_top_k": 6,
  "include_preference": true,
  "search_tool_memory": true,
  "tool_mem_top_k": 6,
  "filter": {},
  "internet_search": false,
  "threshold": 123,
  "search_memory_type": "All",
  "chat_history": [
    {
      "content": "<string>",
      "role": "<string>",
      "name": "<string>",
      "chat_time": "<string>",
      "message_id": "<string>"
    }
  ],
  "mem_cube_id": "<string>",
  "moscube": false,
  "operation": [
    {
      "permissions": [
        "read"
      ],
      "mem_cube_id": "<string>"
    }
  ],
  "source": "<string>"
}
'
{
  "message": "<string>",
  "code": 200,
  "data": {}
}

Body

application/json

Request model for searching memories.

query
string
required

User search query

user_id
string
required

User ID

readable_cube_ids
string[] | null

List of cube IDs that are readable for this request. Required for algorithm-facing API; optional for developer-facing API.

mode
enum<string>
default:fast

Search mode: fast, fine, or mixture.

Available options:
fast,
fine,
mixture
session_id
string | null

Session ID used as a soft signal to prioritize more relevant memories. Only used for weighting, not as a hard filter.

top_k
integer
default:10

Number of textual memories to retrieve (top-K). Default: 10.

Required range: x >= 1
pref_top_k
integer
default:6

Number of preference memories to retrieve (top-K). Default: 6.

Required range: x >= 0
include_preference
boolean
default:true

Whether to retrieve preference memories along with general memories. If enabled, the system will automatically recall user preferences relevant to the query. Default: True.

search_tool_memory
boolean
default:true

Whether to retrieve tool memories along with general memories. If enabled, the system will automatically recall tool memories relevant to the query. Default: True.

tool_mem_top_k
integer
default:6

Number of tool memories to retrieve (top-K). Default: 6.

Required range: x >= 0
filter
Filter · object
Filter for the memory, example:
{
"`and` or `or`": [
{"id": "uuid-xxx"},
{"created_at": {"gt": "2024-01-01"}},
]
}

Whether to enable internet search in addition to memory search. Primarily used by internal algorithms. Default: False.

threshold
number | null

Internal similarity threshold for searching plaintext memories. If None, default thresholds will be applied.

search_memory_type
string
default:All

Type of memory to search: All, WorkingMemory, LongTermMemory, UserMemory, OuterMemory, ToolSchemaMemory, ToolTrajectoryMemory

chat_history
(ChatCompletionSystemMessageParam · object | ChatCompletionUserMessageParam · object | ChatCompletionAssistantMessageParam · object | ChatCompletionToolMessageParam · object)[] | null

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

mem_cube_id
string | null

(Deprecated) Single cube ID to search in. Prefer readable_cube_ids for multi-cube search.

moscube
boolean
default:false

(Deprecated / internal) Whether to use legacy MemOSCube path.

operation
PermissionDict · object[] | null

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

source
string | null

Source of the search query [plugin will router diff search]

Response

Successful Response

Response model for search operations.

message
string
required

Response message

code
integer
default:200

Response status code

data
Data · object

Response data