Overview
Submit a multi-turn conversation in the ReAct/tool invocation style to the server. The model will distill reusable experience entries (including sample code and common pitfalls). The service returns the number and summary of experiences written this time.
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/distill
Request headers
Name |
Required |
Example Value |
Description |
|---|---|---|---|
| Authorization | Yes | Bearer {token} | Authentication Information |
| Content-Type | No | application/json | Request Body Format |
| X-OB-Project-ID | Yes | your-project-id | Project ID |
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 |
|---|---|---|---|---|
| messages | array |
Yes | [{"role":"user","content":"Hello"}] | List of conversation messages. |
| messages[].role | string | Yes | user | Message role. Valid values: user, assistant, and system. |
| messages[].content | string | Yes | Hello | The content of the message. |
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
Name |
Type |
Description |
|---|---|---|
| count | integer | Number of Experience Entries Written |
| summary | string | Summary |
Request example
curl --request POST '{BASE_URL}/api/v1/memory/spaces/mem-space-123/memories/distill' \
--header 'Authorization: Bearer {token}' \
--header 'X-OB-Project-ID: your-project-id' \
--header 'Content-Type: application/json' \
--data '{
"messages": []
}'
Response example
{
"success": true,
"code": "200",
"message": "successful",
"data": {
"count": 5,
"summary": "Successfully distilled 5 insights on error handling and API calls from the dialogue."
}
}
