Skip to main content

Update context management settings

POST 

/api/v1/llm/update-context-management-settings

Updates how the conversation selects and compacts context for later generations.

See Context and compaction for strategy selection and outcome handling.

The following access conditions are preserved as declared intent and are not implemented by generated code: Authorized scoped domain action.

Use this in a guide: Resume a long conversation with a compacted history · Context and compaction

Request​

Responses​

Context management settings updated

Update the window size for an existing conversation already using the windowing strategy.​

Section ID: DOC-MA-conversations-api-updateContextManagementSettings#example-conversations-updateContextManagementSettings-request

Request example

{
"conversationKey": "example_123",
"contextManagementSettings": {
"strategy": "CONTEXT_STRATEGY_WINDOWING",
"windowingConfig": {
"maxMessages": 50
}
}
}

Guide request for Recipe: compact the older history, then continue the thread. Replace example resource identifiers with your own authorized values.​

Section ID: DOC-MA-conversations-api-updateContextManagementSettings#example-cookbook-managed-agents-conversations-context-management-01-request

Request example

{
"conversationKey": "support-chat-001",
"contextManagementSettings": {
"strategy": "CONTEXT_STRATEGY_COMPACTION",
"compactionConfig": {
"mode": "COMPACTION_MODE_SYNC",
"threshold": {
"percentage": 80
},
"preserveRecent": 10
}
}
}

Guide request for Variant: omit a file or tool result that later replies no longer need. Replace example resource identifiers with your own authorized values.​

Section ID: DOC-MA-conversations-api-updateContextManagementSettings#example-cookbook-managed-agents-conversations-context-management-04-request

Request example

{
"conversationKey": "support-chat-001",
"contextManagementSettings": {
"strategy": "CONTEXT_STRATEGY_COMPACTION",
"selectiveExclusionConfig": {
"excludeToolResults": true,
"excludeImages": true
}
}
}

Illustrative response shape; omitted default fields and actual outcomes depend on the operation.​

Section ID: DOC-MA-conversations-api-updateContextManagementSettings#example-conversations-updateContextManagementSettings-response

Response example

{
"contextManagementSettings": {
"strategy": "CONTEXT_STRATEGY_COMPACTION",
"compactionConfig": {
"mode": "COMPACTION_MODE_SYNC",
"preserveRecent": 1
},
"windowingConfig": {
"maxMessages": 1
},
"selectiveExclusionConfig": {
"excludeToolResults": true,
"excludeImages": true,
"excludeFiles": true,
"excludeReasoning": true
}
}
}

Document ID: DOC-MA-conversations-api-updateContextManagementSettings. Section identities and revisions.

SectionStable reference
Update context management settingsDOC-MA-conversations-api-updateContextManagementSettings#overview
RequestDOC-MA-conversations-api-updateContextManagementSettings#request
ResponsesDOC-MA-conversations-api-updateContextManagementSettings#responses