Overview
This API allows you to skip dialogue extraction and directly write a structured piece of content as a memory to the specified memory space.
API details
Constraints
- You must have an API key. For more information, see Manage AI API keys.
Request path
POST {BASE_URL}/api/v1/memory/spaces/{spaceId}/memories
Request headers
Name |
Required |
Example Value |
Description |
|---|---|---|---|
| Authorization | Yes | Bearer {token} | Authentication Information |
| X-OB-Project-ID | Yes | your-project-id | Project ID |
| Content-Type | No | application/json | Request Body Format |
Request parameters
Path parameters
Name |
Type |
Whether required |
Example Value |
Description |
|---|---|---|---|---|
| spaceId | string | Yes | space-123 | Memory space ID. |
Body parameters
Name |
Type |
Whether required |
Example Value |
Description |
|---|---|---|---|---|
| content | string | Yes | The customer inquired about the pricing of Product A at 3:00 PM yesterday. | Memory content. |
| metadata | object | No | {"source":"chat"} | Memory metadata, supporting custom key-value pairs. |
Response parameters
Response parameters
Name |
Type |
Description |
|---|---|---|
| success | boolean | Whether the request was successful |
| code | string | Response Code |
| message | string | Response parameters |
| data | object | Business response data |
Data field description
The structure of the returned data is unknown.
Request example
curl --request POST '{BASE_URL}/api/v1/memory/spaces/space-123/memories' \
--header 'Authorization: Bearer {token}' \
--header 'X-OB-Project-ID: your-project-id' \
--header 'Content-Type: application/json' \
--data '{
"content": "The user inquired about the pricing of Product A at 3:00 PM yesterday.",
"metadata": {
"source": "chat",
"importance": "high"
}
}'
Response example
{
"success": true,
"code": "200",
"message": "Write succeeded",
"data": {}
}
