Skip to main content

Compaction

Compaction metadata

Usage profiles​

UsageFields and validation
In responsesView fields

In responses​

API JSON uses JSON field names (camelCase).

FieldTypePresenceMeaning
idstringOptionalIdentifier of the compaction record.
startSequencestring (int64)OptionalSequence number of the first conversation message represented by the compaction. Pattern: ^-?\d+$.
endSequencestring (int64)OptionalSequence number of the last conversation message represented by the compaction. Pattern: ^-?\d+$.
summarystringOptionalSummary text produced by conversation compaction.
originalTokenCountinteger (int32)OptionalEstimated token count of the context before compaction. Minimum: -2147483648. Maximum: 2147483647.
summaryTokenCountinteger (int32)OptionalEstimated token count of the generated summary. Minimum: -2147483648. Maximum: 2147483647.
modelUsedstringOptionalModel identifier used for the context compaction.
createdAtstring (date-time)OptionalTime when this record was created.
statusstring (COMPACTION_STATUS_PENDING, COMPACTION_STATUS_COMPLETED, COMPACTION_STATUS_FAILED) or integer (int32)OptionalExecution state of the conversation compaction.
triggerReasonstring (COMPACTION_TRIGGER_REASON_THRESHOLD_EXCEEDED, COMPACTION_TRIGGER_REASON_MANUAL) or integer (int32)OptionalReason for triggering this compaction (auto threshold vs manual)

Values of status​

Execution state of a conversation context-compaction attempt.

ValueNo.FormMeaning
COMPACTION_STATUS_PENDING1CanonicalCompaction was started and its result is still pending.
COMPACTION_STATUS_COMPLETED2CanonicalCompaction completed and produced its result.
COMPACTION_STATUS_FAILED3CanonicalCompaction failed; inspect the associated error.

Values of triggerReason​

Reason a conversation context-compaction attempt was started.

ValueNo.FormMeaning
COMPACTION_TRIGGER_REASON_THRESHOLD_EXCEEDED1CanonicalContext usage crossed the configured compaction threshold.
COMPACTION_TRIGGER_REASON_MANUAL2CanonicalA caller explicitly requested compaction.

Where used​

ReferenceRelationship
Get full conversation statePOST /api/v1/llm/conversation-state

Download the public reference contract.

Document: DOC-API-MODEL-compaction.